com.wewebu.ow.server.util.paramcodec
Class OwNetworkAttributeBagCodec

java.lang.Object
  extended by com.wewebu.ow.server.util.paramcodec.OwCookieStoreCodec
      extended by com.wewebu.ow.server.util.paramcodec.OwAttributeBagCodec
          extended by com.wewebu.ow.server.util.paramcodec.OwNetworkAttributeBagCodec
All Implemented Interfaces:
OwParameterMapCodec

public class OwNetworkAttributeBagCodec
extends OwAttributeBagCodec

OwNetwork based implementation of the OwAttributeBagCodec.
Uses an instance of OwNetwork to access attribute bags.

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

Since:
3.0.0.0
See Also:
OwAttributeBag, OwAttributeBagWriteable

Nested Class Summary
 
Nested classes/interfaces inherited from class com.wewebu.ow.server.util.paramcodec.OwCookieStoreCodec
OwCookieStoreCodec.OwTimedCookie, OwCookieStoreCodec.OwTimedCookieValue
 
Field Summary
static String DEFAULT_CODEC_BAGS_PSEUDO_USER
           
 
Fields inherited from class com.wewebu.ow.server.util.paramcodec.OwAttributeBagCodec
CONFIGURATION_ATTRIBUTEBAGS_ELEMENT, CONFIGURATION_CODEC_PREFIX_ATTRIBUTE, CONFIGURATION_COOKIE_PREFIX_ATTRIBUTE, CONFIGURATION_USER_ATTRIBUTE, DEFAULT_CODEC_BAGS_PREFIX, DEFAULT_CONFIG_BAG_USER_NAME, DEFAULT_COOKIE_BAGS_PREFIX
 
Fields inherited from class com.wewebu.ow.server.util.paramcodec.OwCookieStoreCodec
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 Summary
OwNetworkAttributeBagCodec(OwNetwork netowrk_p, String cookieParameterName_p, long namesExpirationTime_p, String codecBagsPrefix_p, String cookieBagsPrefix_p, String codecBagsUser_p)
           
 
Method Summary
static OwNetworkAttributeBagCodec createConfiguredCodec(OwMainAppContext context_p)
          Creates a new OwNetworkAttributeBagCodec based on the bootstrap configuration that is
accessed through the given OwMainAppContext.
The expected XML structure of the URLParameterCodec tag element is the following :

URLLifeTime - tag
Configures the amount of time an encoded URL parameter map is valid.
After that the parameter map is considered expired and links that relay
on are considered out of date / expired and will not produce the desired response.

Attributes :
days = days until the parameter map expires considering the URL parameter map encoding time
hours = hours until the parameter map expires considering the URL parameter map encoding time
minutes = minutes until the parameter map expires considering the URL parameter map encoding time
seconds = seconds until the parameter map expires considering the URL parameter map encoding time


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

CookieParameter - tag
The parameter map codec encodes a parameter map into another parameter map containing
one cookie defining parameter.
protected  OwAttributeBagWriteable getBag(String bagName_p, boolean create_p)
           
 
Methods inherited from class com.wewebu.ow.server.util.paramcodec.OwAttributeBagCodec
addCookieValue, cookieBagName, cookieTableBagName, createTimedCookieCollectList, getCookieBag, getCookieTableBag, getCookieValue, getInitialValueForIndex, getMasterBag, getNextUnqiueNameIndex, loadAttributeBagsConfiguation, masterBagName, remove
 
Methods inherited from class com.wewebu.ow.server.util.paramcodec.OwCookieStoreCodec
canDecode, collectExpiredNames, createCookie, decode, encode, loadUrlLifeTimeConfig, loadUrlParameterConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CODEC_BAGS_PSEUDO_USER

public static final String DEFAULT_CODEC_BAGS_PSEUDO_USER
See Also:
Constant Field Values
Constructor Detail

OwNetworkAttributeBagCodec

public OwNetworkAttributeBagCodec(OwNetwork netowrk_p,
                                  String cookieParameterName_p,
                                  long namesExpirationTime_p,
                                  String codecBagsPrefix_p,
                                  String cookieBagsPrefix_p,
                                  String codecBagsUser_p)
Parameters:
netowrk_p - the OwNetwork instance used to access attribute bags
cookieParameterName_p -
namesExpirationTime_p -
codecBagsPrefix_p -
cookieBagsPrefix_p -
codecBagsUser_p -
Method Detail

createConfiguredCodec

public static OwNetworkAttributeBagCodec createConfiguredCodec(OwMainAppContext context_p)
                                                        throws OwInvalidOperationException
Creates a new OwNetworkAttributeBagCodec based on the bootstrap configuration that is
accessed through the given OwMainAppContext.
The expected XML structure of the URLParameterCodec tag element is the following :

URLLifeTime - tag
Configures the amount of time an encoded URL parameter map is valid.
After that the parameter map is considered expired and links that relay
on are considered out of date / expired and will not produce the desired response.

Attributes :
days = days until the parameter map expires considering the URL parameter map encoding time
hours = hours until the parameter map expires considering the URL parameter map encoding time
minutes = minutes until the parameter map expires considering the URL parameter map encoding time
seconds = seconds until the parameter map expires considering the URL parameter map encoding time


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

CookieParameter - tag
The parameter map codec encodes a parameter map into another parameter map containing
one cookie defining parameter.

Attributes :
name = string name of the URL parameter

Parameters:
context_p -
Returns:
the configured codec
Throws:
OwInvalidOperationException

getBag

protected OwAttributeBagWriteable getBag(String bagName_p,
                                         boolean create_p)
                                  throws Exception
Specified by:
getBag in class OwAttributeBagCodec
create_p - if true the given bag should be created if not found
Returns:
the bag with the given name
Throws:
Exception


Copyright © 2013 Alfresco Business Solutions. All Rights Reserved.