|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.carbon.registry.core.jdbc.handlers.filters.Filter
org.wso2.carbon.registry.core.jdbc.handlers.filters.MediaTypeMatcher
public class MediaTypeMatcher
This is a built-in Filter implementation that evaluates against the media type of the resources. This has to be initialized with a media type. For all filtering methods, this will evaluates to true if the media type of the currently processing resource (or the parent of the current resource in some cases) and the media type of this implementation are equal.
Handler authors can use this as the filter, if the filtering requirement is only to match the media type of the resource.
Field Summary |
---|
Fields inherited from class org.wso2.carbon.registry.core.jdbc.handlers.filters.Filter |
---|
ADD_ASSOCIATION, ADD_COMMENT, APPLY_TAG, COPY, CREATE_LINK, CREATE_VERSION, DELETE, DUMP, EDIT_COMMENT, EXECUTE_QUERY, GET, GET_ALL_ASSOCIATIONS, GET_ASSOCIATIONS, GET_AVERAGE_RATING, GET_COMMENTS, GET_RATING, GET_REGISTRY_CONTEXT, GET_RESOURCE_PATHS_WITH_TAG, GET_TAGS, GET_VERSIONS, IMPORT, IMPORT_CHILD, invert, INVOKE_ASPECT, MOVE, PUT, PUT_CHILD, RATE_RESOURCE, REMOVE_ASSOCIATION, REMOVE_COMMENT, REMOVE_LINK, REMOVE_TAG, RENAME, RESOURCE_EXISTS, RESTORE, RESTORE_VERSION, SEARCH_CONTENT |
Constructor Summary | |
---|---|
MediaTypeMatcher()
Default constructor. |
|
MediaTypeMatcher(String mediaType)
Constructor that accepts a media type. |
Method Summary | |
---|---|
boolean |
equals(Object other)
Compares this MediaTypeMatcher to the specified object. |
String |
getMediaType()
Method to obtain media type. |
boolean |
handleCopy(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handleCreateLink(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handleDelete(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handleGet(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handleImportChild(RequestContext requestContext)
Matches if the media type of the parent collection of the current resource is equal to the handler's media type. |
boolean |
handleImportResource(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handleInvokeAspect(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handleMove(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handlePut(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handlePutChild(RequestContext requestContext)
Matches if the media type of the parent collection of the current resource is equal to the handler's media type. |
boolean |
handleRemoveLink(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
boolean |
handleRename(RequestContext requestContext)
Matches if the media type of the current resource is equal to the handler's media type. |
int |
hashCode()
This overrides the default hash code implementation for filter objects, to make sure that each filter of the same type will have identical hash codes unless otherwise it has its own extension. |
void |
setMediaType(String mediaType)
Method to set media type. |
Methods inherited from class org.wso2.carbon.registry.core.jdbc.handlers.filters.Filter |
---|
getInvert, handleAddAssociation, handleAddComment, handleApplyTag, handleCreateVersion, handleDump, handleEditComment, handleExecuteQuery, handleGetAllAssociations, handleGetAssociations, handleGetAverageRating, handleGetComments, handleGetRating, handleGetRegistryContext, handleGetResourcePathsWithTag, handleGetTags, handleGetVersions, handleRateResource, handleRemoveAssociation, handleRemoveComment, handleRemoveTag, handleResourceExists, handleRestore, handleRestoreVersion, handleSearchContent, setInvert |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MediaTypeMatcher()
public MediaTypeMatcher(String mediaType)
mediaType
- the media type.Method Detail |
---|
public int hashCode()
Filter
hashCode
in class Filter
public boolean equals(Object other)
true
if and
only if the argument is not null
and is a MediaTypeMatcher
object that
contains the same values for the fields as this object.
equals
in class Filter
other
- The object to compare the MediaTypeMatcher
against
true
if the given object represents a MediaTypeMatcher
equivalent to
this instance, false
otherwise.public boolean handleGet(RequestContext requestContext) throws RegistryException
handleGet
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handlePut(RequestContext requestContext) throws RegistryException
handlePut
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleImportResource(RequestContext requestContext) throws RegistryException
handleImportResource
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleDelete(RequestContext requestContext) throws RegistryException
handleDelete
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleRemoveLink(RequestContext requestContext) throws RegistryException
handleRemoveLink
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleCreateLink(RequestContext requestContext) throws RegistryException
handleCreateLink
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleCopy(RequestContext requestContext) throws RegistryException
handleCopy
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleMove(RequestContext requestContext) throws RegistryException
handleMove
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleRename(RequestContext requestContext) throws RegistryException
handleRename
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleInvokeAspect(RequestContext requestContext) throws RegistryException
handleInvokeAspect
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handlePutChild(RequestContext requestContext) throws RegistryException
handlePutChild
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public boolean handleImportChild(RequestContext requestContext) throws RegistryException
handleImportChild
in class Filter
requestContext
- RequestContext for the current request
RegistryException
public String getMediaType()
public void setMediaType(String mediaType)
mediaType
- the media type.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |