com.ibm.portal.resolver.helper
Class DefaultDataSource

java.lang.Object
  extended by com.ibm.portal.resolver.helper.DefaultDataSource
All Implemented Interfaces:
Disposable, Addressable, DataSource, DataSourceFragment, TimeStamped
Direct Known Subclasses:
EarlyBindingDataSource

public abstract class DefaultDataSource
extends java.lang.Object
implements DataSource

Bean that holds the metadata for a DataSource.

Since:
7.0
Note:
This interface is designed to be implemented by clients.

Field Summary
 
Fields inherited from interface com.ibm.portal.resolver.data.DataSource
CONTENT_TYPE_UNKNOWN, CREATION_UNKNOWN, EXPIRATION_UNKNOWN, LAST_MODIFICATION_UNKNOWN, MAX_AGE_INFINITE, MAX_AGE_NONE, ROOT_DATE
 
Fields inherited from interface com.ibm.portal.resolver.data.Addressable
EMPTY_PARAMETERS
 
Constructor Summary
DefaultDataSource()
           
 
Method Summary
protected  void clear()
          Reset the parameters
static java.util.Map<java.lang.String,java.lang.String[]> createParameters()
          Convenience method to construct a new parameter map
 void dispose()
          Indicate that the object will no longer be accessed
 java.util.Map<java.lang.String,java.lang.String> getCacheControlExtensions()
          Returns a map of cache control extensions that get added to the cache control header, as defined in ://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.6
 CacheControlDataSource.CACHE_POLICY getCachePolicy()
          Returns the caching policy for the data
protected  CacheControlDataSource.CACHE_POLICY getCachePolicy(CacheControlDataSource.CACHE_POLICY aDefault)
          Decodes the cache policy from a parameter map
static CacheControlDataSource.CACHE_POLICY getCachePolicy(java.util.Map<java.lang.String,java.lang.String[]> parameters, CacheControlDataSource.CACHE_POLICY aDefault)
          Decodes the cache policy from a parameter map
static CacheControlDataSource.CACHE_POLICY getCachePolicy(ParameterAccessor parameters, CacheControlDataSource.CACHE_POLICY aDefault)
          Decodes the cache policy from a parameter map
static CacheControlDataSource.CACHE_POLICY getCachePolicy(java.lang.String aPolicy)
          Decodes the cache-policy string into a cache policy enumeration
static CacheControlDataSource.CACHE_POLICY getCachePolicy(java.lang.String aPolicy, CacheControlDataSource.CACHE_POLICY aDefault)
          Decodes the cache-policy string into a cache policy enumeration
 CacheControlDataSource.CACHE_SCOPE getCacheScope()
          Returns the cache scope for the data
protected  CacheControlDataSource.CACHE_SCOPE getCacheScope(CacheControlDataSource.CACHE_SCOPE aDefault)
          Decodes the cache scope from a parameter map
static CacheControlDataSource.CACHE_SCOPE getCacheScope(java.util.Map<java.lang.String,java.lang.String[]> parameters, CacheControlDataSource.CACHE_SCOPE aDefault)
          Decodes the cache policy from a parameter map
static CacheControlDataSource.CACHE_SCOPE getCacheScope(ParameterAccessor parameters, CacheControlDataSource.CACHE_SCOPE aDefault)
          Decodes the cache policy from a parameter map
static CacheControlDataSource.CACHE_SCOPE getCacheScope(java.lang.String aScope)
          Decodes the cache-scope string into a cache scope enumeration
static CacheControlDataSource.CACHE_SCOPE getCacheScope(java.lang.String aScope, CacheControlDataSource.CACHE_SCOPE aDefault)
          Decodes the cache-scope string into a cache scope enumeration
 java.lang.String getContentType()
          Mime type of the data.
static java.lang.String getContentType(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String aDefault)
          Decodes the cache policy from a parameter map
static java.lang.String getContentType(ParameterAccessor parameters, java.lang.String aDefault)
          Decodes the cache policy from a parameter map
protected  java.lang.String getContentType(java.lang.String aDefault)
          Decodes the content type from a parameter map
static java.lang.String getContentType(java.lang.String aContentType, java.lang.String aDefault)
          Decodes the content type identifier
 java.util.Date getCreated()
          Returns the creation date of the resource.
 java.util.Date getExpiration()
          Absolute timestamp that indicates the time when the data represented by the source will expire.
protected  java.util.Date getExpiration(java.util.Date currentDate, java.util.Date defaultExpiration)
          Decodes the expiry from the parameters
protected  java.util.Date getExpiration(java.util.Date currentDate, long defaultMaxAge)
          Decodes the expiry from the parameters
protected  java.util.Date getExpiration(long currentDate, java.util.Date defaultExpiration)
          Decodes the expiry from the parameters
