public abstract class OwAttributeBagCodec extends OwCookieStoreCodec
An OwCookieStoreCodec implementation that stores cookies using the Alfresco Workdesk
attribute bag mechanism.
The codec uses a bag for the unique index storage ( the master bag) and another bag
for cookie expiration time storage (the cookie table bag).
Cookie mapped values are stored in individual bags with map parameter mapped to
bag parameters. The codec does no support multiple value parameters.
The index name uniqueness is guaranteed per virtual machine.
Attribute bag access is also synchronized per virtual machine.
This codec is not suitable for cluster based usage.
OwAttributeBag instance access is delegated to subclasses.
Alfresco Workdesk
Copyright (c) Alfresco Software, Inc.
All rights reserved.
For licensing information read the license.txt file or
go to: http://wiki.alfresco.com
OwAttributeBag,
OwAttributeBagWriteableOwCookieStoreCodec.OwTimedCookie, OwCookieStoreCodec.OwTimedCookieValue| Modifier and Type | Field and Description |
|---|---|
static String |
CONFIGURATION_ATTRIBUTEBAGS_ELEMENT |
static String |
CONFIGURATION_CODEC_PREFIX_ATTRIBUTE |
static String |
CONFIGURATION_COOKIE_PREFIX_ATTRIBUTE |
static String |
CONFIGURATION_USER_ATTRIBUTE |
static String |
DEFAULT_CODEC_BAGS_PREFIX |
static String |
DEFAULT_CONFIG_BAG_USER_NAME |
static String |
DEFAULT_COOKIE_BAGS_PREFIX |
CONFIGURATION_BOOTSTRAP_ELEMENT_NAME, CONFIGURATION_DAYS_ATTRIBUTE, CONFIGURATION_HOURS_ATTRIBUTE, CONFIGURATION_MINUTES_ATTRIBUTE, CONFIGURATION_NAME_ATTRIBUTE, CONFIGURATION_SECONDS_ATTRIBUTE, CONFIGURATION_URL_LIFE_TIME_ELEMENT, CONFIGURATION_URL_PARAMETER_ELEMENT, DEFAULT_CONFIG_URL_LIFE_TIME, DEFAULT_URL_PARAMETER_NAME| Constructor and Description |
|---|
OwAttributeBagCodec(String cookieParameterName_p,
long namesExpirationTime_p,
String codecBagsPrefix_p,
String cookieBagsPrefix_p)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCookieValue(OwCookieStoreCodec.OwTimedCookieValue timedCookieValue_p)
Adds the given
OwCookieStoreCodec.OwTimedCookieValue to the cookie store |
protected String |
cookieBagName(String cookieName_p) |
protected String |
cookieTableBagName() |
protected List |
createTimedCookieCollectList()
Hook method that returns a list of
OwCookieStoreCodec.OwTimedCookies to be collected. |
protected abstract OwAttributeBagWriteable |
getBag(String bagName_p,
boolean create_p) |
protected OwAttributeBagWriteable |
getCookieBag(String cookieName_p,
boolean create_p) |
protected OwAttributeBagWriteable |
getCookieTableBag() |
protected OwCookieStoreCodec.OwTimedCookieValue |
getCookieValue(String cookieName_p) |
protected long |
getInitialValueForIndex()
Get the start value for index.
|
protected OwAttributeBagWriteable |
getMasterBag() |
long |
getNextUnqiueNameIndex()
Get the next available unique index.
|
static String[] |
loadAttributeBagsConfiguation(OwXMLUtil codecConfiguration_p)
Loads the AttributeBags XML configuration element.
The expected XML structure is the following : AttributeBags - tag Configures the attribute bag storage name for the parameters maps. In order to prevent name conflicts in attribute bags usage unique bag names prefixes should be specified here. Attributes : codecprefix = a string prefix to be used in codec internal bag names cookieprefix = a string prefix to be used in codec internal bag names that will store cookie based parameter maps user = user to be used when storing codec attribute bags |
protected String |
masterBagName() |
protected void |
remove(OwCookieStoreCodec.OwTimedCookie timedCookie_p)
Removes the given
OwCookieStoreCodec.OwTimedCookie from cookie storage. |
canDecode, collectExpiredNames, createCookie, decode, encode, loadUrlLifeTimeConfig, loadUrlParameterConfigpublic static final String DEFAULT_CODEC_BAGS_PREFIX
public static final String DEFAULT_COOKIE_BAGS_PREFIX
public static final String DEFAULT_CONFIG_BAG_USER_NAME
public static final String CONFIGURATION_ATTRIBUTEBAGS_ELEMENT
public static final String CONFIGURATION_CODEC_PREFIX_ATTRIBUTE
public static final String CONFIGURATION_COOKIE_PREFIX_ATTRIBUTE
public static final String CONFIGURATION_USER_ATTRIBUTE
public OwAttributeBagCodec(String cookieParameterName_p, long namesExpirationTime_p, String codecBagsPrefix_p, String cookieBagsPrefix_p)
cookieParameterName_p - name of the encoded URL parameternamesExpirationTime_p - the time in which a cookie will expire (in milliseconds)codecBagsPrefix_p - String prefix to be used with the index bag name and the cookie times table bagcookieBagsPrefix_p - String prefix to be used in creation of the individual cookie bagspublic static String[] loadAttributeBagsConfiguation(OwXMLUtil codecConfiguration_p) throws Exception
codecConfiguration_p - Exceptionprotected String masterBagName()
protected String cookieTableBagName()
protected String cookieBagName(String cookieName_p)
cookieName_p - protected abstract OwAttributeBagWriteable getBag(String bagName_p, boolean create_p) throws Exception
bagName_p - create_p - if true the given bag should be created if not foundExceptionprotected OwAttributeBagWriteable getMasterBag() throws Exception
Exceptionprotected OwAttributeBagWriteable getCookieTableBag() throws Exception
Exceptionprotected OwAttributeBagWriteable getCookieBag(String cookieName_p, boolean create_p) throws Exception
cookieName_p - create_p - Exceptionprotected void addCookieValue(OwCookieStoreCodec.OwTimedCookieValue timedCookieValue_p) throws OwException
OwCookieStoreCodecOwCookieStoreCodec.OwTimedCookieValue to the cookie storeaddCookieValue in class OwCookieStoreCodecOwExceptionprotected List createTimedCookieCollectList() throws OwException
OwCookieStoreCodecOwCookieStoreCodec.OwTimedCookies to be collected.createTimedCookieCollectList in class OwCookieStoreCodecList of OwCookieStoreCodec.OwTimedCookieOwException - if the collect List creation failsOwCookieStoreCodec.collectExpiredNames()protected OwCookieStoreCodec.OwTimedCookieValue getCookieValue(String cookieName_p) throws OwException
getCookieValue in class OwCookieStoreCodecOwCookieStoreCodec.OwTimedCookieValue for the given cookieOwExceptionprotected void remove(OwCookieStoreCodec.OwTimedCookie timedCookie_p) throws OwException
OwCookieStoreCodecOwCookieStoreCodec.OwTimedCookie from cookie storage.remove in class OwCookieStoreCodecOwExceptionpublic long getNextUnqiueNameIndex()
throws OwException
OwParameterMapCodecOwExceptionprotected long getInitialValueForIndex()
Copyright © 2014 Alfresco Business Solutions. All Rights Reserved.