railo.runtime.type.scope
Class CookieImpl

java.lang.Object
  extended by railo.runtime.type.util.StructSupport
      extended by railo.runtime.type.StructImpl
          extended by railo.runtime.type.scope.ScopeSupport
              extended by railo.runtime.type.scope.CookieImpl
All Implemented Interfaces:
Serializable, Cloneable, Map, Dumpable, Castable, Collection, ForEachIteratorable, Iteratorable, Objects, Cookie, Scope, ScriptProtected, SharedScope, UserScope, Sizeable, Struct

public final class CookieImpl
extends ScopeSupport
implements Cookie, ScriptProtected

Implementation of the Cookie scope

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface railo.runtime.type.Collection
Collection.Key
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
static int NEVER
           
 
Fields inherited from interface railo.runtime.type.scope.Scope
SCOPE_APPLICATION, SCOPE_ARGUMENTS, SCOPE_CALLER, SCOPE_CGI, SCOPE_CLIENT, SCOPE_CLUSTER, SCOPE_COOKIE, SCOPE_COUNT, SCOPE_FORM, SCOPE_LOCAL, SCOPE_REQUEST, SCOPE_SERVER, SCOPE_SESSION, SCOPE_UNDEFINED, SCOPE_URL, SCOPE_VAR, SCOPE_VARIABLES
 
Fields inherited from interface railo.runtime.type.Struct
TYPE_LINKED, TYPE_REGULAR, TYPE_SOFT, TYPE_SYNC, TYPE_WEAKED
 
Fields inherited from interface railo.runtime.type.scope.ScriptProtected
NO, UNDEFINED, YES
 
Constructor Summary
CookieImpl()
          constructor for the Cookie Scope
 
Method Summary
 void clear()
          clears the collection
 String dec(String str)
           
 String enc(String str)
           
 void initialize(PageContext pc)
          Initalize Scope
static boolean isHTTPOnly(javax.servlet.http.Cookie cookie)
           
 boolean isScriptProtected()
           
 void release()
          release scope for reuse
 void release(PageContext pc)
          release scope for reuse
 Object remove(Collection.Key key)
          removes value from collection and return it when it exists, otherwise throws a exception
 Object remove(Collection.Key key, boolean alsoInResponse)
           
 Object removeEL(Collection.Key key)
          removes value from collection and return it when it exists, otherwise returns null
 void resetEnv(PageContext pc)
           
 Object set(Collection.Key key, Object value)
          sets a value to the collection
 void setCookie(Collection.Key key, Object value, int expires, boolean secure, String path, String domain)
          set a cookie value
 void setCookie(Collection.Key key, Object value, int expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase, boolean encode)
          set a cookie value
 void setCookie(Collection.Key key, Object value, Object expires, boolean secure, String path, String domain)
          set a cookie value
 void setCookie(Collection.Key key, Object value, Object expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase, boolean encode)
          set a cookie value
 void setCookieEL(Collection.Key key, Object value, int expires, boolean secure, String path, String domain)
          set a cookie value
 void setCookieEL(Collection.Key key, Object value, int expires, boolean secure, String path, String domain, boolean httpOnly, boolean preserveCase, boolean encode)
          set a cookie value
 Object setEL(Collection.Key key, Object value)
          sets a value to the collection, if key doesn't exist, dont throw a exception, returns null
static void setHTTPOnly(javax.servlet.http.Cookie cookie)
           
 void setScriptProtecting(ApplicationContext ac, boolean scriptProtected)
          transform the string values of the scope do a script protecting way
 void touchAfterRequest(PageContext pc)
          release scope only for current request, scope will be used again
 void touchBeforeRequest(PageContext pc)
          Initalize Scope only for this request, scope was already used
 
Methods inherited from class railo.runtime.type.scope.ScopeSupport
_getId, getType, getTypeAsString, isInitalized, sizeOf, toDumpData, toDumpData
 
Methods inherited from class railo.runtime.type.StructImpl
containsKey, containsValue, copy, duplicate, entryIterator, equals, g, g, get, get, hashCode, keyIterator, keys, keysAsStringIterator, size, valueIterator, values
 