protected  java.util.Date getExpiration(long currentDate, long defaultMaxAge)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.util.Date currentDate, java.util.Date defaultExpiration)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.util.Date currentDate, long defaultMaxAge)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, long currentDate, java.util.Date defaultExpiration)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, long currentDate, long defaultMaxAge)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(ParameterAccessor parameters, java.util.Date currentDate, java.util.Date defaultExpiration)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(ParameterAccessor parameters, java.util.Date currentDate, long defaultMaxAge)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(ParameterAccessor parameters, long currentDate, java.util.Date defaultExpiration)
          Decodes the expiry from the parameters
static java.util.Date getExpiration(ParameterAccessor parameters, long currentDate, long defaultMaxAge)
          Decodes the expiry from the parameters
 java.util.Date getLastModified()
          Returns the modification date of the resource.
protected  java.lang.String getParameter(java.lang.String aKey)
          Decodes the first value from the paramaters
static java.lang.String getParameter(java.lang.String key, java.util.Map<java.lang.String,java.lang.String[]> parameters)
          Decodes the first string value from the parameters
static java.lang.String getParameter(java.lang.String key, java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String aDefault)
          Decodes the first string value from the parameters
static java.lang.String getParameter(java.lang.String key, ParameterAccessor parameters)
          Decodes the first string value from the parameters
static java.lang.String getParameter(java.lang.String key, ParameterAccessor parameters, java.lang.String aDefault)
          Decodes the first string value from the parameters
protected  java.lang.String getParameter(java.lang.String aKey, java.lang.String aDefault)
          Decodes the first value from the paramaters
 java.util.Map<java.lang.String,java.lang.String[]> getParameters()
           Returns an potentially unmodifiable version of the parameters used to address the object, never null, but potentially the empty map.
protected  java.lang.String[] getParameters(java.lang.String aKey)
          Returns the parameters for a particular key
protected  java.lang.String[] getParameters(java.lang.String aKey, java.lang.String... aDefaults)
          Returns the parameters for a particular key
protected  java.lang.Boolean getProjectContext(java.lang.Boolean aDefault)
          Decodes the project context from a parameter map
static java.lang.Boolean getProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.Boolean aDefault)
          Decodes the project scope flag
static java.lang.Boolean getProjectContext(ParameterAccessor parameters, java.lang.Boolean aDefault)
          Decodes the project scope flag
static java.lang.Boolean getProjectContext(java.lang.String aProjectContext, java.lang.Boolean aDefault)
          Decodes the project context string into a boolean representation
 java.net.URI getURI()
          Returns the unique identifier of the object.
protected  java.lang.Boolean getUserContext(java.lang.Boolean aDefault)
          Decodes the user context from a parameter map
static java.lang.Boolean getUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.Boolean aDefault)
          Decodes the user context flag
static java.lang.Boolean getUserContext(ParameterAccessor parameters, java.lang.Boolean aDefault)
          Decodes the user context flag
static java.lang.Boolean getUserContext(java.lang.String aUserContext, java.lang.Boolean aDefault)
          Decodes the user context string into a boolean representation
 java.lang.String[] getVaryHeaders()
          Returns a list of HTTP request headers that the content of the data source depends on.
static java.lang.String[] getVaryHeaders(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String[] aDefault)
          Decodes the vary headers from the parameter map
static java.lang.String[] getVaryHeaders(ParameterAccessor parameters, java.lang.String[] aDefault)
          Decodes the vary headers from the parameter map
protected  java.lang.String[] getVaryHeaders(java.lang.String[] aDefault)
          Returns the vary headers
protected  java.lang.Boolean getVirtualPortalContext(java.lang.Boolean aDefault)
          Decodes the virtual portal context from a parameter map
static java.lang.Boolean getVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.Boolean aDefault)
          Decodes the virtual portal context flag
static java.lang.Boolean getVirtualPortalContext(ParameterAccessor parameters, java.lang.Boolean aDefault)
          Decodes the virtual portal context flag
static java.lang.Boolean getVirtualPortalContext(java.lang.String aVirtualPortalContext, java.lang.Boolean aDefault)
          Decodes the virtual portal context string into a boolean representation
 java.lang.Boolean isPrivate()
          Indicates if the data source depends on the user context (if any).
 java.lang.Boolean isProjectDependent()
           
 java.lang.Boolean isVirtualPortalDependent()
           
protected  void setAddressable(Addressable addr)
          Copies URI and parameters from the addressable object
