Package org.wso2.carbon.registry.ws.api
Class WSResource
- java.lang.Object
-
- org.wso2.carbon.registry.ws.api.WSResource
-
- Direct Known Subclasses:
WSCollection
public class WSResource extends Object
The WSResource class is a web service compatible representation of the Resource class.
-
-
Constructor Summary
Constructors Constructor Description WSResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAuthorUserName()Get the user name of the resource author.DataHandlergetContentFile()Returns a data handler that contains the content.longgetCreatedTime()Method to get the created time.intgetDbBasedContentID()StringgetDescription()Method to get the description.StringgetId()The Resource ID, In the default implementation this returns the path.longgetLastModified()Method to get the last modified date as a long integer.StringgetLastUpdaterUserName()Method to get the last updated user name.longgetMatchingSnapshotID()StringgetMediaType()Get media type.StringgetName()StringgetParentPath()Get the parent path.StringgetPath()Method to get the path.intgetPathID()StringgetPermanentPath()WSProperty[]getProperties()Returns all properties of the WSResource.longgetSnapshotID()intgetState()intgetTenantId()StringgetUserName()StringgetUUID()get the UUID of the resourcelonggetVersionNumber()booleanisCollection()Check whether this WSResource is actually a WSCollection.booleanisDirectory()booleanisPropertiesModified()booleanisVersionableChange()voidsetAuthorUserName(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)voidsetId(String id)Set 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.voidsetName(String name)voidsetParentPath(String parentPath)Set the parent path,voidsetPath(String path)Set 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)voidsetUUID(String uuid)set the UUID of the resourcevoidsetVersionableChange(boolean versionableChange)voidsetVersionNumber(long versionNumber)
-
-
-
Field Detail
-
name
protected String name
-
pathID
protected int pathID
-
tenantId
protected int tenantId
-
-
Method Detail
-
getUUID
public String getUUID()
get the UUID of the resource- Returns:
- the uuid of the resource
-
setUUID
public void setUUID(String uuid)
set the UUID of the resource- Parameters:
uuid- the uuid of the resource
-
getContentFile
public DataHandler getContentFile()
Returns a data handler that contains the content. Used to deliver content through web services.- Returns:
- content
-
setContentFile
public void setContentFile(DataHandler contentFile)
Sets the data handler with the content of the resource.- Parameters:
contentFile-
-
getAuthorUserName
public String getAuthorUserName()
Get the user name of the resource author.- Returns:
- the user name of the resource author.
-
setAuthorUserName
public void setAuthorUserName(String authorUserName)
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
public String getDescription()
Method to get the description.- Returns:
- the description.
-
setDescription
public void setDescription(String description)
Set the description- Parameters:
description-
-
isDirectory
public boolean isDirectory()
-
setDirectory
public void setDirectory(boolean directory)
-
getId
public String getId()
The Resource ID, In the default implementation this returns the path.- Returns:
- the resource id
-
setId
public void setId(String id)
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
public String getLastUpdaterUserName()
Method to get the last updated user name.- Returns:
- the last updated user name.
-
setLastUpdaterUserName
public void setLastUpdaterUserName(String lastUpdaterUserName)
Set the last updated user name.- Parameters:
lastUpdaterUserName-
-
getMatchingSnapshotID
public long getMatchingSnapshotID()
-
setMatchingSnapshotID
public void setMatchingSnapshotID(long matchingSnapshotID)
-
getMediaType
public String getMediaType()
Get media type.- Returns:
- the media type.
-
setMediaType
public void setMediaType(String mediaType)
Set media type.- Parameters:
mediaType-
-
getName
public String getName()
-
setName
public void setName(String name)
-
getParentPath
public String getParentPath()
Get the parent path.- Returns:
- the parent path.
-
setParentPath
public void setParentPath(String parentPath)
Set the parent path,- Parameters:
parentPath-
-
getPath
public String getPath()
Method to get the path. the unique identifier of the resources in the present state.- Returns:
- the path.
-
setPath
public void setPath(String path)
Set the path.- Parameters:
path-
-
getPathID
public int getPathID()
-
setPathID
public void setPathID(int pathID)
-
getPermanentPath
public String getPermanentPath()
-
setPermanentPath
public void setPermanentPath(String permanentPath)
-
getProperties
public WSProperty[] 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
public void setProperties(WSProperty[] properties)
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
public String getUserName()
-
setUserName
public void setUserName(String userName)
-
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-
-
-