Methods inherited from class railo.runtime.type.util.StructSupport
call, callWithNamedValues, castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, clone, compareTo, compareTo, compareTo, compareTo, containsKey, containsKey, entrySet, get, get, get, get, get, getIterator, invalidKey, isEmpty, keySet, put, putAll, remove, set, set, setEL, setEL, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface railo.runtime.type.scope.Scope
getType, getTypeAsString, isInitalized
 
Methods inherited from interface railo.runtime.type.Collection
clone, containsKey, containsKey, duplicate, get, get, get, get, keys, set, setEL, size
 
Methods inherited from interface railo.runtime.type.Iteratorable
entryIterator, keyIterator, keysAsStringIterator, valueIterator
 
Methods inherited from interface railo.runtime.type.ForEachIteratorable
getIterator
 
Methods inherited from interface java.util.Map
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from interface railo.runtime.type.Sizeable
sizeOf
 
Methods inherited from interface railo.runtime.type.Objects
call, callWithNamedValues, get, get, set, setEL
 
Methods inherited from interface railo.runtime.dump.Dumpable
toDumpData
 
Methods inherited from interface railo.runtime.op.Castable
castToBoolean, castToBooleanValue, castToDateTime, castToDateTime, castToDoubleValue, castToDoubleValue, castToString, castToString, compareTo, compareTo, compareTo, compareTo
 

Field Detail

NEVER

public static final int NEVER
See Also:
Constant Field Values
Constructor Detail

CookieImpl

public CookieImpl()
constructor for the Cookie Scope

Method Detail

setEL

public Object setEL(Collection.Key key,
                    Object value)
Description copied from interface: Collection
sets a value to the collection, if key doesn't exist, dont throw a exception, returns null

Specified by:
setEL in interface Collection
Overrides:
setEL in class StructImpl
Parameters:
key - key of the value to get
value - value to set
Returns:
value on key position or null

set

public Object set(Collection.Key key,
                  Object value)
           throws PageException
Description copied from interface: Collection
sets a value to the collection

Specified by:
set in interface Collection
Overrides:
set in class StructImpl
Parameters:
key - key of the new value
value - value to set
Returns:
value setted
Throws:
PageException

clear

public void clear()
Description copied from interface: Collection
clears the collection

Specified by:
clear in interface Map
Specified by:
clear in interface Collection
Overrides:
clear in class StructImpl

remove

public Object remove(Collection.Key key)
              throws PageException
Description copied from interface: Collection
removes value from collection and return it when it exists, otherwise throws a exception

Specified by:
remove in interface Collection
Overrides:
remove in class StructImpl
Parameters:
key - key of the collection
Returns:
removed Object
Throws:
PageException

remove

public Object remove(Collection.Key key,
                     boolean alsoInResponse)
              throws PageException
Throws:
PageException

removeEL

public Object removeEL(Collection.Key key)
Description copied from interface: Collection
removes value from collection and return it when it exists, otherwise returns null

Specified by:
removeEL in interface Collection
Overrides:
removeEL in class StructImpl
Parameters:
key - key of the collection
Returns:
removed Object

setCookie

public void setCookie(Collection.Key key,
                      Object value,
                      Object expires,
                      boolean secure,
                      String path,
                      String domain)
               throws PageException
Description copied from interface: Cookie
set a cookie value

Specified by:
setCookie in interface Cookie
Parameters:
key - name of the cookie
value - value of the cookie
expires - expirs of the cookie (Date, number in seconds or keyword as string )
secure - set secure or not
path - path of the cookie
domain - domain of the cookie
Throws:
PageException

setCookie

public void setCookie(Collection.Key key,
                      Object value,
                      int expires,
                      boolean secure,
                      String path,
                      String domain)
               throws PageException
Description copied from interface: Cookie
set a cookie value

Specified by:
setCookie in interface Cookie
Parameters:
key - Name of the cookie
value - value of the cookie
expires - expires in seconds
secure - secute or not
path - path of the cookie
domain - domain of the cookie
Throws:
PageException

setCookieEL

public void setCookieEL(Collection.Key key,
                        Object value,
                        int expires,
                        boolean secure,
                        String path,
                        String domain)