static java.util.Map<java.lang.String,java.lang.String[]> setCachePolicy(java.util.Map<java.lang.String,java.lang.String[]> parameters, CacheControlDataSource.CACHE_POLICY value)
          Assigns a cache-policy override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setCachePolicy(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a cache-policy override to the parameter map
static ParameterAccessorController setCachePolicy(ParameterAccessorController parameters, CacheControlDataSource.CACHE_POLICY value)
          Assigns a cache-policy override to the parameter map
static ParameterAccessorController setCachePolicy(ParameterAccessorController parameters, java.lang.String value)
          Assigns a cache-policy override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setCacheScope(java.util.Map<java.lang.String,java.lang.String[]> parameters, CacheControlDataSource.CACHE_SCOPE value)
          Assigns a cache-scope override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setCacheScope(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a cache-scope override to the parameter map
static ParameterAccessorController setCacheScope(ParameterAccessorController parameters, CacheControlDataSource.CACHE_SCOPE value)
          Assigns a cache-scope override to the parameter map
static ParameterAccessorController setCacheScope(ParameterAccessorController parameters, java.lang.String value)
          Assigns a cache-scope override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setContentType(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a content type override to the parameter map
static ParameterAccessorController setContentType(ParameterAccessorController parameters, java.lang.String value)
          Assigns a content type override to the parameter map
protected  void setContentType(java.lang.String contentType)
           
protected  void setCreated(java.util.Date created)
           
protected  void setDataSource(DataSource ds)
          Copies the metadata from the data source
static java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.util.Date currentTime, java.util.Date expiryTime)
          Assigns a expiry override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, long value)
          Assigns a expiry override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, long currentTime, long expiryTime)
          Assigns a expiry override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a expiry override to the parameter map
static ParameterAccessorController setExpiration(ParameterAccessorController parameters, java.util.Date currentTime, java.util.Date expiryTime)
          Assigns a expiry override to the parameter map
static ParameterAccessorController setExpiration(ParameterAccessorController parameters, long value)
          Assigns a expiry override to the parameter map
static ParameterAccessorController setExpiration(ParameterAccessorController parameters, long currentTime, long expiryTime)
          Assigns a expiry override to the parameter map
static ParameterAccessorController setExpiration(ParameterAccessorController parameters, java.lang.String value)
          Assigns a expiry override to the parameter map
protected  void setExpires(java.util.Date expires)
           
protected  void setLastMod(java.util.Date lastMod)
           
protected  void setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
           
static java.util.Map<java.lang.String,java.lang.String[]> setProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, boolean value)
          Assigns a project context override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.Boolean value)
          Assigns a project context override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a project context override to the parameter map
static ParameterAccessorController setProjectContext(ParameterAccessorController parameters, boolean value)
          Assigns a project context override to the parameter map
static ParameterAccessorController setProjectContext(ParameterAccessorController parameters, java.lang.Boolean value)
          Assigns a project context override to the parameter map
static ParameterAccessorController setProjectContext(ParameterAccessorController parameters, java.lang.String value)
          Assigns a project context override to the parameter map
protected  void setUri(java.net.URI uri)
          Deprecated. use setURI(URI) instead
protected  void setURI(java.net.URI uri)
           
static java.util.Map<java.lang.String,java.lang.String[]> setUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, boolean value)
          Assigns a user context override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.Boolean value)
          Assigns a user context override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a user context override to the parameter map
static ParameterAccessorController setUserContext(ParameterAccessorController parameters, boolean value)
          Assigns a user context override to the parameter map
static ParameterAccessorController setUserContext(ParameterAccessorController parameters, java.lang.Boolean value)
          Assigns a user context override to the parameter map
static ParameterAccessorController setUserContext(ParameterAccessorController parameters, java.lang.String value)
          Assigns a user context override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setVaryHeaders(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String... values)
          Assigns a vary header override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setVaryHeaders(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a vary header override to the parameter map
static ParameterAccessorController setVaryHeaders(ParameterAccessorController parameters, java.lang.String... values)
          Assigns a vary header override to the parameter map
static ParameterAccessorController setVaryHeaders(ParameterAccessorController parameters, java.lang.String value)
          Assigns a vary header override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, boolean value)
          Assigns a user context override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.Boolean value)
          Assigns a virtual portal context override to the parameter map
static java.util.Map<java.lang.String,java.lang.String[]> setVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters, java.lang.String value)
          Assigns a user context override to the parameter map
static ParameterAccessorController setVirtualPortalContext(ParameterAccessorController parameters, boolean value)
          Assigns a user context override to the parameter map
static ParameterAccessorController setVirtualPortalContext(ParameterAccessorController parameters, java.lang.Boolean value)
          Assigns a virtual portal context override to the parameter map
static ParameterAccessorController setVirtualPortalContext(ParameterAccessorController parameters, java.lang.String value)
          Assigns a user context override to the parameter map
static java.lang.String valueOf(java.lang.Boolean aValue)
          Converts the boolean parameter to the string value of the parameter
static java.lang.String valueOf(CacheControlDataSource.CACHE_POLICY aPolicy)
          Converts the cache policy to the string value of the parameter
static java.lang.String valueOf(CacheControlDataSource.CACHE_SCOPE aScope)
          Converts the cache scope to the string value of the parameter
static java.lang.String valueOf(long aValue)
          Converts a long value, e.g.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDataSource

