|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wso2.carbon.registry.core.session.UserRegistry
org.wso2.carbon.registry.core.ghostregistry.GhostRegistry
public class GhostRegistry
This implements the Ghost lazy loading pattern for the Registry. An actual registry instance will not be created until first access.
| Constructor Summary | |
|---|---|
GhostRegistry(org.wso2.carbon.registry.api.RegistryService registryService,
int tenantId,
org.wso2.carbon.context.RegistryType registryType)
|
|
| Method Summary | |
|---|---|
boolean |
addAspect(String name,
Aspect aspect)
Add aspect by passing a name and the aspect object. |
void |
addAssociation(String sourcePath,
String targetPath,
String associationType)
Adds an association stating that the resource at "associationPath" associate on the resource at "associationPath". |
String |
addComment(String resourcePath,
Comment comment)
Adds a comment to a resource. |
String |
addComment(String resourcePath,
org.wso2.carbon.registry.api.Comment comment)
|
void |
applyTag(String resourcePath,
String tag)
Applies the given tag to the resource in the given path. |
void |
associateAspect(String resourcePath,
String aspect)
Associate an Aspect with a resource. |
void |
beginTransaction()
Start a new transaction |
void |
commitTransaction()
Commit the currently active transaction |
String |
copy(String sourcePath,
String targetPath)
Copy a resource in the registry. |
void |
createLink(String path,
String target)
Create a symbolic link or mount a registry |
void |
createLink(String path,
String target,
String subTargetPath)
Create a symbolic link or mount a registry |
void |
createVersion(String path)
Creates a new version of the resource. |
void |
delete(String path)
Deletes the resource at the given path. |
void |
dump(String path,
Writer writer)
Check out the given path as an xml. |
void |
editComment(String commentPath,
String text)
Change the text of an existing comment. |
Collection |
executeQuery(String path,
Map parameters)
Executes a custom query which lives at the given path in the Registry. |
Resource |
get(String path)
Returns the resource at the given path. |
Collection |
get(String path,
int start,
int pageSize)
Returns the Collection at the given path, with the content paginated according to the arguments. |
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. |
Association[] |
getAssociations(String resourcePath,
String associationType)
Get all associations of the given resource for a give association type. |
String[] |
getAvailableAspects()
Get a list of the available Aspects for this Registry |
float |
getAverageRating(String resourcePath)
Returns the average rating for the given resource. |
Comment[] |
getComments(String resourcePath)
Get all comments for the given resource. |
String |
getEventingServiceURL(String path)
Gets the URL of the WS-Eventing Service. |
LogEntryCollection |
getLogCollection(String resourcePath,
int action,
String userName,
Date from,
Date to,
boolean recentFirst)
Deprecated. |
LogEntry[] |
getLogs(String resourcePath,
int action,
String userName,
Date from,
Date to,
boolean recentFirst)
Returns the logs of the activities occurred in the registry. |
Resource |
getMetaData(String path)
Returns the meta data of the resource at a given path. |
int |
getRating(String path,
String userName)
Returns the rating given to the specified resource by the given user |
RegistryContext |
getRegistryContext()
Get the configuration for this Registry |
TaggedResourcePath[] |
getResourcePathsWithTag(String tag)
Returns the paths of all Resources that are tagged with the given tag. |
Tag[] |
getTags(String resourcePath)
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. |
String |
importResource(String suggestedPath,
String sourceURL,
Resource resource)
Creates a resource by fetching the resource content from the given URL. |
String |
importResource(String suggestedPath,
String sourceURL,
org.wso2.carbon.registry.api.Resource resource)
|
void |
invokeAspect(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. |
void |
invokeAspect(String resourcePath,
String aspectName,
String action,
Map<String,String> parameters)
This invokes an action on a specified Aspect, which must be associated with the Resource at the given path. |
String |
move(String currentPath,
String newPath)
Move a resource in the registry. |
Collection |
newCollection()
Creates a new collection. |
Resource |
newResource()
Creates a new resource. |
String |
put(String suggestedPath,
Resource resource)
Adds or updates resources in the registry. |
String |
put(String suggestedPath,
org.wso2.carbon.registry.api.Resource resource)
|
void |
rateResource(String resourcePath,
int rating)
Rate the given resource. |
boolean |
removeAspect(String aspect)
Remove the given aspect from registry context. |
void |
removeAssociation(String sourcePath,
String targetPath,
String associationType)
To remove an association for a given resource |
void |
removeComment(String commentPath)
Delete an existing comment. |
void |
removeLink(String path)
Remove a symbolic link or mount point created |
void |
removeTag(String path,
String tag)
Removes a tag on a resource. |
boolean |
removeVersionHistory(String path,
long snapshotId)
Removes a given version history of a resource. |
String |
rename(String currentPath,
String newName)
Rename a resource in the registry. |
boolean |
resourceExists(String path)
Check whether a resource exists at the given path |
void |
restore(String path,
Reader reader)
Check in the input axiom element into database. |
void |
restoreVersion(String versionPath)
Reverts a resource to a given version. |
void |
rollbackTransaction()
Rollback the currently active transaction |
Collection |
searchContent(String keywords)
Search the content of resources |
void |
setEventingServiceURL(String path,
String eventingServiceURL)
Sets the URL of the WS-Eventing Service. |
| Methods inherited from class org.wso2.carbon.registry.core.session.UserRegistry |
|---|
getCallerTenantId, getChrootedRegistry, getTenantId, getUserName, getUserRealm, setSessionInformation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public GhostRegistry(org.wso2.carbon.registry.api.RegistryService registryService,
int tenantId,
org.wso2.carbon.context.RegistryType registryType)
throws org.wso2.carbon.registry.api.RegistryException
org.wso2.carbon.registry.api.RegistryException| Method Detail |
|---|
public Resource getMetaData(String path)
throws RegistryException
Registry
getMetaData in interface org.wso2.carbon.registry.api.RegistrygetMetaData in class UserRegistrypath - Path of the resource. e.g. /project1/server/deployment.xml
RegistryException - is thrown if the resource is not in the registry
public String importResource(String suggestedPath,
String sourceURL,
Resource resource)
throws RegistryException
Registry
importResource in class UserRegistrysuggestedPath - 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 contentresource - a template Resource
RegistryException - if we couldn't get or store the new resource
public String rename(String currentPath,
String newName)
throws RegistryException
Registry
rename in interface org.wso2.carbon.registry.api.Registryrename in class UserRegistrycurrentPath - current path of the resourcenewName - the name of the new resource
RegistryException - if something went wrong
public String move(String currentPath,
String newPath)
throws RegistryException
Registry
move in interface org.wso2.carbon.registry.api.Registrymove in class UserRegistrycurrentPath - current path of the resourcenewPath - where we'd like to move the resource
RegistryException - if something went wrong
public String copy(String sourcePath,
String targetPath)
throws RegistryException
Registry
copy in interface org.wso2.carbon.registry.api.Registrycopy in class UserRegistrysourcePath - current path of the resourcetargetPath - where we'd like to copy the resource
RegistryException - if something went wrong
public void createVersion(String path)
throws RegistryException
Registry
createVersion in interface org.wso2.carbon.registry.api.RegistrycreateVersion in class UserRegistrypath - the resource path.
RegistryException - if something went wrong.
public String[] getVersions(String path)
throws RegistryException
Registry
getVersions in interface org.wso2.carbon.registry.api.RegistrygetVersions in class UserRegistrypath - path of a current version of a resource
RegistryException - if there is an error
public void restoreVersion(String versionPath)
throws RegistryException
Registry
restoreVersion in interface org.wso2.carbon.registry.api.RegistryrestoreVersion in class UserRegistryversionPath - 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.
RegistryException - if there is an error
public void addAssociation(String sourcePath,
String targetPath,
String associationType)
throws RegistryException
Registry
addAssociation in interface org.wso2.carbon.registry.api.RegistryaddAssociation in class UserRegistrysourcePath - Path of the source resourcetargetPath - Path of the target resourceassociationType - Type of the association
RegistryException - Depends on the implementation
public void removeAssociation(String sourcePath,
String targetPath,
String associationType)
throws RegistryException
Registry
removeAssociation in interface org.wso2.carbon.registry.api.RegistryremoveAssociation in class UserRegistrysourcePath - Path of the source resourcetargetPath - Path of the target resourceassociationType - Type of the association
RegistryException - Depends on the implementation
public Association[] getAllAssociations(String resourcePath)
throws RegistryException
Registry
getAllAssociations in interface org.wso2.carbon.registry.api.RegistrygetAllAssociations in class UserRegistryresourcePath - Path of the resource to analyse associations.
RegistryException - If something went wrong
public Association[] getAssociations(String resourcePath,
String associationType)
throws RegistryException
Registry
getAssociations in interface org.wso2.carbon.registry.api.RegistrygetAssociations in class UserRegistryresourcePath - Path of the resource to analyse associations.associationType - Type of the association , that could be dependency, or some other
type.
RegistryException - If something went wrong
public void applyTag(String resourcePath,
String tag)
throws RegistryException
Registry
applyTag in interface org.wso2.carbon.registry.api.RegistryapplyTag in class UserRegistryresourcePath - Path of the resource to be tagged.tag - Tag. Any string can be used for the tag.
RegistryException - is thrown if a resource does not exist in the given path.
public TaggedResourcePath[] getResourcePathsWithTag(String tag)
throws RegistryException
Registry
getResourcePathsWithTag in interface org.wso2.carbon.registry.api.RegistrygetResourcePathsWithTag in class UserRegistrytag - the tag to search for
RegistryException - if an error occurs
public Tag[] getTags(String resourcePath)
throws RegistryException
Registry
getTags in interface org.wso2.carbon.registry.api.RegistrygetTags in class UserRegistryresourcePath - Path of the resource
RegistryException - is thrown if a resource does not exist in the given path.
public void removeTag(String path,
String tag)
throws RegistryException
Registry
removeTag in interface org.wso2.carbon.registry.api.RegistryremoveTag in class UserRegistrypath - Resource path tagged with the given tag.tag - Name of the tag to be removed.
RegistryException - if there's a problem
public String addComment(String resourcePath,
Comment comment)
throws RegistryException
Registry
addComment in class UserRegistryresourcePath - Path of the resource to add the comment.comment - Comment instance for the new comment.
RegistryException - is thrown if a resource does not exist in the given path.
public void editComment(String commentPath,
String text)
throws RegistryException
Registry
editComment in interface org.wso2.carbon.registry.api.RegistryeditComment in class UserRegistrycommentPath - path to comment resource ("..foo/r1;comment:1")text - new text for the comment.
RegistryException - Registry implementations may handle exceptions and throw
RegistryException if the exception has to be propagated to the
client.
public void removeComment(String commentPath)
throws RegistryException
Registry
removeComment in interface org.wso2.carbon.registry.api.RegistryremoveComment in class UserRegistrycommentPath - path to comment resource ("..foo/r1;comment:1")
RegistryException - Registry implementations may handle exceptions and throw
RegistryException if the exception has to be propagated to the
client.
public Comment[] getComments(String resourcePath)
throws RegistryException
Registry
getComments in interface org.wso2.carbon.registry.api.RegistrygetComments in class UserRegistryresourcePath - path of the resource.
RegistryException - Registry implementations may handle exceptions and throw
RegistryException if the exception has to be propagated to the
client.
public void rateResource(String resourcePath,
int rating)
throws RegistryException
Registry
rateResource in interface org.wso2.carbon.registry.api.RegistryrateResource in class UserRegistryresourcePath - Path of the resource.rating - Rating value between 1 and 5.
RegistryException - Registry implementations may handle exceptions and throw
RegistryException if the exception has to be propagated to the
client.
public float getAverageRating(String resourcePath)
throws RegistryException
Registry
getAverageRating in interface org.wso2.carbon.registry.api.RegistrygetAverageRating in class UserRegistryresourcePath - Path of the resource.
RegistryException - if an error occurs
public int getRating(String path,
String userName)
throws RegistryException
Registry
getRating in interface org.wso2.carbon.registry.api.RegistrygetRating in class UserRegistrypath - Path of the resourceuserName - username of the user
RegistryException - if there is a problem
public Collection executeQuery(String path,
Map parameters)
throws RegistryException
Registry
executeQuery in interface org.wso2.carbon.registry.api.RegistryexecuteQuery in class UserRegistrypath - Path of the query to execute.parameters - a Map of query parameters (name -> value)
RegistryException - depends on the implementation.public String[] getAvailableAspects()
Registry
getAvailableAspects in interface org.wso2.carbon.registry.api.RegistrygetAvailableAspects in class UserRegistry
public void associateAspect(String resourcePath,
String aspect)
throws RegistryException
Registry
associateAspect in interface org.wso2.carbon.registry.api.RegistryassociateAspect in class UserRegistryresourcePath - Path of the resourceaspect - Name of the aspect
RegistryException - If some thing went wrong while doing associating the phase
public void invokeAspect(String resourcePath,
String aspectName,
String action)
throws RegistryException
Registry
invokeAspect in interface org.wso2.carbon.registry.api.RegistryinvokeAspect in class UserRegistryresourcePath - Path of the resourceaspectName - Name of the aspectaction - Which action was selected - actions are aspect-specific
RegistryException - if the Aspect isn't associated with the Resource, or the action
isn't valid, or an Aspect-specific problem occurs.
public String[] getAspectActions(String resourcePath,
String aspectName)
throws RegistryException
Registry
getAspectActions in interface org.wso2.carbon.registry.api.RegistrygetAspectActions in class UserRegistryresourcePath - path of the ResourceaspectName - name of the Aspect to query for available actions
RegistryException - if the Aspect isn't associated or an Aspect-specific problem
occurs
public Collection searchContent(String keywords)
throws RegistryException
Registry
searchContent in interface org.wso2.carbon.registry.api.RegistrysearchContent in class UserRegistrykeywords - keywords to look for
RegistryException - throws if the operation fail
public void createLink(String path,
String target)
throws RegistryException
Registry
createLink in interface org.wso2.carbon.registry.api.RegistrycreateLink in class UserRegistrypath - the mount pathtarget - the point to be mounted
RegistryException - throws if the operation fail
public void createLink(String path,
String target,
String subTargetPath)
throws RegistryException
Registry
createLink in interface org.wso2.carbon.registry.api.RegistrycreateLink in class UserRegistrypath - the mount pathtarget - the point to be mountedsubTargetPath - sub path in the remote instance to be mounted
RegistryException - throws if the operation fail
public void removeLink(String path)
throws RegistryException
Registry
removeLink in interface org.wso2.carbon.registry.api.RegistryremoveLink in class UserRegistrypath - the mount path
RegistryException - throws if the operation fail
public void restore(String path,
Reader reader)
throws RegistryException
Registry
restore in interface org.wso2.carbon.registry.api.Registryrestore in class UserRegistrypath - path to check inreader - reader containing resource
RegistryException - throws if the operation fail
public void dump(String path,
Writer writer)
throws RegistryException
Registry
dump in interface org.wso2.carbon.registry.api.Registrydump in class UserRegistrypath - path to check outwriter - writer to write the response
RegistryException - throws if the operation fail
public String getEventingServiceURL(String path)
throws RegistryException
Registry
getEventingServiceURL in interface org.wso2.carbon.registry.api.RegistrygetEventingServiceURL in class UserRegistrypath - the path to which the WS-Eventing Service URL is required
RegistryException - throws if the operation fail
public void setEventingServiceURL(String path,
String eventingServiceURL)
throws RegistryException
Registry
setEventingServiceURL in interface org.wso2.carbon.registry.api.RegistrysetEventingServiceURL in class UserRegistrypath - the path to which the WS-Eventing Service URL is associatedeventingServiceURL - the URL of the WS-Eventing Service
RegistryException - throws if the operation fail
public Resource newResource()
throws RegistryException
CoreRegistry
newResource in interface org.wso2.carbon.registry.api.CoreRegistrynewResource in class UserRegistryRegistryException - if the operation failed.
public Collection newCollection()
throws RegistryException
CoreRegistry
newCollection in interface org.wso2.carbon.registry.api.CoreRegistrynewCollection in class UserRegistryRegistryException - if the operation failed.
public Resource get(String path)
throws RegistryException
CoreRegistry
get in interface org.wso2.carbon.registry.api.CoreRegistryget in class UserRegistrypath - Path of the resource. e.g. /project1/server/deployment.xml
RegistryException - is thrown if the resource is not in the registry
public Collection get(String path,
int start,
int pageSize)
throws RegistryException
CoreRegistry
get in interface org.wso2.carbon.registry.api.CoreRegistryget in class UserRegistrypath - 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
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.
public boolean resourceExists(String path)
throws RegistryException
CoreRegistry
resourceExists in interface org.wso2.carbon.registry.api.CoreRegistryresourceExists in class UserRegistrypath - Path of the resource to be checked
RegistryException - if an error occurs
public void delete(String path)
throws RegistryException
CoreRegistry
delete in interface org.wso2.carbon.registry.api.CoreRegistrydelete in class UserRegistrypath - Path of the resource to be deleted.
RegistryException - is thrown depending on the implementation.
public String put(String suggestedPath,
Resource resource)
throws RegistryException
CoreRegistry
put in class UserRegistrysuggestedPath - the path which we'd like to use for the new resource.resource - Resource instance for the new resource
RegistryException - is thrown depending on the implementation.
public String put(String suggestedPath,
org.wso2.carbon.registry.api.Resource resource)
throws org.wso2.carbon.registry.api.RegistryException
put in interface org.wso2.carbon.registry.api.CoreRegistryput in class UserRegistryorg.wso2.carbon.registry.api.RegistryException
public void beginTransaction()
throws RegistryException
TransactionManager
beginTransaction in interface TransactionManagerbeginTransaction in class UserRegistryRegistryException - If an error occurs while starting a transaction
public void commitTransaction()
throws RegistryException
TransactionManager
commitTransaction in interface TransactionManagercommitTransaction in class UserRegistryRegistryException - If an error occurs while committing a transaction
public void rollbackTransaction()
throws RegistryException
TransactionManager
rollbackTransaction in interface TransactionManagerrollbackTransaction in class UserRegistryRegistryException - If an error occurs while rolling back a transaction
public String addComment(String resourcePath,
org.wso2.carbon.registry.api.Comment comment)
throws org.wso2.carbon.registry.api.RegistryException
addComment in interface org.wso2.carbon.registry.api.RegistryaddComment in class UserRegistryorg.wso2.carbon.registry.api.RegistryException
public String importResource(String suggestedPath,
String sourceURL,
org.wso2.carbon.registry.api.Resource resource)
throws org.wso2.carbon.registry.api.RegistryException
importResource in interface org.wso2.carbon.registry.api.RegistryimportResource in class UserRegistryorg.wso2.carbon.registry.api.RegistryException
public LogEntry[] getLogs(String resourcePath,
int action,
String userName,
Date from,
Date to,
boolean recentFirst)
throws RegistryException
Registry
getLogs in interface org.wso2.carbon.registry.api.RegistrygetLogs in class UserRegistryresourcePath - 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.
RegistryException - if there is a problemAccepted values for action parameter
@Deprecated
public LogEntryCollection getLogCollection(String resourcePath,
int action,
String userName,
Date from,
Date to,
boolean recentFirst)
throws RegistryException
Registry
getLogCollection in class UserRegistryresourcePath - 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.
RegistryException - if there is a problemAccepted values for action parameter
public void invokeAspect(String resourcePath,
String aspectName,
String action,
Map<String,String> parameters)
throws RegistryException
Registry
invokeAspect in class UserRegistryresourcePath - Path of the resourceaspectName - Name of the aspectaction - Which action was selected - actions are aspect-specificparameters - Parameters to be used for the operation
RegistryException - if the Aspect isn't associated with the Resource, or the action
isn't valid, or an Aspect-specific problem occurs.
public boolean removeAspect(String aspect)
throws RegistryException
Registry
removeAspect in class UserRegistryaspect - the name of the aspect to be removed
RegistryException - throws if the operation fail
public boolean addAspect(String name,
Aspect aspect)
throws RegistryException
Registry
addAspect in class UserRegistryname - the name of the aspect to be addedaspect - the name of the aspect object to be added to registry context
RegistryException - throws if the operation fail
public boolean removeVersionHistory(String path,
long snapshotId)
throws RegistryException
Registry
removeVersionHistory in class UserRegistrypath - the path of the resource
RegistryException - throws if the operation fails.public RegistryContext getRegistryContext()
Registry
getRegistryContext in class UserRegistry
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||