Description copied from interface: Cookie
set a cookie value

Specified by:
setCookieEL in interface Cookie
Parameters:
key - Name of the cookie
value - value of the cookie
expires - expires in seconds
secure - secute or not
path - path of the cookie
domain - domain of the cookie

setCookie

public void setCookie(Collection.Key key,
                      Object value,
                      Object expires,
                      boolean secure,
                      String path,
                      String domain,
                      boolean httpOnly,
                      boolean preserveCase,
                      boolean encode)
               throws PageException
Description copied from interface: Cookie
set a cookie value

Specified by:
setCookie in interface Cookie
Parameters:
key - name of the cookie
value - value of the cookie
expires - expirs of the cookie (Date, number in seconds or keyword as string )
secure - set secure or not
path - path of the cookie
domain - domain of the cookie
httpOnly - if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.
preserveCase - if true, keep the case of the name as it is
encode - if true, url encode the name and the value
Throws:
PageException

setCookie

public void setCookie(Collection.Key key,
                      Object value,
                      int expires,
                      boolean secure,
                      String path,
                      String domain,
                      boolean httpOnly,
                      boolean preserveCase,
                      boolean encode)
               throws PageException
Description copied from interface: Cookie
set a cookie value

Specified by:
setCookie in interface Cookie
Parameters:
key - Name of the cookie
value - value of the cookie
expires - expires in seconds
secure - secute or not
path - path of the cookie
domain - domain of the cookie
httpOnly - if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.
preserveCase - if true, keep the case of the name as it is
encode - if true, url encode the name and the value
Throws:
PageException

setCookieEL

public void setCookieEL(Collection.Key key,
                        Object value,
                        int expires,
                        boolean secure,
                        String path,
                        String domain,
                        boolean httpOnly,
                        boolean preserveCase,
                        boolean encode)
Description copied from interface: Cookie
set a cookie value

Specified by:
setCookieEL in interface Cookie
Parameters:
key - Name of the cookie
value - value of the cookie
expires - expires in seconds
secure - secute or not
path - path of the cookie
domain - domain of the cookie
httpOnly - if true, sets cookie as httponly so that it cannot be accessed using JavaScripts. Note that the browser must have httponly compatibility.
preserveCase - if true, keep the case of the name as it is
encode - if true, url encode the name and the value

initialize

public void initialize(PageContext pc)
Description copied from interface: Scope
Initalize Scope

Specified by:
initialize in interface Scope
Overrides:
initialize in class ScopeSupport
Parameters:
pc - Page Context

release

public void release()
Description copied from interface: Scope
release scope for reuse

Specified by:
release in interface Scope
Overrides:
release in class ScopeSupport

release

public void release(PageContext pc)
Description copied from interface: Scope
release scope for reuse

Specified by:
release in interface Scope
Overrides:
release in class ScopeSupport

isScriptProtected

public boolean isScriptProtected()
Specified by:
isScriptProtected in interface ScriptProtected
Returns:
returns if the values of the scope are already protected against cross site scripting

setScriptProtecting

public void setScriptProtecting(ApplicationContext ac,
                                boolean scriptProtected)
Description copied from interface: ScriptProtected
transform the string values of the scope do a script protecting way

Specified by:
setScriptProtecting in interface ScriptProtected

dec

public String dec(String str)

enc

public String enc(String str)

resetEnv

public void resetEnv(PageContext pc)
Specified by:
resetEnv in interface UserScope

touchBeforeRequest

public void touchBeforeRequest(PageContext pc)
Description copied from interface: SharedScope
Initalize Scope only for this request, scope was already used

Specified by:
touchBeforeRequest in interface SharedScope
Parameters:
pc - Page Context

touchAfterRequest

public void touchAfterRequest(PageContext pc)
Description copied from interface: SharedScope
release scope only for current request, scope will be used again

Specified by:
touchAfterRequest in interface SharedScope

setHTTPOnly

public static void setHTTPOnly(javax.servlet.http.Cookie cookie)

isHTTPOnly

public static boolean isHTTPOnly(javax.servlet.http.Cookie cookie)


Copyright © 2012 Railo