public DefaultDataSource()
Method Detail

createParameters

public static final java.util.Map<java.lang.String,java.lang.String[]> createParameters()
Convenience method to construct a new parameter map

Returns:
the new map, not null

getCachePolicy

public static final CacheControlDataSource.CACHE_POLICY getCachePolicy(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                       CacheControlDataSource.CACHE_POLICY aDefault)
Decodes the cache policy from a parameter map

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the decoded cache policy

getCachePolicy

public static final CacheControlDataSource.CACHE_POLICY getCachePolicy(ParameterAccessor parameters,
                                                                       CacheControlDataSource.CACHE_POLICY aDefault)
Decodes the cache policy from a parameter map

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the decoded cache policy

getCachePolicy

public static final CacheControlDataSource.CACHE_POLICY getCachePolicy(java.lang.String aPolicy)
Decodes the cache-policy string into a cache policy enumeration

Parameters:
aPolicy - the string, may be null
Returns:
the enumeration
Since:
7.0

getCachePolicy

public static final CacheControlDataSource.CACHE_POLICY getCachePolicy(java.lang.String aPolicy,
                                                                       CacheControlDataSource.CACHE_POLICY aDefault)
Decodes the cache-policy string into a cache policy enumeration

Parameters:
aPolicy - the string, may be null
Returns:
the enumeration
Since:
7.0

getCacheScope

public static final CacheControlDataSource.CACHE_SCOPE getCacheScope(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                     CacheControlDataSource.CACHE_SCOPE aDefault)
Decodes the cache policy from a parameter map

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the decoded cache policy

getCacheScope

public static final CacheControlDataSource.CACHE_SCOPE getCacheScope(ParameterAccessor parameters,
                                                                     CacheControlDataSource.CACHE_SCOPE aDefault)
Decodes the cache policy from a parameter map

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the decoded cache policy

getCacheScope

public static final CacheControlDataSource.CACHE_SCOPE getCacheScope(java.lang.String aScope)
Decodes the cache-scope string into a cache scope enumeration

Parameters:
aScope - the string, may be null
Returns:
the enumeration
Since:
7.0

getCacheScope

public static final CacheControlDataSource.CACHE_SCOPE getCacheScope(java.lang.String aScope,
                                                                     CacheControlDataSource.CACHE_SCOPE aDefault)
Decodes the cache-scope string into a cache scope enumeration

Parameters:
aScope - the string, may be null
Returns:
the enumeration
Since:
7.0

getContentType

public static final java.lang.String getContentType(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                    java.lang.String aDefault)
Decodes the cache policy from a parameter map

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the decoded content type

getContentType

public static final java.lang.String getContentType(ParameterAccessor parameters,
                                                    java.lang.String aDefault)
Decodes the cache policy from a parameter map

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the decoded content type

getContentType

public static final java.lang.String getContentType(java.lang.String aContentType,
                                                    java.lang.String aDefault)
Decodes the content type identifier

Parameters:
aContentType - the content type, may be null
aDefault - the fallback to use if the content type has not been set, may be null
Returns:
the decoded content type
Since:
8.5

getExpiration

public static final java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                 java.util.Date currentDate,
                                                 java.util.Date defaultExpiration)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultExpiration - default expiry timestamp or null
Returns:
the expiry date or null
Since:
8.0

getExpiration

public static final java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                 java.util.Date currentDate,
                                                 long defaultMaxAge)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultMaxAge - default expiry in seconds, may be <0
Returns:
the expiry date or null

getExpiration

public static final java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                 long currentDate,
                                                 java.util.Date defaultExpiration)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultExpiration - default expiry timestamp or null
Returns:
the expiry date or null

getExpiration

public static final java.util.Date getExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                 long currentDate,
                                                 long defaultMaxAge)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultMaxAge - default expiry in seconds, may be <0
Returns:
the expiry date or null

getExpiration

public static final java.util.Date getExpiration(ParameterAccessor parameters,
                                                 java.util.Date currentDate,
                                                 java.util.Date defaultExpiration)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultExpiration - default expiry timestamp or null
Returns:
the expiry date or null
Since:
8.0

getExpiration

public static final java.util.Date getExpiration(ParameterAccessor parameters,
                                                 java.util.Date currentDate,
                                                 long defaultMaxAge)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultMaxAge - default expiry in seconds, may be <0
Returns:
the expiry date or null

getExpiration

public static final java.util.Date getExpiration(ParameterAccessor parameters,
                                                 long currentDate,
                                                 java.util.Date defaultExpiration)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultExpiration - default expiry timestamp or null
Returns:
the expiry date or null

getExpiration

public static final java.util.Date getExpiration(ParameterAccessor parameters,
                                                 long currentDate,
                                                 long defaultMaxAge)
Decodes the expiry from the parameters

