|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ibm.portal.resolver.helper.AbstractDataSource
public class AbstractDataSource
Implementation of a DataSource
that simply dispatches to another
implementation. The methods that relate to the size of the content are not
dispatched, because it is likely that subclasses will transform the content,
so the filesize will most likely differ.
This interface is designed to be implemented by clients. |
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.ibm.portal.resolver.data.CacheControlDataSource |
---|
CacheControlDataSource.CACHE_POLICY, CacheControlDataSource.CACHE_SCOPE |
Nested classes/interfaces inherited from interface com.ibm.portal.resolver.data.ContentDispositionDataSource |
---|
ContentDispositionDataSource.DISPOSITION |
Field Summary |
---|
Fields inherited from interface com.ibm.portal.resolver.data.DataSourceChecksum |
---|
NONE |
Fields inherited from interface com.ibm.portal.resolver.data.CacheControlDataSource |
---|
CACHE_CONTROL_EXTENSIONS_UNDEFINED |
Fields inherited from interface com.ibm.portal.resolver.data.ContentDispositionDataSource |
---|
FILE_SIZE_UNKNOWN |
Fields inherited from interface com.ibm.portal.resolver.data.VaryDataSource |
---|
NO_VARY_HEADERS, VARY_HEADERS_UNKNOWN |
Fields inherited from interface com.ibm.portal.resolver.data.ContentLengthDataSource |
---|
CONTENT_LENGTH_UNKNOWN |
Fields inherited from interface com.ibm.portal.resolver.data.UserContextDataSource |
---|
USER_CONTEXT_UNKNOWN |
Fields inherited from interface com.ibm.portal.resolver.data.StatusCodeDataSource |
---|
SC_UNDEFINED |
Fields inherited from interface com.ibm.portal.resolver.data.ProjectContextDataSource |
---|
PROJECT_CONTEXT_UNKNOWN |
Fields inherited from interface com.ibm.portal.resolver.data.VirtualPortalContextDataSource |
---|
VIRTUAL_PORTAL_CONTEXT_UNKNOWN |
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 | |
---|---|
AbstractDataSource()
|
Method Summary | ||
---|---|---|
|
convertTo(java.lang.Class<T> dstClass)
Converts the DataSource to the desired target interface or
returns null . |
|
void |
dispose()
Indicate that the object will no longer be accessed |
|
boolean |
equals(java.lang.Object obj)
|
|
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 RFC 2616 |
|
CacheControlDataSource.CACHE_POLICY |
getCachePolicy()
Returns the caching policy for the data |
|
CacheControlDataSource.CACHE_SCOPE |
getCacheScope()
Returns the cache scope for the data |
|
long |
getChecksum()
Returns the checksum of the data source. |
|
long |
getContentLength()
Returns the number of bytes that this DataSource will produce. |
|
java.lang.String |
getContentType()
Mime type of the data. |
|
java.util.Date |
getCreated()
Returns the creation date of the resource. |
|
protected DataSource |
getDelegate()
|
|
ContentDispositionDataSource.DISPOSITION |
getDisposition()
Returns the content disposition |
|
java.util.Date |
getExpiration()
Absolute timestamp that indicates the time when the data represented by the source will expire. |
|
java.lang.String |
getFileName()
Returns the desired filename |
|
long |
getFileSize()
Returns the approximate file size of the data. |
|
java.util.Date |
getLastModified()
Returns the modification date of the resource. |
|
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. |
|
int |
getStatus()
Returns a suggested HTTP status code. |
|
java.net.URI |
getURI()
Returns the unique identifier of the object. |
|
java.lang.String[] |
getVaryHeaders()
Returns a list of HTTP request headers that the content of the data source depends on. |
|
int |
hashCode()
|
|
boolean |
isConvertibleTo(java.lang.Class<? extends DataSource> dstClass)
Checks if the DataSource can be converted to the target class. |
|
java.lang.Boolean |
isPrivate()
Indicates if the data source depends on the user context (if any). |
|
java.lang.Boolean |
isProjectDependent()
Indicates if the data source depends on the project context (if any). |
|
java.lang.Boolean |
isVirtualPortalDependent()
Indicates if the data source depends on the virtual portal context (if any). |
|
boolean |
isWeak()
Returns whether this is a "strong" or "weak" checksum. |
|
void |
reset(DataSource aDelegate)
Assigns a data source that is used to delegate the standard methods to. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractDataSource()
Method Detail |
---|
public <T extends DataSource> T convertTo(java.lang.Class<T> dstClass) throws java.io.IOException
ConvertibleDataSource
DataSource
to the desired target interface or
returns null
. If the conversion is successful, the result is
a wrapper that is to be used instead of this DataSource
. In
particular the wrapper has to be disposed by calling
Disposable.dispose()
and this disposal will also dispose the
wrapped DataSource
, it must not be disposed in addition to the
wrapper. If the conversion was not successful, the original
DataSource
still needs to be disposed. This is also true in case
of an exception.
convertTo
in interface ConvertibleDataSource
dstClass
- target class, not null
null
. The wrapper needs to be disposed and its disposal will also
dispose the wrapped DataSource
java.io.IOException
public void dispose()
Disposable
dispose
in interface Disposable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.util.Map<java.lang.String,java.lang.String> getCacheControlExtensions()
CacheControlDataSource
getCacheControlExtensions
in interface CacheControlDataSource
null
public CacheControlDataSource.CACHE_POLICY getCachePolicy()
CacheControlDataSource
getCachePolicy
in interface CacheControlDataSource
null
public CacheControlDataSource.CACHE_SCOPE getCacheScope()
CacheControlDataSource
getCacheScope
in interface CacheControlDataSource
null
public long getChecksum()
DataSourceChecksum
getChecksum
in interface DataSourceChecksum
DataSourceChecksum.NONE
indicates that no checksum has been computed.public long getContentLength()
ContentLengthDataSource
DataSource
will produce. If
the number is unknown the DataSource
may return
ContentLengthDataSource.CONTENT_LENGTH_UNKNOWN
getContentLength
in interface ContentLengthDataSource
ContentLengthDataSource.CONTENT_LENGTH_UNKNOWN
public java.lang.String getContentType()
DataSource
DataSource.CONTENT_TYPE_UNKNOWN
. A value of DataSource.CONTENT_TYPE_UNKNOWN
means that the data source does not contain any content.
getContentType
in interface DataSource
DataSource.CONTENT_TYPE_UNKNOWN
if the data
source does not represent contentpublic java.util.Date getCreated()
DataSource
getCreated
in interface DataSource
getCreated
in interface TimeStamped
DataSource.CREATION_UNKNOWN
protected final DataSource getDelegate()
public ContentDispositionDataSource.DISPOSITION getDisposition()
ContentDispositionDataSource
getDisposition
in interface ContentDispositionDataSource
null
public java.util.Date getExpiration()
DataSource
getExpiration
in interface CacheControlDataSource
getExpiration
in interface DataSource
getExpiration
in interface DataSourceFragment
DataSource.EXPIRATION_UNKNOWN
if the
value is unknownpublic java.lang.String getFileName()
ContentDispositionDataSource
getFileName
in interface ContentDispositionDataSource
null
public long getFileSize()
ContentDispositionDataSource
ContentLengthDataSource.getContentLength()
.
getFileSize
in interface ContentDispositionDataSource
0
or < 0
. A value of
< 0
indicates that the filesize is unknown.public java.util.Date getLastModified()
DataSource
getLastModified
in interface DataSource
getLastModified
in interface TimeStamped
DataSource.LAST_MODIFICATION_UNKNOWN
public java.util.Map<java.lang.String,java.lang.String[]> getParameters()
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[]
getParameters
in interface Addressable
public int getStatus()
StatusCodeDataSource
getStatus
in interface StatusCodeDataSource
StatusCodeDataSource.SC_UNDEFINED
to indicate that
the status code should not be overriddenpublic java.net.URI getURI() throws java.net.URISyntaxException
Addressable
getURI
in interface Addressable
null
.
java.net.URISyntaxException
- - if the URL cannot be constructedpublic java.lang.String[] getVaryHeaders()
VaryDataSource
null
return value indicates that
the data source does not know its vary headers and relies on the
framework to assign any.
getVaryHeaders
in interface VaryDataSource
null
public int hashCode()
hashCode
in class java.lang.Object
public boolean isConvertibleTo(java.lang.Class<? extends DataSource> dstClass)
ConvertibleDataSource
DataSource
can be converted to the target class.
isConvertibleTo
in interface ConvertibleDataSource
dstClass
- target class, not null
true
if the DataSource
can be converted to
the target class, else false
public java.lang.Boolean isPrivate()
UserContextDataSource
isPrivate
in interface UserContextDataSource
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 UserContextDataSource.USER_CONTEXT_UNKNOWN
to leave the
decision to the framework.public java.lang.Boolean isProjectDependent()
ProjectContextDataSource
isProjectDependent
in interface ProjectContextDataSource
Boolean.TRUE
if the data source depends on the project
context, Boolean.FALSE
if the data source does not depend
on the project context of ProjectContextDataSource.PROJECT_CONTEXT_UNKNOWN
to
leave the decision to the framework.public java.lang.Boolean isVirtualPortalDependent()
VirtualPortalContextDataSource
isVirtualPortalDependent
in interface VirtualPortalContextDataSource
Boolean.TRUE
if the data source depends on the virtual
portal context, Boolean.FALSE
if the data source does not
depend on the virtual portal context of
VirtualPortalContextDataSource.VIRTUAL_PORTAL_CONTEXT_UNKNOWN
to leave the decision to
the framework.public boolean isWeak()
DataSourceChecksum
isWeak
in interface DataSourceChecksum
true
if the checksum is "weak", false
otherwise.public void reset(DataSource aDelegate)
aDelegate
- delegate that implements the generic methods
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |