|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.registry.jdbc.handlers.Handler
public abstract class Handler
Base class of all handler implementations. Provides the methods that handlers should implement. This class also provides the datasource, user realm, registry and repository instances to be used by handler implementations. Handlers can be chained by providing necessary filter combinations. But in such cases, handler authors should make sure that handlers in the chain do not perform conflicting operations. Unless there is a critical requirement and handler authors are confident that handlers do not have negative impact on each other, it is recommended that handlers are configured to execute only one handler per request. Handler instances may be accessed concurrently by multiple threads. Therefore, handlers should be thread safe. It is recommended that handlers are made stateless, instead of synchronizing them as it could become a performance bottleneck in highly concurrent environments. Implementations of handlers should be optimized to take the minimum time for processing. As the handlers are executed are always executed before executing the generic database layer code, time consuming operations in handlers could slow down the whole registry.
Field Summary | |
---|---|
protected AuthorizationUtils |
authorizationUtil
Some common authorization tasks are implemented in this util. |
protected ResourceDAO |
resourceDAO
ResourceDAO for directly accessing resources. |
Constructor Summary | |
---|---|
Handler()
|
Method Summary | |
---|---|
void |
delete(RequestContext requestContext)
Processes the DELETE action of the media type. |
Resource |
get(RequestContext requestContext)
Processes the GET action for resource path of the requestContext. |
void |
importChild(RequestContext requestContext)
Invokes when a child resource is imported. |
void |
importResource(RequestContext requestContext)
Creates a resource in the given path by fetching the resource content from the given URL. |
void |
put(RequestContext requestContext)
Processes the PUT action. |
void |
putChild(RequestContext requestContext)
Invokes when a child resource is added. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected ResourceDAO resourceDAO
protected AuthorizationUtils authorizationUtil
Constructor Detail |
---|
public Handler()
Method Detail |
---|
public Resource get(RequestContext requestContext) throws RegistryException
requestContext
- Information about the current request.
requestContext.resourcePath: Path of the resource
requestContext.resource: Resource at the given path. This can be null if no other handler has
retrieved that resource so far. If it contains a value, matching handlers are free to do any
change to the resource, even thay can replace the resource with completely new instance.
RegistryException
- If the media type handler is supposed to handle
the get on the media type and if the get fails due a handler specific errorpublic void put(RequestContext requestContext) throws RegistryException
requestContext
- Information about the current request.
requestContext.resourcePath: Path to put the resource.
requestContext.resource: Resource to put
RegistryException
- If the media type handler is supposed to handle the put on the
media type and if the put fails due a handler specific errorpublic void importResource(RequestContext requestContext) throws RegistryException
requestContext
- Information about the current request.
requestContext.resourcePath: Path to add the new resource.
requestContext.sourceURL: URL to fetch the resource content
requestContext.resource: Resource instance containing the metadata for the resource to be
imported. Once import is done, new resource is created combining the metadata of this
metadata object and the imported content.
RegistryException
- If the media type handler is supposed to handle the import on the
media type and if the import fails due a handler specific errorpublic void delete(RequestContext requestContext) throws RegistryException
requestContext
- Information about the current request.
requestContext.resourcePath: path path of the resource to be deleted.
RegistryException
- If the media type handler is supposed to handle the delete on the
media type and if the delete fails due a handler specific errorpublic void putChild(RequestContext requestContext) throws RegistryException
requestContext
- requestContext.resourcePath: path of the parent collection
requestContext.resource: New child resource to be added
RegistryException
- If the media type handler is supposed to handle the putChild on the
media type and if the putChild fails due a handler specific errorpublic void importChild(RequestContext requestContext) throws RegistryException
requestContext
- requestContext.resourcePath
RegistryException
- If the media type handler is supposed to handle the importChild
on the media type and if the importChild fails due a handler specific error
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |