public class GenericArtifactManager extends Object
Constructor and Description |
---|
GenericArtifactManager(org.wso2.carbon.registry.core.Registry registry,
String key)
Constructor accepting an instance of the registry, and key identifying the type of manager.
|
GenericArtifactManager(org.wso2.carbon.registry.core.Registry registry,
String mediaType,
String artifactNameAttribute,
String artifactNamespaceAttribute,
String artifactElementRoot,
String artifactElementNamespace,
String pathExpression,
org.wso2.carbon.registry.core.Association[] relationshipDefinitions)
Constructor accepting an instance of the registry, and also details on the type of manager.
|
Modifier and Type | Method and Description |
---|---|
void |
addGenericArtifact(GenericArtifact artifact)
Adds the given artifact to the registry.
|
GenericArtifact[] |
findGenericArtifacts(GenericArtifactFilter criteria)
Finds all artifacts matching the given filter criteria.
|
GenericArtifact[] |
findGenericArtifacts(Map<String,List<String>> criteria)
Finds all artifacts matching the given filter criteria.
|
GenericArtifact[] |
findGovernanceArtifacts(String query)
Finds and returns GenericArtifact instances matching the search query
|
String[] |
getAllGenericArtifactIds()
Finds all identifiers of the artifacts on the registry.
|
GenericArtifact[] |
getAllGenericArtifacts()
Finds all artifacts on the registry.
|
GenericArtifact[] |
getAllGenericArtifactsByLifecycle(String lcName)
Retrieve all the generic artifacts which associated with the given lifecycle
|
GenericArtifact[] |
getAllGenericArtifactsByLifecycleStatus(String lcName,
String lcState)
Retrieve all the generic artifacts which associated with the given lifecycle in the given lifecycle state
|
GenericArtifact |
getGenericArtifact(String artifactId)
Fetches the given artifact on the registry.
|
org.wso2.carbon.registry.common.TermData[] |
getTermData(Map<String,List<String>> criteria,
String facetField,
boolean authRequired)
Find all possible terms and its count for the given facet field and query criteria
|
boolean |
isExists(GovernanceArtifact artifact)
Check whether GovernanceArtifact is exists in the Registry without loading whole artifact into memory.
|
static GenericArtifact |
newDetachedGovernanceArtifact(QName artifactName,
String mediaType) |
GenericArtifact |
newGovernanceArtifact(org.apache.axiom.om.OMElement content)
Creates a new artifact from the given content.
|
GenericArtifact |
newGovernanceArtifact(QName qName)
Creates a new artifact from the given qualified name.
|
GenericArtifact |
newGovernanceArtifact(QName qName,
byte[] content)
Creates a new artifact from the given qualified name.
|
GenericArtifact |
newGovernanceArtifact(String omContent)
Creates a new artifact from the given string content.
|
void |
removeGenericArtifact(GenericArtifact artifact) |
void |
removeGenericArtifact(String artifactId)
Removes the given artifact from the registry.
|
void |
updateGenericArtifact(GenericArtifact artifact)
Updates the given artifact on the registry.
|
public GenericArtifactManager(org.wso2.carbon.registry.core.Registry registry, String mediaType, String artifactNameAttribute, String artifactNamespaceAttribute, String artifactElementRoot, String artifactElementNamespace, String pathExpression, org.wso2.carbon.registry.core.Association[] relationshipDefinitions)
registry
- the instance of the registry.mediaType
- the media type of resources being saved or fetched.artifactNameAttribute
- the attribute that specifies the name of the artifact.artifactNamespaceAttribute
- the attribute that specifies the namespace of the artifact.artifactElementRoot
- the attribute that specifies the root artifact element.artifactElementNamespace
- the attribute that specifies the artifact element's
namespace.pathExpression
- the expression that can be used to compute where to store
the artifact.relationshipDefinitions
- the relationship definitions for the types of associations
that will be created when the artifact gets updated.public GenericArtifactManager(org.wso2.carbon.registry.core.Registry registry, String key) throws org.wso2.carbon.registry.core.exceptions.RegistryException
registry
- the instance of the registry.key
- the key short name of the artifact type.org.wso2.carbon.registry.core.exceptions.RegistryException
- Thrown when rxt configuration is not in registry.public GenericArtifact newGovernanceArtifact(QName qName) throws GovernanceException
qName
- the qualified name of this artifact.GovernanceException
- if the operation failed.public GenericArtifact newGovernanceArtifact(QName qName, byte[] content) throws GovernanceException
qName
- the qualified name of this artifact.GovernanceException
- if the operation failed.public GenericArtifact newGovernanceArtifact(org.apache.axiom.om.OMElement content) throws GovernanceException
content
- the artifact content.GovernanceException
- if the operation failed.public GenericArtifact newGovernanceArtifact(String omContent) throws GovernanceException
omContent
- the artifact content in stringGovernanceException
- if the operation failed.public void addGenericArtifact(GenericArtifact artifact) throws GovernanceException
artifact
- the artifact.GovernanceException
- if the operation failed.public void updateGenericArtifact(GenericArtifact artifact) throws GovernanceException
artifact
- the artifact.GovernanceException
- if the operation failed.public GenericArtifact getGenericArtifact(String artifactId) throws GovernanceException
artifactId
- the identifier of the artifact.GovernanceException
- if the operation failed.public void removeGenericArtifact(String artifactId) throws GovernanceException
artifactId
- the identifier of the artifact.GovernanceException
- if the operation failed.public GenericArtifact[] findGenericArtifacts(Map<String,List<String>> criteria) throws GovernanceException
criteria
- the filter criteria to be matched.GovernanceException
- if the operation failed.public org.wso2.carbon.registry.common.TermData[] getTermData(Map<String,List<String>> criteria, String facetField, boolean authRequired) throws GovernanceException
criteria
- the filter criteria to be matchedfacetField
- field used for facetingauthRequired
- authorization required flagGovernanceException
public GenericArtifact[] findGovernanceArtifacts(String query) throws GovernanceException
query
- The query string that needs to be searched forGovernanceException
- if the operation failedpublic GenericArtifact[] findGenericArtifacts(GenericArtifactFilter criteria) throws GovernanceException
criteria
- the filter criteria to be matched.GovernanceException
- if the operation failed.public GenericArtifact[] getAllGenericArtifacts() throws GovernanceException
GovernanceException
- if the operation failed.public GenericArtifact[] getAllGenericArtifactsByLifecycle(String lcName) throws GovernanceException
lcName
- Name of the lifecycleGovernanceException
public GenericArtifact[] getAllGenericArtifactsByLifecycleStatus(String lcName, String lcState) throws GovernanceException
lcName
- Name of the lifecyclelcState
- Name of the current lifecycle stateGovernanceException
public String[] getAllGenericArtifactIds() throws GovernanceException
GovernanceException
- if the operation failed.public static GenericArtifact newDetachedGovernanceArtifact(QName artifactName, String mediaType)
public boolean isExists(GovernanceArtifact artifact) throws GovernanceException
artifact
- GovernanceArtifact to check it's existence.GovernanceException
- if the operation failed.public void removeGenericArtifact(GenericArtifact artifact) throws GovernanceException
GovernanceException
Copyright © 2016 WSO2. All Rights Reserved.