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.
  • Field Details

    • name

      protected String name
    • pathID

      protected int pathID
    • tenantId

      protected int tenantId
  • Constructor Details

    • WSResource

      public WSResource()
  • Method Details

    • 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 -