Parameters:
parameters - the parameters
currentDate - current date
defaultMaxAge - default expiry in seconds, may be <0
Returns:
the expiry date or null

getParameter

public static final java.lang.String getParameter(java.lang.String key,
                                                  java.util.Map<java.lang.String,java.lang.String[]> parameters)
Decodes the first string value from the parameters

Parameters:
key - key
parameters - parameters
Returns:
the first value or null

getParameter

public static final java.lang.String getParameter(java.lang.String key,
                                                  java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                  java.lang.String aDefault)
Decodes the first string value from the parameters

Parameters:
key - key
parameters - parameters
aDefault -
Returns:
the first value or the default

getParameter

public static final java.lang.String getParameter(java.lang.String key,
                                                  ParameterAccessor parameters)
Decodes the first string value from the parameters

Parameters:
key - key
parameters - parameters
Returns:
the first value or null

getParameter

public static final java.lang.String getParameter(java.lang.String key,
                                                  ParameterAccessor parameters,
                                                  java.lang.String aDefault)
Decodes the first string value from the parameters

Parameters:
key - key
parameters - parameters
aDefault -
Returns:
the first value or the default

getProjectContext

public static final java.lang.Boolean getProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                        java.lang.Boolean aDefault)
Decodes the project scope flag

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the project scope flag
Since:
8.0

getProjectContext

public static final java.lang.Boolean getProjectContext(ParameterAccessor parameters,
                                                        java.lang.Boolean aDefault)
Decodes the project scope flag

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the project scope flag
Since:
8.0

getProjectContext

public static final java.lang.Boolean getProjectContext(java.lang.String aProjectContext,
                                                        java.lang.Boolean aDefault)
Decodes the project context string into a boolean representation

Parameters:
aProjectContext - the string, may be null
Returns:
the project scope flag
Since:
8.0

getUserContext

public static final java.lang.Boolean getUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                     java.lang.Boolean aDefault)
Decodes the user context flag

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the user context flag

getUserContext

public static final java.lang.Boolean getUserContext(ParameterAccessor parameters,
                                                     java.lang.Boolean aDefault)
Decodes the user context flag

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the user context flag

getUserContext

public static final java.lang.Boolean getUserContext(java.lang.String aUserContext,
                                                     java.lang.Boolean aDefault)
Decodes the user context string into a boolean representation

Parameters:
aUserContext - the string, may be null
Returns:
the enumeration
Since:
7.0

getVaryHeaders

public static final java.lang.String[] getVaryHeaders(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                      java.lang.String[] aDefault)
Decodes the vary headers from the parameter map

Parameters:
parameters - parameters
aDefault -
Returns:
the vary headers or the default

getVaryHeaders

public static final java.lang.String[] getVaryHeaders(ParameterAccessor parameters,
                                                      java.lang.String[] aDefault)
Decodes the vary headers from the parameter map

Parameters:
parameters - parameters
aDefault -
Returns:
the vary headers or the default

getVirtualPortalContext

public static final java.lang.Boolean getVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                              java.lang.Boolean aDefault)
Decodes the virtual portal context flag

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the virtual portal context flag
Since:
8.0

getVirtualPortalContext

public static final java.lang.Boolean getVirtualPortalContext(ParameterAccessor parameters,
                                                              java.lang.Boolean aDefault)
Decodes the virtual portal context flag

Parameters:
parameters - the parameters
aDefault - the default value
Returns:
the virtual portal context flag
Since:
8.0

getVirtualPortalContext

public static final java.lang.Boolean getVirtualPortalContext(java.lang.String aVirtualPortalContext,
                                                              java.lang.Boolean aDefault)
Decodes the virtual portal context string into a boolean representation

Parameters:
aVirtualPortalContext - the string, may be null
Returns:
the virtual portal context flag
Since:
8.0

setCachePolicy

public static final java.util.Map<java.lang.String,java.lang.String[]> setCachePolicy(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      CacheControlDataSource.CACHE_POLICY value)
Assigns a cache-policy override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setCachePolicy

public static final java.util.Map<java.lang.String,java.lang.String[]> setCachePolicy(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      java.lang.String value)
Assigns a cache-policy override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setCachePolicy

public static final ParameterAccessorController setCachePolicy(ParameterAccessorController parameters,
                                                               CacheControlDataSource.CACHE_POLICY value)
Assigns a cache-policy override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setCachePolicy

public static final ParameterAccessorController setCachePolicy(ParameterAccessorController parameters,
                                                               java.lang.String value)
Assigns a cache-policy override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setCacheScope

public static final java.util.Map<java.lang.String,java.lang.String[]> setCacheScope(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                     CacheControlDataSource.CACHE_SCOPE value)
Assigns a cache-scope override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setCacheScope

public static final java.util.Map<java.lang.String,java.lang.String[]> setCacheScope(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                     java.lang.String value)
Assigns a cache-scope override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setCacheScope

