org.wso2.carbon.registry.ws.api
Class WSResource

java.lang.Object
  extended by 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.


Field Summary
protected  String name
           
protected  int pathID
           
protected  int tenantId
           
 
Constructor Summary
WSResource()
           
 
Method Summary
 String getAuthorUserName()
          Get the user name of the resource author.
 DataHandler getContentFile()
          Returns a data handler that contains the content.
 long getCreatedTime()
          Method to get the created time.
 int getDbBasedContentID()
           
 String getDescription()
          Method to get the description.
 String getId()
          The Resource ID, In the default implementation this returns the path.
 long getLastModified()
          Method to get the last modified date as a long integer.
 String getLastUpdaterUserName()
          Method to get the last updated user name.
 long getMatchingSnapshotID()
           
 String getMediaType()
          Get media type.
 String getName()
           
 String getParentPath()
          Get the parent path.
 String getPath()
          Method to get the path.
 int getPathID()
           
 String getPermanentPath()
           
 WSProperty[] getProperties()
          Returns all properties of the WSResource.
 long getSnapshotID()
           
 int getState()
           
 int getTenantId()
           
 String getUserName()
           
 String getUUID()
          get the UUID of the resource
 long getVersionNumber()
           
 boolean isCollection()
          Check whether this WSResource is actually a WSCollection.
 boolean isDirectory()
           
 boolean isPropertiesModified()
           
 boolean isVersionableChange()
           
 void setAuthorUserName(String authorUserName)
          Set the author name.
 void setCollection(boolean isCollection)
          Set whether the WSResource is a WSCollection or not.
 void setContentFile(DataHandler contentFile)
          Sets the data handler with the content of the resource.
 void setCreatedTime(long createdTime)
          Set created time.
 void setDbBasedContentID(int dbBasedContentID)
           
 void setDescription(String description)
          Set the description
 void setDirectory(boolean directory)
           
 void setId(String id)
          Set the resource ID.
 void setLastModified(long lastModified)
          Method to set the last modified date.
 void setLastUpdaterUserName(String lastUpdaterUserName)
          Set the last updated user name.
 void setMatchingSnapshotID(long matchingSnapshotID)
           
 void setMediaType(String mediaType)
          Set media type.
 void setName(String name)
           
 void setParentPath(String parentPath)
          Set the parent path,
 void setPath(String path)
          Set the path.
 void setPathID(int pathID)
           
 void setPermanentPath(String permanentPath)
           
 void setProperties(WSProperty[] properties)
          Set properties of a WSResource.
 void setPropertiesModified(boolean propertiesModified)
           
 void setSnapshotID(long snapshotID)
           
 void setState(int state)
           
 void setTenantId(int tenantId)
           
 void setUserName(String userName)
           
 void setUUID(String uuid)
          set the UUID of the resource
 void setVersionableChange(boolean versionableChange)
           
 void setVersionNumber(long versionNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name

pathID

protected int pathID

tenantId

protected int tenantId
Constructor Detail

WSResource

public WSResource()
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 -


Copyright © 2012 WSO2 Inc. All Rights Reserved.