|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.registry.ResourceImpl
public class ResourceImpl
Represents any file or collection stored in the registry. It encapsulates both the content of the entity and its metadata. In addition to files and collections, instances of Resource are used to represent results of runtime queries. In such secenarios, comments, tags, ratings as well as collections of comments, etc. are also represented by Resource objects. Each resource instance contains a unique path within a Registry instance. Registry.get(...) method invocation using this path gives an instance of that resource. This path can be combined with the base URL of the registry server to generate a URI for the resource.
| Field Summary | |
|---|---|
protected java.lang.String |
authorUserName
Username of the user who added the resource to the registry. |
protected java.lang.Object |
content
Content of the resource. |
protected java.lang.String |
contentID
UUID refering to the content of this resource. |
protected boolean |
contentModified
Used to detect whether the resource content is modified after it is retrieved from the Registry. |
protected java.io.InputStream |
contentStream
Content of the resource, represented as a input stream. |
protected java.sql.Timestamp |
createdTime
Time at which the resource is first added to the registry. |
protected javax.sql.DataSource |
dataSource
Registry datasource. |
protected java.lang.String |
description
Description about the resource. |
protected boolean |
directory
Specified whether the resource is a collection (directory) or a file. |
protected java.lang.String |
id
UUID to identify the resource. |
protected java.sql.Timestamp |
lastModified
Time at which the resource modified most recently. |
protected java.lang.String |
lastUpdaterUserName
Username of the user who modified the resource most recently. |
protected long |
matchingSnapshotID
|
protected java.lang.String |
mediaType
Media type of the resource. |
protected java.lang.String |
parentPath
Path of the parent collection of the resource. |
protected java.lang.String |
path
Unique path of the resource within the registry. |
protected java.lang.String |
permanentPath
|
protected java.util.Properties |
properties
Properties associated with the resource. |
protected boolean |
propertiesModified
Used to detect whether properties of this resource is modified since retrieval from the repository. |
protected ResourceDAO |
resourceDAO
Resource DAO instance to access the database directly. |
protected long |
snapshotID
Snapshot for which this resource instance is created. |
protected int |
state
Normal resources have the state RegistryConstants.ACTIVE_STATE (100) Deleted resources have the state RegistryConstants.DELETED_STATE (101) |
protected boolean |
versionableChange
Determines whether the resource is subjected to changes, which causes it to create a new version. |
protected long |
versionNumber
Version of this instance of the resource. |
| Constructor Summary | |
|---|---|
ResourceImpl()
|
|
| Method Summary | |
|---|---|
void |
addAspect(java.lang.String name)
|
void |
addProperty(java.lang.String key,
java.lang.String value)
|
void |
editPropertyValue(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue)
|
java.util.List<java.lang.String> |
getAspects()
|
java.lang.String |
getAuthorUserName()
|
java.lang.Object |
getContent()
|
java.lang.String |
getContentID()
|
java.io.InputStream |
getContentStream()
|
java.util.Date |
getCreatedTime()
|
java.lang.String |
getDescription()
|
java.lang.String |
getId()
|
java.util.Date |
getLastModified()
|
java.lang.String |
getLastUpdaterUserName()
|
long |
getMatchingSnapshotID()
|
java.lang.String |
getMediaType()
|
java.lang.String |
getParentPath()
|
java.lang.String |
getPath()
|
java.lang.String |
getPermanentPath()
If resource is versioned, the associated version of the resource does not get modified by any means. |
java.util.Properties |
getProperties()
Returns all properties of the resource. |
java.lang.String |
getProperty(java.lang.String key)
|
java.util.List |
getPropertyValues(java.lang.String key)
Returns the list of values for the given property name. |
long |
getSnapshotID()
|
int |
getState()
|
long |
getVersionNumber()
|
boolean |
isContentModified()
|
boolean |
isPropertiesModified()
|
boolean |
isVersionableChange()
|
void |
removeAspect(java.lang.String name)
|
void |
removeProperty(java.lang.String key)
|
void |
removePropertyValue(java.lang.String key,
java.lang.String value)
|
void |
setAuthorUserName(java.lang.String authorUserName)
|
void |
setContent(java.lang.Object content)
|
void |
setContentID(java.lang.String contentID)
|
void |
setContentModified(boolean contentModified)
This method is used to explicitly set the content modified state of the resource. |
void |
setContentStream(java.io.InputStream contentStream)
|
void |
setCreatedTime(java.util.Date createdTime)
|
void |
setDataSource(javax.sql.DataSource dataSource)
|
void |
setDescription(java.lang.String description)
|
void |
setId(java.lang.String id)
|
void |
setLastModified(java.util.Date lastModified)
|
void |
setLastUpdaterUserName(java.lang.String lastUpdaterUserName)
|
void |
setMatchingSnapshotID(long matchingSnapshotID)
|
void |
setMediaType(java.lang.String mediaType)
|
void |
setParentPath(java.lang.String parentPath)
|
void |
setPath(java.lang.String path)
|
void |
setProperties(java.util.Properties properties)
|
void |
setPropertiesModified(boolean propertiesModified)
|
void |
setProperty(java.lang.String key,
java.util.List<java.lang.String> value)
|
void |
setProperty(java.lang.String key,
java.lang.String value)
|
void |
setSnapshotID(long snapshotID)
|
void |
setState(int state)
|
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 |
|---|
protected java.lang.String id
protected long snapshotID
protected long versionNumber
protected java.lang.String authorUserName
protected java.sql.Timestamp createdTime
protected java.lang.String lastUpdaterUserName
protected java.sql.Timestamp lastModified
protected java.lang.String description
protected java.lang.String path
protected long matchingSnapshotID
protected java.lang.String permanentPath
protected java.lang.String mediaType
protected java.lang.String parentPath
protected boolean contentModified
protected boolean propertiesModified
protected boolean versionableChange
protected int state
protected java.util.Properties properties
protected java.lang.String contentID
protected java.lang.Object content
protected boolean directory
protected java.io.InputStream contentStream
protected javax.sql.DataSource dataSource
protected ResourceDAO resourceDAO
| Constructor Detail |
|---|
public ResourceImpl()
| Method Detail |
|---|
public void setDataSource(javax.sql.DataSource dataSource)
public java.lang.String getId()
getId in interface Resourcepublic void setId(java.lang.String id)
public long getSnapshotID()
public void setSnapshotID(long snapshotID)
public long getVersionNumber()
public void setVersionNumber(long versionNumber)
public java.lang.String getAuthorUserName()
getAuthorUserName in interface Resourcepublic void setAuthorUserName(java.lang.String authorUserName)
public java.util.Date getCreatedTime()
getCreatedTime in interface Resourcepublic void setCreatedTime(java.util.Date createdTime)
public java.util.Date getLastModified()
getLastModified in interface Resourcepublic void setLastModified(java.util.Date lastModified)
public java.lang.String getDescription()
getDescription in interface Resourcepublic void setDescription(java.lang.String description)
setDescription in interface Resourcepublic java.lang.String getPath()
getPath in interface Resourcepublic void setPath(java.lang.String path)
public long getMatchingSnapshotID()
public void setMatchingSnapshotID(long matchingSnapshotID)
public java.lang.String getPermanentPath()
Resource
getPermanentPath in interface Resourcepublic java.lang.String getMediaType()
getMediaType in interface Resourcepublic void setMediaType(java.lang.String mediaType)
setMediaType in interface Resourcepublic java.lang.String getParentPath()
getParentPath in interface Resourcepublic void setParentPath(java.lang.String parentPath)
public int getState()
getState in interface Resourcepublic void setState(int state)
public java.lang.String getProperty(java.lang.String key)
getProperty in interface Resourcepublic java.util.List getPropertyValues(java.lang.String key)
Resource
getPropertyValues in interface Resourcekey - Key of the property.
public java.util.Properties getProperties()
Resource
getProperties in interface Resourcepublic void removeProperty(java.lang.String key)
removeProperty in interface Resource
public void removePropertyValue(java.lang.String key,
java.lang.String value)
removePropertyValue in interface Resource
public void editPropertyValue(java.lang.String key,
java.lang.String oldValue,
java.lang.String newValue)
editPropertyValue in interface Resource
public void setProperty(java.lang.String key,
java.lang.String value)
setProperty in interface Resource
public void setProperty(java.lang.String key,
java.util.List<java.lang.String> value)
setProperty in interface Resource
public void addProperty(java.lang.String key,
java.lang.String value)
addProperty in interface Resourcepublic void setProperties(java.util.Properties properties)
setProperties in interface Resourcepublic java.lang.String getContentID()
public void setContentID(java.lang.String contentID)
public java.io.InputStream getContentStream()
throws RegistryException
getContentStream in interface ResourceRegistryExceptionpublic void setContentStream(java.io.InputStream contentStream)
setContentStream in interface Resource
public java.lang.Object getContent()
throws RegistryException
getContent in interface ResourceRegistryExceptionpublic void setContent(java.lang.Object content)
setContent in interface Resourcepublic java.lang.String getLastUpdaterUserName()
getLastUpdaterUserName in interface Resourcepublic void setLastUpdaterUserName(java.lang.String lastUpdaterUserName)
public boolean isContentModified()
public void setContentModified(boolean contentModified)
contentModified - true if we want to add a new version upon putting this to the
registry. false otherwise.public boolean isPropertiesModified()
public void setPropertiesModified(boolean propertiesModified)
public boolean isVersionableChange()
public void setVersionableChange(boolean versionableChange)
public java.util.List<java.lang.String> getAspects()
getAspects in interface Resourcepublic void addAspect(java.lang.String name)
addAspect in interface Resourcepublic void removeAspect(java.lang.String name)
removeAspect in interface Resource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||