public static final ParameterAccessorController setCacheScope(ParameterAccessorController parameters,
                                                              CacheControlDataSource.CACHE_SCOPE value)
Assigns a cache-scope override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setCacheScope

public static final ParameterAccessorController setCacheScope(ParameterAccessorController parameters,
                                                              java.lang.String value)
Assigns a cache-scope override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setContentType

public static final java.util.Map<java.lang.String,java.lang.String[]> setContentType(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      java.lang.String value)
Assigns a content type override to the parameter map

Parameters:
parameters - target parameters
value - content type value
Since:
8.5

setContentType

public static final ParameterAccessorController setContentType(ParameterAccessorController parameters,
                                                               java.lang.String value)
Assigns a content type override to the parameter map

Parameters:
parameters - target parameters
value - content type value
Since:
8.5

setExpiration

public static final java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                     java.util.Date currentTime,
                                                                                     java.util.Date expiryTime)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
currentTime - current timestamp
expiryTime - time the resource expires
Since:
8.0

setExpiration

public static final java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                     long value)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
value - value, delta in milliseconds
Since:
8.0

setExpiration

public static final java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                     long currentTime,
                                                                                     long expiryTime)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
currentTime - current timestamp
expiryTime - time the resource expires
Since:
8.0

setExpiration

public static final java.util.Map<java.lang.String,java.lang.String[]> setExpiration(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                     java.lang.String value)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
value - value, delta in seconds
Since:
8.0

setExpiration

public static final ParameterAccessorController setExpiration(ParameterAccessorController parameters,
                                                              java.util.Date currentTime,
                                                              java.util.Date expiryTime)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
currentTime - current timestamp
expiryTime - time the resource expires
Since:
8.0

setExpiration

public static final ParameterAccessorController setExpiration(ParameterAccessorController parameters,
                                                              long value)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
value - value, delta in milliseconds
Since:
8.0

setExpiration

public static final ParameterAccessorController setExpiration(ParameterAccessorController parameters,
                                                              long currentTime,
                                                              long expiryTime)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
currentTime - current timestamp
expiryTime - time the resource expires
Since:
8.0

setExpiration

public static final ParameterAccessorController setExpiration(ParameterAccessorController parameters,
                                                              java.lang.String value)
Assigns a expiry override to the parameter map

Parameters:
parameters - target parameters
value - value, delta in seconds
Since:
8.0

setProjectContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                         boolean value)
Assigns a project context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setProjectContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                         java.lang.Boolean value)
Assigns a project context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setProjectContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setProjectContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                         java.lang.String value)
Assigns a project context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setProjectContext

public static final ParameterAccessorController setProjectContext(ParameterAccessorController parameters,
                                                                  boolean value)
Assigns a project context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setProjectContext

public static final ParameterAccessorController setProjectContext(ParameterAccessorController parameters,
                                                                  java.lang.Boolean value)
Assigns a project context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setProjectContext

public static final ParameterAccessorController setProjectContext(ParameterAccessorController parameters,
                                                                  java.lang.String value)
Assigns a project context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setUserContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      boolean value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setUserContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      java.lang.Boolean value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setUserContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setUserContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      java.lang.String value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setUserContext

