|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
MetadataBean
- This bean can be used to access resource metadata, such as the
last modified time, the author, description and the whether this
resource is a collection or not. This also contains methods, to
obtain formatted representations of dates and times.CollectionContentBean
- This bean can be used to access the content of a collection. A
collection on the repository is similar to a folder on a
filesystem. And, this bean can be used for operations such as
obtaining the child count of a collection or obtaining the list of
child resources under the given collection.ResourceData
- This contains the details of a resource, along with the various
permissions that are available on it. This also can be used to
obtain details of the ratings and tags that have been added to
this resource.ContentBean
- This bean is used to manage the content of this resource. This
has information on the type of resource and the various access
restrictions that have been made to it.PermissionBean
- This bean can be used to manage the permissions associated with
this resource or collection.VersionsBean
- This bean can be used to obtain details of versions that were
created for this resource or collections. The version path can be
used o browse through a version or restore back to it.ResourceTreeEntryBean
- This bean is used in the process of generating the tree view of
the resource. This is used for the mere purpose of establishing a
parent-child relationship between elements of the resource tree.ContentDownloadBean
- This bean contains a data handler that can be used to access the
resource content. It also contains the media type and the last
updated time of the resource.public interface IResourceService<MetadataBean,CollectionContentBean,ResourceData,ContentBean,PermissionBean,VersionsBean,ResourceTreeEntryBean,ContentDownloadBean>
This provides the functionality to manage resources and collections on the repository. The resource browser on the WSO2 Carbon Management console uses the functionality exposed by this interface.
In addition to managing resources and collections, this also provides the capabilities of managing resource permissions and also installing and un-installing extensions to the repository.
Method Summary | |
---|---|
String |
addCollection(String parentPath,
String collectionName,
String collectionType,
String description)
Method to add a new collection to the repository. |
boolean |
addExtension(String name,
DataHandler content)
Method to upload an extension to the registry. |
void |
addRemoteLink(String parentPath,
String name,
String instance,
String targetPath)
Method to create a link to a remote resource (a resource on another repository that has been mounted into this repository). |
boolean |
addResource(String path,
String mediaType,
String description,
DataHandler content,
String symlinkLocation)
Method to add a new resource from the filesystem into the repository. |
boolean |
addRolePermission(String pathToAuthorize,
String roleToAuthorize,
String actionToAuthorize,
String permissionType)
Method to add a role permission to the given resource (or collection) path. |
void |
addSymbolicLink(String parentPath,
String name,
String targetPath)
Method to create a symbolic link. |
boolean |
changeRolePermissions(String resourcePath,
String permissionsInput)
Method to change the permissions that have been granted to the given resource. |
boolean |
copyResource(String optional,
String oldResourcePath,
String parentPath,
String resourceName)
Method to copy a resource on the repository from one location to another. |
boolean |
createVersion(String resourcePath)
Method to create a new version at the given path. |
boolean |
delete(String pathToDelete)
Method to delete a resource (or collection) at the given path. |
CollectionContentBean |
getCollectionContent(String path)
Method to obtain the content of a collection. |
String |
getCollectionMediatypeDefinitions()
Method to obtain a list of media types against which handlers that are responsible for creating various collection types are registered. |
ContentBean |
getContentBean(String path)
Method to obtain a bean that can be used to manage the content of this resource. |
ContentDownloadBean |
getContentDownloadBean(String path)
Method to obtain a bean from with the content of the given resource can be downloaded. |
String |
getCustomUIMediatypeDefinitions()
Method to obtain a list of media types against which custom user interfaces that are which will show up on the management console in place of the standard user interfaces for resources are registered |
String |
getHumanReadableMediaTypes()
Method to obtain human readable Media Types. |
String |
getMediatypeDefinitions()
Method to obtain a list of media types for resources stored on the repository. |
MetadataBean |
getMetadata(String path)
Method to obtain resource metadata. |
String |
getMimeTypeFromHuman(String mediaType)
Method to obtain mime types for the corresponding Media Type. |
PermissionBean |
getPermissions(String path)
Method to obtain a bean that can be used to manage and manipulate resource permissions. |
String |
getProperty(String resourcePath,
String key)
Method to obtain a named property of the given resource. |
ResourceData[] |
getResourceData(String[] paths)
Method to obtain the resource data for the given list of resource paths. |
ResourceTreeEntryBean |
getResourceTreeEntry(String resourcePath)
Method to obtain a bean for an entry on the resource tree. |
String |
getSessionResourcePath()
Method to obtain the resource path which has been set on the servlet session. |
VersionsBean |
getVersionsBean(String path)
Method to obtain a list of versions of the given resource. |
boolean |
importResource(String parentPath,
String resourceName,
String mediaType,
String description,
String fetchURL,
String symlinkLocation)
Method to import a resource (available on a specified remote URL) in to the repository. |
String[] |
listExtensions()
This method lists all of the installed extensions for the given tenant. |
boolean |
moveResource(String optional,
String oldResourcePath,
String parentPath,
String resourceName)
Method to move a resource on the repository from one location to another. |
boolean |
removeExtension(String name)
Method to remove the named extension from the registry. |
boolean |
renameResource(String parentPath,
String oldResourcePath,
String newResourceName)
Method to rename resource (or collection) on the repository. |
boolean |
restoreVersion(String versionPath)
Method to restore a resource to the given version. |
void |
setDescription(String path,
String description)
Method to set a description to this resource or collection. |
void |
setSessionResourcePath(String resourcePath)
Method to set a resource path to the servlet session, to be used later. |
Methods inherited from interface org.wso2.carbon.registry.admin.api.resource.ITextResourceManagementService |
---|
addTextContent, getTextContent, updateTextContent |
Method Detail |
---|
MetadataBean getMetadata(String path) throws Exception
path
- the resource path.
Exception
- if the operation failed.void setDescription(String path, String description) throws Exception
path
- the resource path.description
- the description to set.
Exception
- if the operation failed.CollectionContentBean getCollectionContent(String path) throws Exception
path
- the collection path.
Exception
- if the operation failed.ResourceData[] getResourceData(String[] paths) throws Exception
paths
- the list of resource paths for which we need to obtain resource data.
Exception
- if the operation failed.ContentBean getContentBean(String path) throws Exception
path
- the resource path.
Exception
- if the operation failed.String addCollection(String parentPath, String collectionName, String collectionType, String description) throws Exception
parentPath
- the parent path (or the path at which we are adding this collection).collectionName
- the name of the collection.collectionType
- the type of the collection. Collections unlike resources do not have
a concept of media type. However, to create special types of
collections, we specify a media type which will be used to trigger a
handler which will create a collection of a specific type (ex:- Axis2
Repository collection).description
- the description for the newly added collection.
Exception
- if the operation failed.void addSymbolicLink(String parentPath, String name, String targetPath) throws Exception
parentPath
- the parent path (or the path at which we are adding this link). Please note
that the parent path should not have trailing slashes.name
- the name of the symbolic link.targetPath
- the actual resource to which this link points to.
Exception
- if the operation failed.void addRemoteLink(String parentPath, String name, String instance, String targetPath) throws Exception
parentPath
- the parent path (or the path at which we are adding this link).name
- the name of the symbolic link.instance
- the identifier of the remote instance.targetPath
- the actual resource to which this link points to.
Exception
- if the operation failed.boolean importResource(String parentPath, String resourceName, String mediaType, String description, String fetchURL, String symlinkLocation) throws Exception
parentPath
- the parent path (or the path at which we are adding this resource).resourceName
- the name of the resource.mediaType
- the media type of the resource.description
- the description for the newly added resource.fetchURL
- the remote URL at which the resource is available for download.symlinkLocation
- the location of the symbolic link to be created. This parameter is
used when importing WSDL and Schema files, which will optionally
create a symbolic link that points to the uploaded WSDL or Schema.
Exception
- if the operation failed due to an unexpected error.boolean delete(String pathToDelete) throws Exception
pathToDelete
- the path of the resource (or collection) to delete.
Exception
- if the operation failed due to an unexpected error.PermissionBean getPermissions(String path) throws Exception
path
- the path of the resource (or collection).
Exception
- if the operation failed.boolean addRolePermission(String pathToAuthorize, String roleToAuthorize, String actionToAuthorize, String permissionType) throws Exception
pathToAuthorize
- the resource path for which the permission is added to do.roleToAuthorize
- the role for which the permission is granted to.actionToAuthorize
- the action that is authorized. The following actions correspond to
following resource permissions:
permissionType
- the type of permission to be granted. The following types are
available:
Exception
- if the operation failed due to an unexpected error.boolean changeRolePermissions(String resourcePath, String permissionsInput) throws Exception
resourcePath
- the resource path for which the permissions are changed.permissionsInput
- the permission input is a string in the following format:
<permission-string> :- <role-permissions>
<role-permissions> :- <role-permission>|<role-permissions>
<role-permission> :- <role-name>:<permissions>
<permissions> :- <permission>:<permissions>
<permission> :- <action>^<type>
<role-name> :- a name of a valid role on the system
<action> :- ra, rd, wa, wd,
da, dd, aa or ad.
<type> :- true or false
where the following defines the actions:
Exception
- if the operation failed due to an unexpected error.boolean addResource(String path, String mediaType, String description, DataHandler content, String symlinkLocation) throws Exception
path
- the path to which the resource would be added.mediaType
- the media type of the resource.description
- the description for the newly added resource.content
- the data handler containing the resource's content.symlinkLocation
- the location of the symbolic link to be created. This parameter is
used when importing WSDL and Schema files, which will optionally
create a symbolic link that points to the uploaded WSDL or Schema.
Exception
- if the operation failed due to an unexpected error.boolean addExtension(String name, DataHandler content) throws Exception
name
- the name of the extension library (which should be a jar).content
- the content of the jar.
Exception
- if the operation failed due to an unexpected error.String[] listExtensions() throws Exception
Exception
- if the operation failed.boolean removeExtension(String name) throws Exception
name
- the name of the extension library (which should be a jar).
Exception
- if the operation failed due to an unexpected error.boolean renameResource(String parentPath, String oldResourcePath, String newResourceName) throws Exception
parentPath
- The parent path of the new resource. If this parameter is to be used,
the new resource name should not start with a '/' character.oldResourcePath
- The complete path of the old resource.newResourceName
- The complete or path relative to parent path of the new resource.
Exception
- if the operation failed due to an unexpected error.boolean copyResource(String optional, String oldResourcePath, String parentPath, String resourceName) throws Exception
oldResourcePath
- the path of the existing resource.parentPath
- the path at which the new resource would be added.resourceName
- the name of the new resource.optional
- this parameter is not being used at the moment.
Exception
- if the operation failed due to an unexpected error.boolean moveResource(String optional, String oldResourcePath, String parentPath, String resourceName) throws Exception
oldResourcePath
- the path of the old resource.parentPath
- the path at which the new resource would be added.resourceName
- the name of the new resource.optional
- this parameter is not being used at the moment.
Exception
- if the operation failed due to an unexpected error.String getSessionResourcePath() throws Exception
Exception
- if the operation failed.void setSessionResourcePath(String resourcePath) throws Exception
resourcePath
- the resource path saved on the session.
Exception
- if the operation failed.ResourceTreeEntryBean getResourceTreeEntry(String resourcePath) throws Exception
resourcePath
- the path of the resource.
Exception
- if the operation failed.boolean createVersion(String resourcePath) throws Exception
resourcePath
- the path of the resource.
Exception
- if the operation failed due to an unexpected error.boolean restoreVersion(String versionPath) throws Exception
versionPath
- the path of the resource along with the version number to be restored to.
Exception
- if the operation failed due to an unexpected error.VersionsBean getVersionsBean(String path) throws Exception
path
- the resource path.
Exception
- if the operation failed.String getMediatypeDefinitions() throws Exception
Exception
- if the operation failed.String getCollectionMediatypeDefinitions() throws Exception
Exception
- if the operation failed.String getCustomUIMediatypeDefinitions() throws Exception
Exception
- if the operation failed.String getProperty(String resourcePath, String key) throws Exception
resourcePath
- the path of the resource (or collection).key
- the property key.
Exception
- if the operation failed.ContentDownloadBean getContentDownloadBean(String path) throws Exception
path
- the resource path.
Exception
- if the operation failed.String getHumanReadableMediaTypes() throws Exception
Exception
- if the operation failed.String getMimeTypeFromHuman(String mediaType) throws Exception
Exception
- if the operation failed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |