|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.registry.jdbc.mediatypes.MediaTypeHandler
public abstract class MediaTypeHandler
Base class of all media type handlers. It defines the six basic methods to be implemented by all media type handlers. This is initialized with the objects required for handling media type specific operations, so that extending media type handlers can easily access them. One such object is the instance of the MediaTypeManager.
Field Summary | |
---|---|
protected AuthorizationUtil |
authorizationUtil
Some common authorization tasks are implemented in this util. |
protected javax.sql.DataSource |
dataSource
Data source for obtaining database connections. |
protected MediaTypeManager |
mediaTypeManager
While processing media types, handlers may want to access resources with other media types. |
protected org.wso2.usermanager.Realm |
realm
User manager realm, which can be used to set permissions on resources. |
protected VersionedResourceDAO |
resourceDAO
ResourceDAO for directly accessing resources. |
Constructor Summary | |
---|---|
MediaTypeHandler(javax.sql.DataSource dataSource,
org.wso2.usermanager.Realm realm,
MediaTypeManager mediaTypeManager)
|
Method Summary | |
---|---|
abstract boolean |
delete(java.lang.String path)
Processes the DELETE action of the media type. |
abstract Resource |
get(java.lang.String path,
Resource rawArtifact)
Processes the GET action of the media type. |
abstract boolean |
importChild(java.lang.String childPath,
java.lang.String sourceURL)
Invokes when a child resource is imported. |
abstract java.lang.String |
importResource(java.lang.String path,
java.lang.String sourceURL,
Resource metadata)
Creates a resource in the given path by fetching the resource content from the given URL. |
abstract boolean |
put(java.lang.String path,
Resource resource)
Processes the PUT action of the media type. |
abstract boolean |
putChild(java.lang.String childPath,
Resource resource)
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 javax.sql.DataSource dataSource
protected org.wso2.usermanager.Realm realm
protected MediaTypeManager mediaTypeManager
protected VersionedResourceDAO resourceDAO
protected AuthorizationUtil authorizationUtil
Constructor Detail |
---|
public MediaTypeHandler(javax.sql.DataSource dataSource, org.wso2.usermanager.Realm realm, MediaTypeManager mediaTypeManager)
Method Detail |
---|
public abstract Resource get(java.lang.String path, Resource rawArtifact) throws RegistryException
path
- Path of the resourcerawArtifact
- Raw artifact at the given path, which is retrieved directly from the
database. This can be used by media type handlers, which need to alter
contents of the raw artifact, etc.
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 abstract boolean put(java.lang.String path, Resource resource) throws RegistryException
path
- to put the 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 abstract java.lang.String importResource(java.lang.String path, java.lang.String sourceURL, Resource metadata) throws RegistryException
path
- Path to add the new resource.sourceURL
- URL to fetch the resource contentmetadata
- 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 abstract boolean delete(java.lang.String path) throws RegistryException
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 abstract boolean putChild(java.lang.String childPath, Resource resource) throws RegistryException
childPath
- Path of the child resourceresource
- Child resource
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 abstract boolean importChild(java.lang.String childPath, java.lang.String sourceURL) throws RegistryException
childPath
- Path of the child resourcesourceURL
- URL to import child resource content
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 |