Package org.wso2.carbon.registry.ws.api
Class WSResource
java.lang.Object
org.wso2.carbon.registry.ws.api.WSResource
- Direct Known Subclasses:
WSCollection
The WSResource class is a web service compatible representation of the Resource class.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the user name of the resource author.Returns a data handler that contains the content.longMethod to get the created time.intMethod to get the description.getId()The Resource ID, In the default implementation this returns the path.longMethod to get the last modified date as a long integer.Method to get the last updated user name.longGet media type.getName()Get the parent path.getPath()Method to get the path.intReturns all properties of the WSResource.longintgetState()intgetUUID()get the UUID of the resourcelongbooleanCheck whether this WSResource is actually a WSCollection.booleanbooleanbooleanvoidsetAuthorUserName(String authorUserName) Set the author name.voidsetCollection(boolean isCollection) Set whether the WSResource is a WSCollection or not.voidsetContentFile(DataHandler contentFile) Sets the data handler with the content of the resource.voidsetCreatedTime(long createdTime) Set created time.voidsetDbBasedContentID(int dbBasedContentID) voidsetDescription(String description) Set the descriptionvoidsetDirectory(boolean directory) voidSet the resource ID.voidsetLastModified(long lastModified) Method to set the last modified date.voidsetLastUpdaterUserName(String lastUpdaterUserName) Set the last updated user name.voidsetMatchingSnapshotID(long matchingSnapshotID) voidsetMediaType(String mediaType) Set media type.voidvoidsetParentPath(String parentPath) Set the parent path,voidSet the path.voidsetPathID(int pathID) voidsetPermanentPath(String permanentPath) voidsetProperties(WSProperty[] properties) Set properties of a WSResource.voidsetPropertiesModified(boolean propertiesModified) voidsetSnapshotID(long snapshotID) voidsetState(int state) voidsetTenantId(int tenantId) voidsetUserName(String userName) voidset the UUID of the resourcevoidsetVersionableChange(boolean versionableChange) voidsetVersionNumber(long versionNumber)
-
Field Details
-
name
-
pathID
protected int pathID -
tenantId
protected int tenantId
-
-
Constructor Details
-
WSResource
public WSResource()
-
-
Method Details
-
getUUID
get the UUID of the resource- Returns:
- the uuid of the resource
-
setUUID
set the UUID of the resource- Parameters:
uuid- the uuid of the resource
-
getContentFile
Returns a data handler that contains the content. Used to deliver content through web services.- Returns:
- content
-
setContentFile
Sets the data handler with the content of the resource.- Parameters:
contentFile-
-
getAuthorUserName
Get the user name of the resource author.- Returns:
- the user name of the resource author.
-
setAuthorUserName
Set the author name. Needed when creating WSResources to transfer while preserving the original author.- Parameters:
authorUserName-
-
getDbBasedContentID
public int getDbBasedContentID() -
setDbBasedContentID
public void setDbBasedContentID(int dbBasedContentID) -
getDescription
Method to get the description.- Returns:
- the description.
-
setDescription
Set the description- Parameters:
description-
-
isDirectory
public boolean isDirectory() -
setDirectory
public void setDirectory(boolean directory) -
getId
The Resource ID, In the default implementation this returns the path.- Returns:
- the resource id
-
setId
Set the resource ID. The default is the path of the resource.- Parameters:
id-
-
getLastModified
public long getLastModified()Method to get the last modified date as a long integer.- Returns:
- the last modified date.
-
setLastModified
public void setLastModified(long lastModified) Method to set the last modified date.- Parameters:
lastModified- as a long integer
-
getLastUpdaterUserName
Method to get the last updated user name.- Returns:
- the last updated user name.
-
setLastUpdaterUserName
Set the last updated user name.- Parameters:
lastUpdaterUserName-
-
getMatchingSnapshotID
public long getMatchingSnapshotID() -
setMatchingSnapshotID
public void setMatchingSnapshotID(long matchingSnapshotID) -
getMediaType
Get media type.- Returns:
- the media type.
-
setMediaType
Set media type.- Parameters:
mediaType-
-
getName
-
setName
-
getParentPath
Get the parent path.- Returns:
- the parent path.
-
setParentPath
Set the parent path,- Parameters:
parentPath-
-
getPath
Method to get the path. the unique identifier of the resources in the present state.- Returns:
- the path.
-
setPath
Set the path.- Parameters:
path-
-
getPathID
public int getPathID() -
setPathID
public void setPathID(int pathID) -
getPermanentPath
-
setPermanentPath
-
getProperties
Returns all properties of the WSResource. Properties are stored as key (String) -> values (List) pairs.- Returns:
- All properties of the resource as WSProperty array.
-
setProperties
Set properties of a WSResource.- Parameters:
properties-
-
isPropertiesModified
public boolean isPropertiesModified() -
setPropertiesModified
public void setPropertiesModified(boolean propertiesModified) -
getSnapshotID
public long getSnapshotID() -
setSnapshotID
public void setSnapshotID(long snapshotID) -
getState
public int getState() -
setState
public void setState(int state) -
getTenantId
public int getTenantId() -
setTenantId
public void setTenantId(int tenantId) -
getUserName
-
setUserName
-
isVersionableChange
public boolean isVersionableChange() -
setVersionableChange
public void setVersionableChange(boolean versionableChange) -
getVersionNumber
public long getVersionNumber() -
setVersionNumber
public void setVersionNumber(long versionNumber) -
getCreatedTime
public long getCreatedTime()Method to get the created time.- Returns:
- the created time
-
setCreatedTime
public void setCreatedTime(long createdTime) Set created time. Needed when creating WSResources to transfer while preserving the original created time.- Parameters:
createdTime-
-
isCollection
public boolean isCollection()Check whether this WSResource is actually a WSCollection. This method is used since web services do not support inheritance.- Returns:
- whether this is a collection or not
-
setCollection
public void setCollection(boolean isCollection) Set whether the WSResource is a WSCollection or not.- Parameters:
isCollection-
-