|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface that allows custom components to observe and intercept storage, retrieval and removal of content.
Multiple ContentInterceptors
can be associated with a single
Namespace
. They are typically configured in the
<configuration>
section of the domain configuration
file like this:
<content-interceptor class="com.acme.MyContentInterceptor">
<parameter name="myParam1">someValue</parameter>
<parameter name="myParam2">anotherValue</parameter>
</content-interceptor>
As you can see, ContentInterceptors
can be configured with
parameters. This is optional, and exactly which parameters are available
depends on the specific ContentInterceptor
implementation.
ContentInterceptor
implementations must provide a public
constructor without arguments, so that instances of the class can be
instantiated at startup. In addition, implementors should pay attention
to this minimal lifecycle definition:
setParameters
will be called with a java.util.Hashtable
containing the
parameter names and values as specified in the configuration.setNamespace
will be
called, passing in a NamespaceAccessToken
than can later
be used by the ContentInterceptor
to perform its deeds
(like logging to the namespace logger).preXXX
and postXXX
methods will be called as soon as the associated event occurs.
The signatures of the preXXX
and postXXX
specify
a wide range of exceptions that can be thrown. If such an exception is
thrown it will be propagated up to the the API client. In the case of the
preXXX
the started operation will be terminated. So be sure
to handle all exceptions that shouldn't be propagated back into the core
core API - and thus possibly influence success of the operation -
yourself.
Method Summary | |
void |
postRemoveContent(SlideToken token,
NodeRevisionDescriptors revisionDescriptors,
NodeRevisionDescriptor revisionDescriptor)
This method will be called just after content has been removed, either of all revisions of a node, or of only one particular revision. |
void |
postRetrieveContent(SlideToken token,
NodeRevisionDescriptors revisionDescriptors,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
This method will be called just after retrieving content, or the descriptor of a particular revision. |
void |
postStoreContent(SlideToken token,
NodeRevisionDescriptors revisionDescriptors,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
This method will be called just after the content of a node was stored. |
void |
preRemoveContent(SlideToken token,
NodeRevisionDescriptors revisionDescriptors,
NodeRevisionDescriptor revisionDescriptor)
This method will be called just before content will get removed, either of all revisions of a node, or of only one particular revision. |
void |
preRetrieveContent(SlideToken token,
NodeRevisionDescriptors revisionDescriptors,
NodeRevisionNumber revisionNumber,
NodeRevisionDescriptor revisionDescriptor)
This method will be called just before content is retrieved, or the descriptor of a particular revision is retrieved. |
void |
preStoreContent(SlideToken token,
NodeRevisionDescriptors revisionDescriptors,
NodeRevisionDescriptor revisionDescriptor,
NodeRevisionContent revisionContent)
This method will be called just before the content of a node is stored. |
void |
setNamespace(NamespaceAccessToken nat)
The setNamespace method will be called during
initialization of the ContextInterceptor. |
void |
setParameters(java.util.Hashtable parameters)
This method is called during initialization of the ContentInterceptor to allow parameterization from the configuration. |
Method Detail |
public void preStoreContent(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws AccessDeniedException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, ServiceAccessException
token
- the SlideTokenrevisionDescriptors
- revision tree of the content to be storedrevisionDescriptor
- revision descriptor of the content to be
storedrevisionContent
- the actual content to be stored
AccessDeniedException
- if access to a resource has
been denied
ObjectNotFoundException
- if an object could not be found
LinkedObjectNotFoundException
- if an object linked to by
another object could not be
found
ObjectLockedException
- if an object is locked
ServiceAccessException
- low-level service failurepublic void postStoreContent(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws AccessDeniedException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, ServiceAccessException
token
- the SlideTokenrevisionDescriptors
- revision tree of the content that has been
storedrevisionDescriptor
- revision descriptor of the content that
has been storedrevisionContent
- the actual content that has been stored
AccessDeniedException
- if access to a resource has
been denied
ObjectNotFoundException
- if an object could not be found
LinkedObjectNotFoundException
- if an object linked to by
another object could not be
found
ObjectLockedException
- if an object is locked
ServiceAccessException
- low-level service failurepublic void preRetrieveContent(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionNumber revisionNumber, NodeRevisionDescriptor revisionDescriptor) throws AccessDeniedException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, ServiceAccessException
token
- the SlideTokenrevisionDescriptors
- revision tree of the descriptor that
should be retrieved, or null
if the content should be retrievedrevisionNumber
- revision number of the descriptor that
should be retrieved, or null
if the content should be retrievedrevisionDescriptor
- revision descriptor of the content that
should be retrieved, or null
if the descriptor will be retrieved
AccessDeniedException
- if access to a resource has
been denied
ObjectNotFoundException
- if an object could not be found
LinkedObjectNotFoundException
- if an object linked to by
another object could not be
found
ObjectLockedException
- if an object is locked
ServiceAccessException
- low-level service failurepublic void postRetrieveContent(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor, NodeRevisionContent revisionContent) throws AccessDeniedException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, ServiceAccessException
token
- the SlideTokenrevisionDescriptors
- revision tree of the descriptor that has
been retrieved, or null
when
the content has been retrievedrevisionDescriptor
- revision descriptor of the content that has
been retrieved, or the descriptor itself
has been retrievedrevisionContent
- the actual content that has been retrieved,
or null
when the descriptor
has been retrieved
AccessDeniedException
- if access to a resource has
been denied
ObjectNotFoundException
- if an object could not be found
LinkedObjectNotFoundException
- if an object linked to by
another object could not be
found
ObjectLockedException
- if an object is locked
ServiceAccessException
- low-level service failurepublic void preRemoveContent(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor) throws AccessDeniedException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, ServiceAccessException
token
- the SlideTokenrevisionDescriptors
- revision tree of the content that will be
removed, or null
if a only a
particular revision should be removedrevisionDescriptor
- revision descriptor of the content that
will be removed, or null
if
all revisions of a node should be removed
AccessDeniedException
- if access to a resource has
been denied
ObjectNotFoundException
- if an object could not be found
LinkedObjectNotFoundException
- if an object linked to by
another object could not be
found
ObjectLockedException
- if an object is locked
ServiceAccessException
- low-level service failurepublic void postRemoveContent(SlideToken token, NodeRevisionDescriptors revisionDescriptors, NodeRevisionDescriptor revisionDescriptor) throws AccessDeniedException, ObjectNotFoundException, LinkedObjectNotFoundException, ObjectLockedException, ServiceAccessException
token
- the SlideTokenrevisionDescriptors
- revision tree of the content that has been
removed, or null
if a only a
particular revision has been removedrevisionDescriptor
- revision descriptor of the content that
has been removed, or null
if
all revisions of a node have been removed
AccessDeniedException
- if access to a resource has
been denied
ObjectNotFoundException
- if an object could not be found
LinkedObjectNotFoundException
- if an object linked to by
another object could not be
found
ObjectLockedException
- if an object is locked
ServiceAccessException
- low-level service failurepublic void setNamespace(NamespaceAccessToken nat)
setNamespace
method will be called during
initialization of the ContextInterceptor.
nat
- the access token to the namespace this ContentInterceptor
has been associated withpublic void setParameters(java.util.Hashtable parameters)
parameters
- Hashtable containing the parameters' names as keys
and the associated parameter values as values,
both of type java.lang.String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |