org.wso2.carbon.registry.core.caching
Class CachingHandler

java.lang.Object
  extended by org.wso2.carbon.registry.core.jdbc.handlers.Handler
      extended by org.wso2.carbon.registry.core.caching.CachingHandler

public class CachingHandler
extends Handler

CachingHandler using to handle the cached results of registry operation. We are removing the the data from cache for all the write operations.


Constructor Summary
CachingHandler()
          Default Constructor
 
Method Summary
 String copy(RequestContext requestContext)
          Copy a resource in the registry.
 void createLink(RequestContext requestContext)
          Create a symbolic link or mount a registry.
 void delete(RequestContext requestContext)
          Processes the DELETE action of the media type.
 void importResource(RequestContext requestContext)
          Creates a resource in the given path by fetching the resource content from the given URL.
 String move(RequestContext requestContext)
          Move a resource in the registry.
 void put(RequestContext requestContext)
          Processes the PUT action.
 void removeLink(RequestContext requestContext)
          Remove a symbolic link or un-mount a registry.
 String rename(RequestContext requestContext)
          Rename a resource in the registry.
 void restore(RequestContext requestContext)
          Gets called when restoring a path
 void restoreVersion(RequestContext requestContext)
          Gets called when restoring a version.
 
Methods inherited from class org.wso2.carbon.registry.core.jdbc.handlers.Handler
addAssociation, addComment, applyTag, createVersion, dump, dumpLite, editComment, equals, executeQuery, get, getAllAssociations, getAssociations, getAverageRating, getComments, getRating, getRegistryContext, getResourcePathsWithTag, getTags, getVersions, hashCode, importChild, invokeAspect, putChild, rateResource, removeAssociation, removeComment, removeTag, resourceExists, searchContent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingHandler

public CachingHandler()
Default Constructor

Method Detail

put

public void put(RequestContext requestContext)
         throws RegistryException
Description copied from class: Handler
Processes the PUT action. Actual path to which the resource is put may differ from the path given in the requestContext.resourcePath. Therefore, after putting the resource, the actual path to which the resource is put is set in the requestContext.actualPath.

Overrides:
put in class Handler
Parameters:
requestContext - Information about the current request.

requestContext.resourcePath: Path to put the resource. requestContext.resource: Resource to put

Throws:
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 error

importResource

public void importResource(RequestContext requestContext)
                    throws RegistryException
Description copied from class: Handler
Creates a resource in the given path by fetching the resource content from the given URL.

Overrides:
importResource in class Handler
Parameters:
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 meta data for the resource to be imported. Once import is done, new resource is created combining the meta data of this meta data object and the imported content.

Throws:
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 error

move

public String move(RequestContext requestContext)
            throws RegistryException
Description copied from class: Handler
Move a resource in the registry. This is equivalent to 1) delete the resource, then 2) add the resource to the new location. The operation is atomic, so if it fails the old resource will still be there.

Overrides:
move in class Handler
Parameters:
requestContext - Information about the current request.

requestContext.sourcePath: Source/Current Path

requestContext.targetPath: Destination/New Path

Returns:
the actual path for the new resource if the handler processed the MOVE action successfully.
Throws:
RegistryException - if something went wrong

copy

public String copy(RequestContext requestContext)
            throws RegistryException
Description copied from class: Handler
Copy a resource in the registry. This is equivalent to adding the resource to the new location. The operation is atomic, so if it fails the resource won't be added.

Overrides:
copy in class Handler
Parameters:
requestContext - Information about the current request.

requestContext.sourcePath: Source/Current Path

requestContext.targetPath: Destination/New Path

Returns:
the actual path for the new resource if the handler processed the COPY action successfully.
Throws:
RegistryException - if something went wrong

rename

public String rename(RequestContext requestContext)
              throws RegistryException
Description copied from class: Handler
Rename a resource in the registry. This is equivalent to 1) delete the resource, then 2) add the resource to the new location. The operation is atomic, so if it fails the old resource will still be there.

Overrides:
rename in class Handler
Parameters:
requestContext - Information about the current request.

requestContext.sourcePath: Source/Current Path

requestContext.targetPath: Destination/New Path

Returns:
the actual path for the new resource if the handler processed the RENAME action successfully.
Throws:
RegistryException - if something went wrong

createLink

public void createLink(RequestContext requestContext)
                throws RegistryException
Description copied from class: Handler
Create a symbolic link or mount a registry.

Overrides:
createLink in class Handler
Parameters:
requestContext - Information about the current request.

requestContext.targetPath: Destination/New Path

Throws:
RegistryException - if something went wrong

removeLink

public void removeLink(RequestContext requestContext)
                throws RegistryException
Description copied from class: Handler
Remove a symbolic link or un-mount a registry.

Overrides:
removeLink in class Handler
Parameters:
requestContext - Information about the current request.
Throws:
RegistryException - if something went wrong

delete

public void delete(RequestContext requestContext)
            throws RegistryException
Description copied from class: Handler
Processes the DELETE action of the media type.

Overrides:
delete in class Handler
Parameters:
requestContext - Information about the current request.

requestContext.resourcePath: path of the resource to be deleted.

Throws:
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 error

restore

public void restore(RequestContext requestContext)
             throws RegistryException
Description copied from class: Handler
Gets called when restoring a path

Overrides:
restore in class Handler
Parameters:
requestContext - Information about the current request. requestContext.keywords: Search keywords.
Throws:
RegistryException - If the media type handler is supposed to handle the resourceExists on the media type and if the resourceExists fails due a handler specific error

restoreVersion

public void restoreVersion(RequestContext requestContext)
                    throws RegistryException
Description copied from class: Handler
Gets called when restoring a version.

Overrides:
restoreVersion in class Handler
Parameters:
requestContext - Information about the current request. requestContext.versionPath: Path of Resource with version This can be used to derive the path of the resource as well.
Throws:
RegistryException - If the media type handler is supposed to handle the restoreVersion on the media type and if the restoreVersion fails due a handler specific error


Copyright © 2014 WSO2 Inc. All Rights Reserved.