public static final ParameterAccessorController setUserContext(ParameterAccessorController parameters,
                                                               boolean value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setUserContext

public static final ParameterAccessorController setUserContext(ParameterAccessorController parameters,
                                                               java.lang.Boolean value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setUserContext

public static final ParameterAccessorController setUserContext(ParameterAccessorController parameters,
                                                               java.lang.String value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVaryHeaders

public static final java.util.Map<java.lang.String,java.lang.String[]> setVaryHeaders(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      java.lang.String value)
Assigns a vary header override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVaryHeaders

public static final java.util.Map<java.lang.String,java.lang.String[]> setVaryHeaders(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                      java.lang.String... values)
Assigns a vary header override to the parameter map

Parameters:
parameters - target parameters
values - values
Since:
8.0

setVaryHeaders

public static final ParameterAccessorController setVaryHeaders(ParameterAccessorController parameters,
                                                               java.lang.String value)
Assigns a vary header override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVaryHeaders

public static final ParameterAccessorController setVaryHeaders(ParameterAccessorController parameters,
                                                               java.lang.String... values)
Assigns a vary header override to the parameter map

Parameters:
parameters - target parameters
values - values
Since:
8.0

setVirtualPortalContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                               boolean value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVirtualPortalContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                               java.lang.Boolean value)
Assigns a virtual portal context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVirtualPortalContext

public static final java.util.Map<java.lang.String,java.lang.String[]> setVirtualPortalContext(java.util.Map<java.lang.String,java.lang.String[]> parameters,
                                                                                               java.lang.String value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVirtualPortalContext

public static final ParameterAccessorController setVirtualPortalContext(ParameterAccessorController parameters,
                                                                        boolean value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVirtualPortalContext

public static final ParameterAccessorController setVirtualPortalContext(ParameterAccessorController parameters,
                                                                        java.lang.Boolean value)
Assigns a virtual portal context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

setVirtualPortalContext

public static final ParameterAccessorController setVirtualPortalContext(ParameterAccessorController parameters,
                                                                        java.lang.String value)
Assigns a user context override to the parameter map

Parameters:
parameters - target parameters
value - value
Since:
8.0

valueOf

public static final java.lang.String valueOf(java.lang.Boolean aValue)
Converts the boolean parameter to the string value of the parameter

Parameters:
aaValue - the value
Returns:
the string parameter
Since:
8.0

valueOf

public static final java.lang.String valueOf(CacheControlDataSource.CACHE_POLICY aPolicy)
Converts the cache policy to the string value of the parameter

Parameters:
aPolicy - the policy
Returns:
the string parameter
Since:
8.0

valueOf

public static final java.lang.String valueOf(CacheControlDataSource.CACHE_SCOPE aScope)
Converts the cache scope to the string value of the parameter

Parameters:
aScope - the scope
Returns:
the string parameter
Since:
8.0

valueOf

public static final java.lang.String valueOf(long aValue)
Converts a long value, e.g. the expiry time to a parameter value

Parameters:
aValue - the string value
Returns:
the string parameter
Since:
8.0

clear

protected void clear()
Reset the parameters


dispose

public void dispose()
Description copied from interface: Disposable
Indicate that the object will no longer be accessed

Specified by:
dispose in interface Disposable

getCacheControlExtensions

public java.util.Map<java.lang.String,java.lang.String> getCacheControlExtensions()
Returns a map of cache control extensions that get added to the cache control header, as defined in ://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.6

Returns:
the extensions or null

getCachePolicy

public CacheControlDataSource.CACHE_POLICY getCachePolicy()
Returns the caching policy for the data

Returns:
cache policy or null

getCachePolicy

protected CacheControlDataSource.CACHE_POLICY getCachePolicy(CacheControlDataSource.CACHE_POLICY aDefault)
Decodes the cache policy from a parameter map

Parameters:
aDefault - the default value
Returns:
the decoded cache policy

getCacheScope

public CacheControlDataSource.CACHE_SCOPE getCacheScope()
Returns the cache scope for the data

Returns:
cache scope or null

getCacheScope

protected CacheControlDataSource.CACHE_SCOPE getCacheScope(CacheControlDataSource.CACHE_SCOPE aDefault)
Decodes the cache scope from a parameter map

Parameters:
aDefault - the default value
Returns:
the decoded cache policy

getContentType

public java.lang.String getContentType()
Description copied from interface: DataSource
Mime type of the data. The return value must be a registered mime type or DataSource.CONTENT_TYPE_UNKNOWN. A value of DataSource.CONTENT_TYPE_UNKNOWN means that the data source does not contain any content.

Specified by:
getContentType in interface DataSource
Returns:
mime type string, or DataSource.CONTENT_TYPE_UNKNOWN if the data source does not represent content

getContentType

protected java.lang.String getContentType(java.lang.String aDefault)
Decodes the content type from a parameter map

Parameters:
aDefault - the default value
Returns:
the decoded content type
Since:
8.5

getCreated

public java.util.Date getCreated()
Description copied from interface: DataSource
Returns the creation date of the resource.

Specified by:
getCreated in interface DataSource
Specified by:
getCreated in interface TimeStamped
Returns:
the creation dateor DataSource.CREATION_UNKNOWN

getExpiration

public java.util.Date getExpiration()
Description copied from interface: DataSource
Absolute timestamp that indicates the time when the data represented by the source will expire.

Specified by:
getExpiration in interface DataSource
Specified by:
getExpiration in interface DataSourceFragment
Returns:
the date the data expires or DataSource.EXPIRATION_UNKNOWN if the value is unknown

getExpiration

protected java.util.Date getExpiration(java.util.Date currentDate,
                                       java.util.Date defaultExpiration)
Decodes the expiry from the parameters

Parameters:
currentDate - current date
defaultExpiration - default expiry timestamp or null
Returns:
the expiry date or null
Since:
8.0

getExpiration

protected java.util.Date getExpiration(java.util.Date currentDate,
                                       long defaultMaxAge)
Decodes the expiry from the parameters

Parameters:
currentDate - current date
defaultMaxAge - default expiry in seconds, may be <0
Returns:
the expiry date or null

getExpiration

protected java.util.Date getExpiration(long currentDate,
                                       java.util.Date defaultExpiration)
Decodes the expiry from the parameters

Parameters:
currentDate - current date
defaultExpiration - default expiry timestamp or null
Returns:
the expiry date or null
Since:
8.0

getExpiration

protected java.util.Date getExpiration(long currentDate,
                                       long defaultMaxAge)
Decodes the expiry from the parameters

Parameters:
currentDate - current date
defaultMaxAge - default expiry in seconds, may be <0
Returns:
the expiry date or null

getLastModified

public java.util.Date getLastModified()
Description copied from interface: DataSource
Returns the modification date of the resource.

Specified by:
getLastModified in interface DataSource
Specified by:
getLastModified in interface TimeStamped
Returns:
the modification date or DataSource.LAST_MODIFICATION_UNKNOWN

getParameter

protected java.lang.String getParameter(java.lang.String aKey)
Decodes the first value from the paramaters

Parameters:
aKey - the key
Returns:
the first value or null

getParameter

protected java.lang.String getParameter(java.lang.String aKey,
                                        java.lang.String aDefault)
Decodes the first value from the paramaters

Parameters:
aKey - the key
aDefault - the default value
Returns:
the first value or the default

getParameters

public java.util.Map<java.lang.String,java.lang.String[]> getParameters()
Description copied from interface: Addressable

Returns an potentially unmodifiable version of the parameters used to address the object, never null, but potentially the empty map.

The key is of type String, the values of type String[]

Specified by:
getParameters in interface Addressable
Returns:
parameter map

getParameters

protected java.lang.String[] getParameters(java.lang.String aKey)
Returns the parameters for a particular key

Parameters:
aKey - the key
Returns:
the parameters for that key

getParameters

protected java.lang.String[] getParameters(java.lang.String aKey,
                                           java.lang.String... aDefaults)
Returns the parameters for a particular key

Parameters:
aKey - the key
aDefault - the defaults in case the parameter does not exist
Returns:
the parameters for that key

getProjectContext

protected java.lang.Boolean getProjectContext(java.lang.Boolean aDefault)
Decodes the project context from a parameter map

Parameters:
aDefault - the default value
Returns:
the decoded project context
Since:
8.0

getURI

public java.net.URI getURI()
Description copied from interface: Addressable
Returns the unique identifier of the object. The URI must contain valid scheme information and cannot be just a relative URL.

Specified by:
getURI in interface Addressable
Returns:
URI of the object, never null.

getUserContext

protected java.lang.Boolean getUserContext(java.lang.Boolean aDefault)
Decodes the user context from a parameter map

Parameters:
aDefault - the default value
Returns:
the decoded user context

getVaryHeaders

public java.lang.String[] getVaryHeaders()
Returns a list of HTTP request headers that the content of the data source depends on. An empty list indicates that the result is independent on the request headers. A null return value indicates that the data source does not know its vary headers and relies on the framework to assign any.

Returns:
the list of headers or null

getVaryHeaders

protected java.lang.String[] getVaryHeaders(java.lang.String[] aDefault)
Returns the vary headers

Parameters:
aDefault - the default headers
Returns:
the vary headers

getVirtualPortalContext

protected java.lang.Boolean getVirtualPortalContext(java.lang.Boolean aDefault)
Decodes the virtual portal context from a parameter map

Parameters:
aDefault - the default value
Returns:
the decoded virtual portal context
Since:
8.0

isPrivate

public java.lang.Boolean isPrivate()
Indicates if the data source depends on the user context (if any).

Returns:
Boolean.TRUE if the data source depends on the user context, Boolean.FALSE if the data source does not depend on the user context of #USER_CONTEXT_UNKNOWN to leave the decision to the framework.

isProjectDependent

public java.lang.Boolean isProjectDependent()
See Also:
ProjectContextDataSource.isProjectDependent()

isVirtualPortalDependent

public java.lang.Boolean isVirtualPortalDependent()
See Also:
VirtualPortalContextDataSource.isVirtualPortalDependent()

setAddressable

protected void setAddressable(Addressable addr)
                       throws java.net.URISyntaxException
Copies URI and parameters from the addressable object

Parameters:
addr - the addressable, not null
Throws:
java.net.URISyntaxException
Since:
6.1.0.3

setContentType

protected void setContentType(java.lang.String contentType)
Parameters:
contentType - the contentType to set

setCreated

protected void setCreated(java.util.Date created)
Parameters:
created - the created to set

setDataSource

protected void setDataSource(DataSource ds)
                      throws java.net.URISyntaxException
Copies the metadata from the data source

Parameters:
ds - the data source to copy from, null resets the content
Throws:
java.net.URISyntaxException

setExpires

protected void setExpires(java.util.Date expires)
Parameters:
expires - the expires to set

setLastMod

protected void setLastMod(java.util.Date lastMod)
Parameters:
lastMod - the lastMod to set

setParameters

protected void setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
Parameters:
parameters - the parameters to set

setUri

@Deprecated
protected void setUri(java.net.URI uri)
Deprecated. use setURI(URI) instead

Parameters:
uri - the uri to set

setURI

protected void setURI(java.net.URI uri)
Parameters:
uri - the uri to set
Since:
7.0.0.1