Package org.wso2.carbon.registry.ws.api
Class WSRegistry
java.lang.Object
org.wso2.carbon.core.AbstractAdmin
org.wso2.carbon.registry.common.services.RegistryAbstractAdmin
org.wso2.carbon.registry.ws.api.WSRegistry
- All Implemented Interfaces:
org.wso2.carbon.registry.api.CoreRegistry,org.wso2.carbon.registry.api.Registry,org.wso2.carbon.registry.core.CoreRegistry,org.wso2.carbon.registry.core.dataaccess.TransactionManager,org.wso2.carbon.registry.core.Registry
public class WSRegistry
extends org.wso2.carbon.registry.common.services.RegistryAbstractAdmin
implements org.wso2.carbon.registry.core.Registry
-
Field Summary
Fields inherited from class org.wso2.carbon.registry.common.services.RegistryAbstractAdmin
SERVELT_SESSIONFields inherited from class org.wso2.carbon.core.AbstractAdmin
axisConfig, configurationContext -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidaddAssociation(String sourcePath, String targetPath, String associationType) Adds an association stating that the resource at "associationPath" associate on the resource at "associationPath".addComment(String s, org.wso2.carbon.registry.api.Comment comment) addComment(String resourcePath, org.wso2.carbon.registry.core.Comment comment) voidApplies the given tag to the resource in the given path.voidassociateAspect(String resourcePath, String aspect) Associate an Aspect with a resource.voidvoidCopy a resource in the registry.voidcreateLink(String path, String target) Create a symbolic link or mount a registryvoidcreateLink(String path, String target, String subTargetPath) voidcreateLinkWithSubTarget(String path, String target, String subTargetPath) Create a symbolic link or mount a registyvoidcreateVersion(String path) Creates a new version of the resource.voidDeletes the resource at the given path.voidvoidvoideditComment(String commentPath, String text) Change the text of an existing comment.org.wso2.carbon.registry.core.CollectionexecuteQuery(String path, Map parameters) org.wso2.carbon.registry.core.Resourceorg.wso2.carbon.registry.core.Collectionorg.wso2.carbon.registry.core.Association[]getAllAssociations(String resourcePath) Get all associations of the given resource.String[]getAspectActions(String resourcePath, String aspectName) Obtain a list of the available actions on a given resource for a given Aspect.org.wso2.carbon.registry.core.Association[]getAssociations(String resourcePath, String associationType) Get all associations of the given resource for a give association type.String[]Get a list of the available Aspects for this RegistryfloatgetAverageRating(String resourcePath) Returns the average rating for the given resource.org.wso2.carbon.registry.core.CollectiongetChildCollection(String path, int start, int pageSize) intgetChildCount(String path) String[]getCollectionContent(String path) Returns content of a specific Collection.org.wso2.carbon.registry.core.Comment[]getComments(String resourcePath) getContent(String path) Returns content of a Resource at the specified path.getEventingServiceURL(String path) Gets the URL of the WS-Eventing Service.org.wso2.carbon.registry.core.LogEntryCollectiongetLogCollection(String resourcePath, int action, String userName, Date from, Date to, boolean recentFirst) This method is not supported in WS-APIorg.wso2.carbon.registry.core.LogEntry[]Returns the logs of the activities occurred in the Registry.org.wso2.carbon.registry.core.ResourcegetMetaData(String path) intReturns the rating given to the specified resource by the given userorg.wso2.carbon.registry.core.config.RegistryContextorg.wso2.carbon.registry.core.TaggedResourcePath[]org.wso2.carbon.registry.core.Tag[]Returns all tags used for tagging the given resource.String[]getVersions(String path) Get a list of all versions of the resource located at the given path.importResource(String s, String s1, org.wso2.carbon.registry.api.Resource resource) importResource(String suggestedPath, String sourceURL, org.wso2.carbon.registry.core.Resource metadata) voidinvokeAspect(String resourcePath, String aspectName, String action) This invokes an action on a specified Aspect, which must be associated with the Resource at the given path.voidThis invokes an action on a specified Aspect, which must be associated with the Resource at the given path.voidinvokeAspectNoParam(String resourcePath, String aspectName, String action) This invokes an action on a specified Aspect, which must be associated with the Resource at the given path.voidinvokeAspectWithParam(String resourcePath, String aspectName, String action, String[] keys, String[] values) This invokes an action on a specified Aspect, which must be associated with the Resource at the given path.Move or rename a resource in the registry.org.wso2.carbon.registry.core.Collectionorg.wso2.carbon.registry.core.ResourcevoidrateResource(String resourcePath, int rating) Rate the given resource.booleanremoveAspect(String name) Remove the given aspect from registry context.voidremoveAssociation(String sourcePath, String targetPath, String associationType) To remove an association for a given resourcevoidremoveComment(String commentPath) Delete an existing comment.voidremoveLink(String path) Remove a symbolic link or mount point createdvoidRemoves a tag on a resource.booleanremoveVersionHistory(String path, long snapshotId) Move or rename a resource in the registry.booleanresourceExists(String path) Check whether a resource exists at the given pathvoidvoidrestoreVersion(String versionPath) Reverts a resource to a given version.voidorg.wso2.carbon.registry.core.CollectionsearchContent(String keywords) voidsetEventingServiceURL(String path, String eventingServiceURL) Sets the URL of the WS-Eventing Service.WSaddComment(String resourcePath, WSComment comment) Adds a comment to a resource.WSexecuteQuery(String path, String[] key, String[] value) Executes a custom query which lives at the given path in the Registry.Returns the resource at the given path.WSgetAllAssociations(String resoucePath) This is the web service friendly version of getAllAssociations(String resourcePath) methodWSgetAssociations(String resourcePath, String associationType) Get all associations of the given resource for a give association type.WSgetChildCollection(String path, int start, int pageSize) WSgetComments(String resourcePath) Get all comments for the given resource.WSgetLogs(String resourcePath, int action, String userName, Date from, Date to, boolean recentFirst) Returns the logs of the activities occurred in the Registry.WSgetMetaData(String path) Returns the meta data of the resource at the given path.Returns the paths of all Resources that are tagged with the given tag.WSgetSingleComment(String commentPath) Get the comment for the given comment path.WSTag[]Returns all tags used for tagging the given resource.WSgetWithPageSize(String path, int start, int pageSize) Returns the WSCollection according to the Collection at the given path, with the content paginated according to the arguments.WSimportResource(String suggestedPath, String sourceURL, WSResource metadata) Creates a resource by fetching the resource content from the given URL.Returns a new WSCollection instance.Returns a new WSResource instance.WSput(String suggestedPath, WSResource wsResource) Adds or updates resources in the registry.voidwsRestore(String path, DataHandler dataHandler) WSsearchContent(String keywords) Search the content of resourcesMethods inherited from class org.wso2.carbon.registry.common.services.RegistryAbstractAdmin
getRootRegistry, getRootRegistryMethods inherited from class org.wso2.carbon.core.AbstractAdmin
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUserId, getUsername, getUserRealm, setConfigurationContext, setPermissionUpdateTimestamp
-
Constructor Details
-
WSRegistry
public WSRegistry() throws org.wso2.carbon.registry.core.exceptions.RegistryExceptionConstructs a new Registry WS API instance. Only to be used by a web service client. This is used by the Registry Web Service client.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
-
Method Details
-
newResource
public org.wso2.carbon.registry.core.Resource newResource() throws org.wso2.carbon.registry.core.exceptions.RegistryException- Specified by:
newResourcein interfaceorg.wso2.carbon.registry.api.CoreRegistry- Specified by:
newResourcein interfaceorg.wso2.carbon.registry.core.CoreRegistry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
newCollection
public org.wso2.carbon.registry.core.Collection newCollection() throws org.wso2.carbon.registry.core.exceptions.RegistryException- Specified by:
newCollectionin interfaceorg.wso2.carbon.registry.api.CoreRegistry- Specified by:
newCollectionin interfaceorg.wso2.carbon.registry.core.CoreRegistry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSnewResource
Returns a new WSResource instance. This method is not used by the Registry Web Service client to avoid an unnecessary network call. It is only there for completeness of the Registry interface. A new Resource instance can be created directly from the client side.- Returns:
- WSResource instance
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSnewCollection
public WSCollection WSnewCollection() throws org.wso2.carbon.registry.core.exceptions.RegistryExceptionReturns a new WSCollection instance. This method is not used by the Registry Web Service client to avoid an unnecessary network call. It is only there for completeness of the Registry interface. A new Collection instance can be created directly from the client side.- Returns:
- WSResource instance
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
get
public org.wso2.carbon.registry.core.Resource get(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
getin interfaceorg.wso2.carbon.registry.api.CoreRegistry- Specified by:
getin interfaceorg.wso2.carbon.registry.core.CoreRegistry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSget
public WSResource WSget(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the resource at the given path.- Parameters:
path- Path of the resource. e.g. /project1/server/deployment.xml- Returns:
- WSResource instance
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- is thrown if the resource is not in the registry
-
getMetaData
public org.wso2.carbon.registry.core.Resource getMetaData(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
getMetaDatain interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getMetaDatain interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
importResource
public String importResource(String s, String s1, org.wso2.carbon.registry.api.Resource resource) throws org.wso2.carbon.registry.api.RegistryException - Specified by:
importResourcein interfaceorg.wso2.carbon.registry.api.Registry- Throws:
org.wso2.carbon.registry.api.RegistryException
-
WSgetMetaData
public WSResource WSgetMetaData(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the meta data of the resource at the given path.- Parameters:
path- Path of the resource. e.g. /project1/server/deployment.xml- Returns:
- WSResource instance
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- is thrown if the resource is not in the registry
-
get
public org.wso2.carbon.registry.core.Collection get(String path, int start, int pageSize) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
getin interfaceorg.wso2.carbon.registry.api.CoreRegistry- Specified by:
getin interfaceorg.wso2.carbon.registry.core.CoreRegistry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getChildCollection
public org.wso2.carbon.registry.core.Collection getChildCollection(String path, int start, int pageSize) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSgetWithPageSize
public WSCollection WSgetWithPageSize(String path, int start, int pageSize) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the WSCollection according to the Collection at the given path, with the content paginated according to the arguments.- Parameters:
path- the path of the collection. MUST point to a collection!start- the initial index of the child to return. If there are fewer children than the specified value, a RegistryException will be thrown.pageSize- the maximum number of results to return- Returns:
- a Collection containing the specified results in the content
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if the resource is not found, or if the path does not reference a Collection, or if the start index is greater than the number of children.
-
WSgetChildCollection
public WSCollection WSgetChildCollection(String path, int start, int pageSize) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
resourceExists
public boolean resourceExists(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Check whether a resource exists at the given path- Specified by:
resourceExistsin interfaceorg.wso2.carbon.registry.api.CoreRegistry- Specified by:
resourceExistsin interfaceorg.wso2.carbon.registry.core.CoreRegistry- Parameters:
path- Path of the resource to be checked- Returns:
- true if a resource exists at the given path, false otherwise.
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if an error occurs
-
put
public String put(String s, org.wso2.carbon.registry.api.Resource resource) throws org.wso2.carbon.registry.api.RegistryException - Specified by:
putin interfaceorg.wso2.carbon.registry.api.CoreRegistry- Throws:
org.wso2.carbon.registry.api.RegistryException
-
put
public String put(String suggestedPath, org.wso2.carbon.registry.core.Resource resource) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
putin interfaceorg.wso2.carbon.registry.core.CoreRegistry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSput
public String WSput(String suggestedPath, WSResource wsResource) throws org.wso2.carbon.registry.core.exceptions.RegistryException, IOException Adds or updates resources in the registry. If there is no resource at the given path, resource is added. If a resource already exist at the given path, it will be replaced with the new resource.- Parameters:
suggestedPath- the path which we'd like to use for the new resource.wsResource- WSResource instance for the new resource. This will be converted to a Resource instance internally.- Returns:
- the actual path that the server chose to use for our Resource
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryExceptionIOException
-
delete
Deletes the resource at the given path. If the path refers to a directory, all child resources of the directory will also be deleted.- Specified by:
deletein interfaceorg.wso2.carbon.registry.api.CoreRegistry- Specified by:
deletein interfaceorg.wso2.carbon.registry.core.CoreRegistry- Parameters:
path- Path of the resource to be deleted.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- is thrown depending on the implementation.
-
importResource
public String importResource(String suggestedPath, String sourceURL, org.wso2.carbon.registry.core.Resource metadata) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
importResourcein interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSimportResource
public String WSimportResource(String suggestedPath, String sourceURL, WSResource metadata) throws org.wso2.carbon.registry.core.exceptions.RegistryException Creates a resource by fetching the resource content from the given URL.- Parameters:
suggestedPath- path where we'd like to add the new resource. Although this path is specified by the caller of the method, resource may not be actually added at this path.sourceURL- where to fetch the resource contentmetadata- a WSResource instance containing meta data parameters- Returns:
- actual path to the new resource
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if we couldn't get or store the new resource
-
rename
public String rename(String currentPath, String newName) throws org.wso2.carbon.registry.core.exceptions.RegistryException Move or rename a resource in the registry. This is equivalent to 1) delete the resource, then 2) add the resource to the new location. The operation is atomic, so if it fails the old resource will still be there.- Specified by:
renamein interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
renamein interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
currentPath- current path of the resourcenewName- where we'd like to move the reosurce- Returns:
- the actual path for the new resource
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if something went wrong
-
move
public String move(String currentPath, String newPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Move or rename a resource in the registry. This is equivalent to 1) delete the resource, then 2) add the resource to the new location. The operation is atomic, so if it fails the old resource will still be there.- Specified by:
movein interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
movein interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
currentPath- current path of the resourcenewPath- where we'd like to move the reosurce- Returns:
- the actual path for the new resource
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if something went wrong
-
copy
public String copy(String sourcePath, String targetPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Copy a resource in the registry. The operation is atomic, so if the resource was a collection, all children and the collection would be copied in a single-go.- Specified by:
copyin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
copyin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
sourcePath- current path of the resourcetargetPath- where we'd like to copy the resource- Returns:
- the actual path for the new resource
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if something went wrong
-
createVersion
public void createVersion(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Creates a new version of the resource.- Specified by:
createVersionin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
createVersionin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- the resource path.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if something went wrong.
-
getVersions
public String[] getVersions(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Get a list of all versions of the resource located at the given path. Version paths are returned in the form /projects/myresource?v=12- Specified by:
getVersionsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getVersionsin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- path of a current version of a resource- Returns:
- a String array containing the individual paths of versions
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if there is an error
-
restoreVersion
public void restoreVersion(String versionPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Reverts a resource to a given version.- Specified by:
restoreVersionin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
restoreVersionin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
versionPath- path of the version to be reverted. It is not necessary to provide the path of the resource as it can be derived from the version path.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if there is an error
-
addAssociation
public void addAssociation(String sourcePath, String targetPath, String associationType) throws org.wso2.carbon.registry.core.exceptions.RegistryException Adds an association stating that the resource at "associationPath" associate on the resource at "associationPath". Paths may be the resource paths of the current versions or paths of the old versions. If a path refers to the current version, it should contain the path in the form /c1/c2/r1. If it refers to an old version, it should be in the form /c1/c2/r1?v=2.- Specified by:
addAssociationin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
addAssociationin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
sourcePath- Path of the source resourcetargetPath- Path of the target resourceassociationType- Type of the association- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- Depends on the implementation
-
removeAssociation
public void removeAssociation(String sourcePath, String targetPath, String associationType) throws org.wso2.carbon.registry.core.exceptions.RegistryException To remove an association for a given resource- Specified by:
removeAssociationin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
removeAssociationin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
sourcePath- Path of the source resourcetargetPath- Path of the target resourceassociationType- Type of the association- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- Depends on the implementation
-
getAllAssociations
public org.wso2.carbon.registry.core.Association[] getAllAssociations(String resourcePath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Get all associations of the given resource. This is a chain of association starting from the given resource both upwards (source to destination) and downwards (destination to source). T his is useful to analyse how changes to other resources would affect the given resource.- Specified by:
getAllAssociationsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getAllAssociationsin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resource to analyse associations.- Returns:
- List of Association
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- : If something went wrong
-
WSgetAllAssociations
public WSAssociation[] WSgetAllAssociations(String resoucePath) throws org.wso2.carbon.registry.core.exceptions.RegistryException This is the web service friendly version of getAllAssociations(String resourcePath) method- Parameters:
resoucePath- path of resource- Returns:
- WSAssociation
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getAssociations
public org.wso2.carbon.registry.core.Association[] getAssociations(String resourcePath, String associationType) throws org.wso2.carbon.registry.core.exceptions.RegistryException Get all associations of the given resource for a give association type. This is a chain of association starting from the given resource both upwards (source to destination) and downwards (destination to source). T his is useful to analyse how changes to other resources would affect the given resource.- Specified by:
getAssociationsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getAssociationsin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resource to analyse associations.associationType- : Type of the association , that could be dependecy , or some other type- Returns:
- List of Association
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- : If something went wrong
-
WSgetAssociations
public WSAssociation[] WSgetAssociations(String resourcePath, String associationType) throws org.wso2.carbon.registry.core.exceptions.RegistryException Get all associations of the given resource for a give association type. This is a chain of association starting from the given resource both upwards (source to destination) and downwards (destination to source). T his is useful to analyse how changes to other resources would affect the given resource.- Parameters:
resourcePath- Path of the resource to analyse associations.associationType- : Type of the association , that could be dependecy , or some other type- Returns:
- List of Association
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- : If something went wrong
-
applyTag
public void applyTag(String resourcePath, String tag) throws org.wso2.carbon.registry.core.exceptions.RegistryException Applies the given tag to the resource in the given path. If the given tag is not defined in the registry, it will be defined.- Specified by:
applyTagin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
applyTagin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resource to be tagged.tag- Tag. Any string can be used for the tag.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- is thrown if a resource does not exist in the given path.
-
getResourcePathsWithTag
public org.wso2.carbon.registry.core.TaggedResourcePath[] getResourcePathsWithTag(String tag) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
getResourcePathsWithTagin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getResourcePathsWithTagin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSgetResourcePathsWithTag
public WSTaggedResourcePath[] WSgetResourcePathsWithTag(String tag) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the paths of all Resources that are tagged with the given tag.- Parameters:
tag- the tag to search for- Returns:
- an array of WSTaggedResourcePaths
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if an error occurs
-
getTags
public org.wso2.carbon.registry.core.Tag[] getTags(String resourcePath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns all tags used for tagging the given resource.- Specified by:
getTagsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getTagsin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resource- Returns:
- Tags tag names
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- is thrown if a resource does not exist in the given path.
-
WSgetTags
public WSTag[] WSgetTags(String resourcePath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns all tags used for tagging the given resource.- Parameters:
resourcePath- Path of the resource- Returns:
- Tags tag names
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- is thrown if a resource does not exist in the given path.
-
removeTag
public void removeTag(String path, String tag) throws org.wso2.carbon.registry.core.exceptions.RegistryException Removes a tag on a resource. If the resource at the path is owned by the current user, all taggings done using the given tag will be removed. If the resource is not owned by the current user, only the tagging done by the current user will be removed.- Specified by:
removeTagin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
removeTagin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- Resource path tagged with the given tag.tag- Name of the tag to be removed.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if there's a problem
-
addComment
public String addComment(String s, org.wso2.carbon.registry.api.Comment comment) throws org.wso2.carbon.registry.api.RegistryException - Specified by:
addCommentin interfaceorg.wso2.carbon.registry.api.Registry- Throws:
org.wso2.carbon.registry.api.RegistryException
-
addComment
public String addComment(String resourcePath, org.wso2.carbon.registry.core.Comment comment) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
addCommentin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSaddComment
public String WSaddComment(String resourcePath, WSComment comment) throws org.wso2.carbon.registry.core.exceptions.RegistryException Adds a comment to a resource.- Parameters:
resourcePath- Path of the resource to add the comment.comment- WSComment instance for the new comment. This will be converted to a Comment instance internally.- Returns:
- the path of the new comment.
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- is thrown if a resource does not exist in the given path.
-
editComment
public void editComment(String commentPath, String text) throws org.wso2.carbon.registry.core.exceptions.RegistryException Change the text of an existing comment.- Specified by:
editCommentin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
editCommentin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
commentPath- path to comment resource ("..foo/r1;comment:1")text- new text for the comment.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- Registry implementations may handle exceptions and throw RegistryException if the exception has to be propagated to the client.
-
getComments
public org.wso2.carbon.registry.core.Comment[] getComments(String resourcePath) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
getCommentsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getCommentsin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSgetComments
public WSComment[] WSgetComments(String resourcePath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Get all comments for the given resource.- Parameters:
resourcePath- path of the resource.- Returns:
- an array of WSComment objects.
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- Registry implementations may handle exceptions and throw RegistryException if the exception has to be propagated to the client.
-
WSgetSingleComment
public WSComment WSgetSingleComment(String commentPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Get the comment for the given comment path.- Parameters:
commentPath- path of the resource.- Returns:
- a WSComment.
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- Registry implementations may handle exceptions and throw RegistryException if the exception has to be propagated to the client.
-
rateResource
public void rateResource(String resourcePath, int rating) throws org.wso2.carbon.registry.core.exceptions.RegistryException Rate the given resource.- Specified by:
rateResourcein interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
rateResourcein interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resource.rating- Rating value between 1 and 5.- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- Registry implementations may handle exceptions and throw RegistryException if the exception has to be propagated to the client.
-
getAverageRating
public float getAverageRating(String resourcePath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the average rating for the given resource. This is the average of all ratings done by all users for the given resource.- Specified by:
getAverageRatingin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getAverageRatingin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resource.- Returns:
- Average rating between 1 and 5.
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if an error occurs
-
getRating
public int getRating(String path, String userName) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the rating given to the specified resource by the given user- Specified by:
getRatingin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getRatingin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- Path of the resourceuserName- username of the user- Returns:
- rating given by the given user
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if there is a problem
-
executeQuery
public org.wso2.carbon.registry.core.Collection executeQuery(String path, Map parameters) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
executeQueryin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
executeQueryin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSexecuteQuery
public WSCollection WSexecuteQuery(String path, String[] key, String[] value) throws org.wso2.carbon.registry.core.exceptions.RegistryException Executes a custom query which lives at the given path in the Registry.- Parameters:
path- Path of the query to execute.key- an array of String containing key parameters. These should correspond with the value parameters (key -> value)value- an array of String containing value parameters to the corresponding key parameters (key -> value)- Returns:
- a Collection containing any resource paths which match the query
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- depends on the implementation.
-
getLogs
public org.wso2.carbon.registry.core.LogEntry[] getLogs(String resourcePath, int action, String userName, Date from, Date to, boolean recentFirst) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the logs of the activities occurred in the Registry.- Specified by:
getLogsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getLogsin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- If given, only the logs related to the resource path will be returned. If null, logs for all resources will be returned.action- Only the logs pertaining to this action will be returned. For acceptable values, see LogEntry.userName- If given, only the logs for activities done by the given user will be returned. If null, logs for all users will be returned.from- If given, logs for activities occurred after the given date will be returned. If null, there will not be a bound for the starting date.to- If given, logs for activities occurred before the given date will be returned. If null, there will not be a bound for the ending date.recentFirst- If true, returned activities will be most-recent first. If false, returned activities will be oldest first.- Returns:
- Array of LogEntry objects representing the logs
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if there is a problem- See Also:
-
WSgetLogs
public WSLogEntry[] WSgetLogs(String resourcePath, int action, String userName, Date from, Date to, boolean recentFirst) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns the logs of the activities occurred in the Registry.- Parameters:
resourcePath- If given, only the logs related to the resource path will be returned. If null, logs for all resources will be returned.action- Only the logs pertaining to this action will be returned. For acceptable values, see LogEntry.userName- If given, only the logs for activities done by the given user will be returned. If null, logs for all users will be returned.from- If given, logs for activities occurred after the given date will be returned. If null, there will not be a bound for the starting date.to- If given, logs for activities occurred before the given date will be returned. If null, there will not be a bound for the ending date.recentFirst- If true, returned activities will be most-recent first. If false, returned activities will be oldest first.- Returns:
- Array of LogEntry objects representing the logs
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if there is a problem- See Also:
-
getLogCollection
public org.wso2.carbon.registry.core.LogEntryCollection getLogCollection(String resourcePath, int action, String userName, Date from, Date to, boolean recentFirst) throws org.wso2.carbon.registry.core.exceptions.RegistryException This method is not supported in WS-API- Specified by:
getLogCollectionin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getAvailableAspects
Get a list of the available Aspects for this Registry- Specified by:
getAvailableAspectsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getAvailableAspectsin interfaceorg.wso2.carbon.registry.core.Registry- Returns:
- a String array containing available Aspect names
-
associateAspect
public void associateAspect(String resourcePath, String aspect) throws org.wso2.carbon.registry.core.exceptions.RegistryException Associate an Aspect with a resource.- Specified by:
associateAspectin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
associateAspectin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resourceaspect- Name of the aspect- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- : If some thing went wrong while doing associating the phase
-
invokeAspectNoParam
public void invokeAspectNoParam(String resourcePath, String aspectName, String action) throws org.wso2.carbon.registry.core.exceptions.RegistryException This invokes an action on a specified Aspect, which must be associated with the Resource at the given path.- Parameters:
resourcePath- Path of the resourceaspectName- Name of the aspectaction- Which action was selected - actions are aspect-specific- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if the Aspect isn't associated with the Resource, or the action isn't valid, or an Aspect-specific problem occurs.
-
invokeAspect
public void invokeAspect(String resourcePath, String aspectName, String action) throws org.wso2.carbon.registry.core.exceptions.RegistryException This invokes an action on a specified Aspect, which must be associated with the Resource at the given path.- Specified by:
invokeAspectin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
invokeAspectin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resourceaspectName- Name of the aspectaction- Which action was selected - actions are aspect-specific- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if the Aspect isn't associated with the Resource, or the action isn't valid, or an Aspect-specific problem occurs.
-
invokeAspectWithParam
public void invokeAspectWithParam(String resourcePath, String aspectName, String action, String[] keys, String[] values) throws org.wso2.carbon.registry.core.exceptions.RegistryException This invokes an action on a specified Aspect, which must be associated with the Resource at the given path.- Parameters:
resourcePath- Path of the resourceaspectName- Name of the aspectaction- Which action was selected - actions are aspect-specifickeys- Parameters keys to be used for the operationvalues- Parameters values to be used for the operation- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if the Aspect isn't associated with the Resource, or the action isn't valid, or an Aspect-specific problem occurs.
-
invokeAspect
public void invokeAspect(String resourcePath, String aspectName, String action, Map<String, String> parameters) throws org.wso2.carbon.registry.core.exceptions.RegistryExceptionThis invokes an action on a specified Aspect, which must be associated with the Resource at the given path.- Specified by:
invokeAspectin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- Path of the resourceaspectName- Name of the aspectaction- Which action was selected - actions are aspect-specificparameters- Parameters to be used for the operation- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if the Aspect isn't associated with the Resource, or the action isn't valid, or an Aspect-specific problem occurs.
-
getAspectActions
public String[] getAspectActions(String resourcePath, String aspectName) throws org.wso2.carbon.registry.core.exceptions.RegistryException Obtain a list of the available actions on a given resource for a given Aspect. The Aspect must be associated with the Resource (@see associateAspect). The actions are determined by asking the Aspect itself, so they may change depending on the state of the Resource, the user who's asking, etc)- Specified by:
getAspectActionsin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getAspectActionsin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
resourcePath- path of the ResourceaspectName- name of the Aspect to query for available actions- Returns:
- a String[] of action names
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- if the Aspect isn't associated or an Aspect-specific problem occurs
-
beginTransaction
public void beginTransaction() throws org.wso2.carbon.registry.core.exceptions.RegistryException- Specified by:
beginTransactionin interfaceorg.wso2.carbon.registry.core.dataaccess.TransactionManager- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
commitTransaction
public void commitTransaction() throws org.wso2.carbon.registry.core.exceptions.RegistryException- Specified by:
commitTransactionin interfaceorg.wso2.carbon.registry.core.dataaccess.TransactionManager- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
rollbackTransaction
public void rollbackTransaction() throws org.wso2.carbon.registry.core.exceptions.RegistryException- Specified by:
rollbackTransactionin interfaceorg.wso2.carbon.registry.core.dataaccess.TransactionManager- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getRegistryContext
public org.wso2.carbon.registry.core.config.RegistryContext getRegistryContext()- Specified by:
getRegistryContextin interfaceorg.wso2.carbon.registry.core.Registry
-
searchContent
public org.wso2.carbon.registry.core.Collection searchContent(String keywords) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
searchContentin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
searchContentin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
WSsearchContent
public WSCollection WSsearchContent(String keywords) throws org.wso2.carbon.registry.core.exceptions.RegistryException Search the content of resources- Parameters:
keywords- keywords to look for- Returns:
- the result set as a WSCollection
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
createLink
public void createLink(String path, String target) throws org.wso2.carbon.registry.core.exceptions.RegistryException Create a symbolic link or mount a registry- Specified by:
createLinkin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
createLinkin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- the mount pathtarget- the point to be mounted- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
createLink
public void createLink(String path, String target, String subTargetPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
createLinkin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
createLinkin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
createLinkWithSubTarget
public void createLinkWithSubTarget(String path, String target, String subTargetPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Create a symbolic link or mount a registy- Parameters:
path- the mount pathtarget- the point to be mountedsubTargetPath- sub path in the remote instance to be mounted- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
removeLink
public void removeLink(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Remove a symbolic link or mount point created- Specified by:
removeLinkin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
removeLinkin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- the mount path- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
restore
public void restore(String path, Reader reader) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
restorein interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
restorein interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
wsRestore
public void wsRestore(String path, DataHandler dataHandler) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
dump
public void dump(String path, Writer writer) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
dumpin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
dumpin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
wsDump
public DataHandler wsDump(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getEventingServiceURL
public String getEventingServiceURL(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Gets the URL of the WS-Eventing Service.- Specified by:
getEventingServiceURLin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
getEventingServiceURLin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- the path to which the WS-Eventing Service URL is required- Returns:
- the URL of the WS-Eventing Service
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- throws if the operation fail
-
setEventingServiceURL
public void setEventingServiceURL(String path, String eventingServiceURL) throws org.wso2.carbon.registry.core.exceptions.RegistryException Sets the URL of the WS-Eventing Service.- Specified by:
setEventingServiceURLin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
setEventingServiceURLin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- the path to which the WS-Eventing Service URL is associatedeventingServiceURL- the URL of the WS-Eventing Service- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- throws if the operation fail
-
removeAspect
public boolean removeAspect(String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException Remove the given aspect from registry context.- Specified by:
removeAspectin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
name- the name of the aspect to be removed- Returns:
- return true if the operation finished successful, false otherwise.
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- throws if the operation fail
-
addAspect
public boolean addAspect(String name, org.wso2.carbon.registry.core.Aspect aspect) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
addAspectin interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
removeComment
public void removeComment(String commentPath) throws org.wso2.carbon.registry.core.exceptions.RegistryException Delete an existing comment.- Specified by:
removeCommentin interfaceorg.wso2.carbon.registry.api.Registry- Specified by:
removeCommentin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
commentPath- path to comment resource ("..foo/r1;comment:1")- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- Registry implementations may handle exceptions and throw RegistryException if the exception has to be propagated to the client.
-
getContent
public DataHandler getContent(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns content of a Resource at the specified path. Used by the Registry Web Service client to fetch resource content only when requested.- Parameters:
path- Path of the resource- Returns:
- data handler that is compatible with web services
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getCollectionContent
public String[] getCollectionContent(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException Returns content of a specific Collection. Used by the Registry Web Service client to fetch collection content only when requested.- Parameters:
path- Path of the resource- Returns:
- String array with the content
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getChildCount
public int getChildCount(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Parameters:
path- resource path- Returns:
- child count inside the resource
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
getAll
public WSResourceData getAll(String path) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-
removeVersionHistory
public boolean removeVersionHistory(String path, long snapshotId) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
removeVersionHistoryin interfaceorg.wso2.carbon.registry.core.Registry- Parameters:
path- Path of the resourcesnapshotId- Version ID- Returns:
- Succeed or not
- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException- If operation fails
-
dumpLite
public void dumpLite(String s, Writer writer) throws org.wso2.carbon.registry.core.exceptions.RegistryException - Specified by:
dumpLitein interfaceorg.wso2.carbon.registry.core.Registry- Throws:
org.wso2.carbon.registry.core.exceptions.RegistryException
-