public abstract class GovernanceArtifactImpl extends Object implements GovernanceArtifact
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,List<String>> |
attributes
Map of attributes associated with this governance artifact.
|
protected Map<String,List<String>> |
properties
Map of properties associated with this governance artifact.
|
| Modifier | Constructor and Description |
|---|---|
|
GovernanceArtifactImpl()
Construct a governance artifact.
|
protected |
GovernanceArtifactImpl(GovernanceArtifactImpl artifact)
Copy constructor used for cloning.
|
protected |
GovernanceArtifactImpl(GovernanceArtifactImpl artifact,
List<String> uniqueAttributes) |
|
GovernanceArtifactImpl(String id)
Construct a governance artifact object from the path and the id.
|
|
GovernanceArtifactImpl(String id,
org.apache.axiom.om.OMElement contentElement)
Constructor accepting resource identifier and the XML content.
|
|
GovernanceArtifactImpl(String id,
org.apache.axiom.om.OMElement contentElement,
List<String> uniqueAttributes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addAssociation(String associationType,
GovernanceArtifact attachedToArtifact) |
void |
addAssociation(String associationType,
String artifactId) |
void |
addAttribute(String key,
String value)
Adding an attribute to the artifact.
|
void |
addBidirectionalAssociation(String forwardType,
String backwardType,
GovernanceArtifact attachedToArtifact) |
void |
addTag(String tag) |
void |
addTags(List<String> tags) |
void |
associateRegistry(org.wso2.carbon.registry.core.Registry registry)
Associate a registry, this is mostly used by the artifact manager when creating the
artifact.
|
void |
attach(GovernanceArtifact attachedToArtifact)
Attach the current artifact to an another artifact.
|
void |
attach(String artifactId) |
void |
attachLifecycle(String name)
Associates the named lifecycle with the artifact
|
void |
checkLCItem(int order,
String aspectName)
Check the checklist item
|
protected void |
checkRegistryResourceAssociation()
Validate the resource is associated with a registry
|
boolean |
compareTo(GovernanceArtifact artifact) |
static GovernanceArtifactImpl |
create(org.wso2.carbon.registry.core.Registry registry,
String artifactId) |
static GovernanceArtifactImpl |
create(org.wso2.carbon.registry.core.Registry registry,
String artifactId,
List<String> uniqueAttributes) |
static GovernanceArtifactImpl |
create(org.wso2.carbon.registry.core.Registry registry,
String artifactId,
org.apache.axiom.om.OMElement content) |
static GovernanceArtifactImpl |
create(org.wso2.carbon.registry.core.Registry registry,
String artifactId,
org.apache.axiom.om.OMElement content,
List<String> uniqueAttributes) |
void |
createVersion()
Create a version of the artifact.
|
void |
detach(String artifactId)
Detach the current artifact from the provided artifact.
|
void |
detachLifecycle(String lifecycleName)
De-associate lifecycle associated with the artifact
|
boolean |
equals(Object artifact) |
String[] |
getAllCheckListItemNames(String aspectName)
Retrieve name set of the checklist items
|
String[] |
getAllLifecycleActions(String lifeCycleName)
Get all lifecycle actions for the current state of the lifecycle
|
String[] |
getAllVotingItems()
Retrieve action set which need votes.
|
String[] |
getAllVotingItems(String aspectName)
Retrieve action set which need votes.
|
String |
getArtifactPath() |
Map<String,List<String>> |
getAssociatedArtifactIds() |
protected org.wso2.carbon.registry.core.Registry |
getAssociatedRegistry()
Returns the associated registry to the artifact.
|
Map<String,List<GovernanceArtifact>> |
getAssociations() |
String |
getAttribute(String key)
Returns the attribute of a given key.
|
String[] |
getAttributeKeys()
Returns the available attribute keys
|
String[] |
getAttributes(String key)
Returns the attribute values for a key.
|
Map<String,String> |
getCurrentStateDuration(String artifactID,
String lcName)
This method is used to get a lifecycle's current state duration information.
|
GovernanceArtifact[] |
getDependencies()
Get dependencies of an artifacts.
|
GovernanceArtifact[] |
getDependents()
Get dependents of an artifact.
|
String |
getId()
Returns the id of the artifact
|
String |
getLcName() |
String |
getLcState() |
String |
getLifecycleName()
Returns the name of the lifecycle associated with this artifact.
|
String[] |
getLifecycleNames()
Returns the name of the lifecycle associated with this artifact.
|
String |
getLifecycleState()
Returns the state of the lifecycle associated with this artifact.
|
String |
getLifecycleState(String lifeCycleName)
Returns the state of the lifecycle associated with this artifact.
|
String |
getMediaType()
Returns the media type of the artifact.
|
String |
getPath()
Returns the path of the artifact, need to save the artifact before
getting the path.
|
String[] |
getPropertyKeys()
Returns the available attribute keys
|
List<String> |
getUniqueAttributes() |
void |
invokeAction(String action,
Map<String,String> parameters,
String aspectName)
Invoke lifecycle action
|
void |
invokeAction(String action,
String aspectName)
Invoke lifecycle action
|
boolean |
isLCItemChecked(int order,
String aspectName)
Check whether the given ordered lifecycle checklist item is checked or not
|
boolean |
isRegistryAwareArtifact() |
boolean |
isVoted(int order)
Check whether the current user voted for given order event.
|
boolean |
isVoted(int order,
String aspectName)
Check whether the current user voted for given order event
|
List<String> |
listTags() |
void |
removeAssociation(String artifactId) |
void |
removeAssociation(String associationType,
String artifactId) |
void |
removeAttribute(String key)
Remove attribute with the given key.
|
void |
removeTag(String tag) |
void |
removeTags(List<String> tags) |
void |
setArtifactPath(String artifactPath) |
void |
setAttribute(String key,
String newValue)
Set/Update an attribute with a single value.
|
void |
setAttributes(String key,
String[] newValues)
Set/Update an attribute with multiple values.
|
void |
setId(String id)
Set the id
|
void |
setLcName(String lcName) |
void |
setLcState(String lcState) |
void |
setUniqueAttributes(List<String> uniqueAttributes) |
String |
toString() |
void |
uncheckLCItem(int order,
String aspectName)
Un-check the checklist item
|
boolean |
uniqueTo(GovernanceArtifact artifact) |
void |
unvote(int order)
Unvote for an action.
|
void |
unvote(int order,
String aspectName)
Unvote for an action
|
void |
updatePath()
update the path after moving the resource.
|
void |
updatePath(String artifactId)
update the path after moving the resource.
|
void |
vote(int order)
Vote for an action.
|
void |
vote(int order,
String aspectName)
Vote for an action.
|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetQName, setQNameprotected Map<String,List<String>> attributes
public GovernanceArtifactImpl(String id)
id - the idpublic GovernanceArtifactImpl()
protected GovernanceArtifactImpl(GovernanceArtifactImpl artifact)
artifact - the object to be copied.protected GovernanceArtifactImpl(GovernanceArtifactImpl artifact, List<String> uniqueAttributes)
public GovernanceArtifactImpl(String id, org.apache.axiom.om.OMElement contentElement) throws GovernanceException
id - the resource identifier.contentElement - an XML element containing the content.GovernanceException - if the construction fails.public GovernanceArtifactImpl(String id, org.apache.axiom.om.OMElement contentElement, List<String> uniqueAttributes) throws GovernanceException
GovernanceExceptionpublic String getLcName()
public void setLcName(String lcName)
public String getLcState()
public void setLcState(String lcState)
public String getArtifactPath()
public void setArtifactPath(String artifactPath)
public static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry, String artifactId) throws GovernanceException
GovernanceExceptionpublic static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry, String artifactId, org.apache.axiom.om.OMElement content) throws GovernanceException
GovernanceExceptionpublic static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry, String artifactId, List<String> uniqueAttributes) throws GovernanceException
GovernanceExceptionpublic static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry, String artifactId, org.apache.axiom.om.OMElement content, List<String> uniqueAttributes) throws GovernanceException
GovernanceExceptionpublic String getId()
getId in interface GovernanceArtifactpublic void setId(String id)
setId in interface GovernanceArtifactid - the idpublic String getPath() throws GovernanceException
getPath in interface GovernanceArtifactGovernanceException - if an error occurred.public String getMediaType()
GovernanceArtifactgetMediaType in interface GovernanceArtifactpublic String getLifecycleName() throws GovernanceException
getLifecycleName in interface GovernanceArtifactGovernanceException - if an error occurred.public String[] getLifecycleNames() throws GovernanceException
getLifecycleNames in interface GovernanceArtifactGovernanceException - if an error occurred.public void attachLifecycle(String name) throws GovernanceException
attachLifecycle in interface GovernanceArtifactname - the name of the lifecycle to be associated with this artifact.GovernanceException - if an error occurred.public void detachLifecycle(String lifecycleName) throws GovernanceException
GovernanceException - if an error occurred.public String getLifecycleState() throws GovernanceException
getLifecycleState in interface GovernanceArtifactGovernanceException - if an error occurred.public String getLifecycleState(String lifeCycleName) throws GovernanceException
getLifecycleState in interface GovernanceArtifactlifeCycleName - the name of the lifecycle of which the state is requiredGovernanceException - if an error occurred.public void updatePath()
throws GovernanceException
GovernanceException - if an error occurred.public void updatePath(String artifactId) throws GovernanceException
artifactId - id of the artifactGovernanceException - if an error occurred.public void createVersion()
throws GovernanceException
GovernanceException - throws if the operation failed.public void associateRegistry(org.wso2.carbon.registry.core.Registry registry)
throws GovernanceException
registry - the registry.GovernanceException - throws if the operation failed.public void addAttribute(String key, String value) throws GovernanceException
addAttribute in interface GovernanceArtifactkey - the key.value - the value.GovernanceException - throws if the operation failed.public void setAttributes(String key, String[] newValues) throws GovernanceException
setAttributes in interface GovernanceArtifactkey - the keynewValues - the valueGovernanceException - throws if the operation failed.public void setAttribute(String key, String newValue) throws GovernanceException
setAttribute in interface GovernanceArtifactkey - the keynewValue - the valueGovernanceException - throws if the operation failed.public String getAttribute(String key) throws GovernanceException
getAttribute in interface GovernanceArtifactkey - the keyGovernanceException - throws if the operation failed.public String[] getAttributeKeys() throws GovernanceException
getAttributeKeys in interface GovernanceArtifactGovernanceException - throws if the operation failed.public String[] getAttributes(String key) throws GovernanceException
getAttributes in interface GovernanceArtifactkey - the key.GovernanceException - throws if the operation failed.public void removeAttribute(String key) throws GovernanceException
removeAttribute in interface GovernanceArtifactkey - the keyGovernanceException - throws if the operation failed.public GovernanceArtifact[] getDependencies() throws GovernanceException
getDependencies in interface GovernanceArtifactGovernanceException - throws if the operation failed.public GovernanceArtifact[] getDependents() throws GovernanceException
getDependents in interface GovernanceArtifactGovernanceException - throws if the operation failed.public String[] getAllLifecycleActions(String lifeCycleName) throws GovernanceException
getAllLifecycleActions in interface GovernanceArtifactlifeCycleName - lifecycle name of which actions are neededGovernanceException - throws if the operation failed.public void invokeAction(String action, String aspectName) throws GovernanceException
invokeAction in interface GovernanceArtifactaction - lifecycle action tobe invokedaspectName - aspect name of which the action need to be invokedGovernanceException - throws if the operation failed.public void invokeAction(String action, Map<String,String> parameters, String aspectName) throws GovernanceException
invokeAction in interface GovernanceArtifactaction - lifecycle action tobe invokedparameters - extra parameters needed when promotingaspectName - aspect name of which the action need to be invokedGovernanceException - throws if the operation failed.public String[] getAllCheckListItemNames(String aspectName) throws GovernanceException
getAllCheckListItemNames in interface GovernanceArtifactaspectName - lifecycle name of which action to be invokedGovernanceException - throws if the operation failed.public void checkLCItem(int order,
String aspectName)
throws GovernanceException
checkLCItem in interface GovernanceArtifactaspectName - lifecycle name of which action to be invokedorder - order of the checklist item need to checkedGovernanceException - throws if the operation failed.public boolean isLCItemChecked(int order,
String aspectName)
throws GovernanceException
isLCItemChecked in interface GovernanceArtifactorder - order of the checklist item need to uncheckedaspectName - lifecycle name of which action to be invokedGovernanceException - throws if the operation failed.public void uncheckLCItem(int order,
String aspectName)
throws GovernanceException
uncheckLCItem in interface GovernanceArtifactorder - order of the checklist item need to uncheckedaspectName - lifecycle name of which action to be invokedGovernanceException - throws if the operation failed.public String[] getAllVotingItems(String aspectName) throws GovernanceException
getAllVotingItems in interface GovernanceArtifactaspectName - Lifecycle nameGovernanceException - throws if the operation failed.public String[] getAllVotingItems() throws GovernanceException
getAllVotingItems in interface GovernanceArtifactGovernanceException - throws if the operation failed.public void vote(int order,
String aspectName)
throws GovernanceException
vote in interface GovernanceArtifactorder - order of the action which need to be votedaspectName - Lifecycle nameGovernanceException - throws if the operation failed.public void vote(int order)
throws GovernanceException
vote in interface GovernanceArtifactorder - order of the action which need to be votedGovernanceException - throws if the operation failed.public boolean isVoted(int order,
String aspectName)
throws GovernanceException
isVoted in interface GovernanceArtifactorder - order of the action which need to be votedaspectName - Lifecycle nameGovernanceException - throws if the operation failed.public boolean isVoted(int order)
throws GovernanceException
isVoted in interface GovernanceArtifactorder - order of the action which need to be votedGovernanceException - throws if the operation failed.public void unvote(int order,
String aspectName)
throws GovernanceException
unvote in interface GovernanceArtifactorder - order of the action which need to be unvotedaspectName - Lifecycle nameGovernanceException - throws if the operation failed.public void unvote(int order)
throws GovernanceException
unvote in interface GovernanceArtifactorder - order of the action which need to be un votedGovernanceException - throws if the operation failed.public void attach(GovernanceArtifact attachedToArtifact) throws GovernanceException
attach in interface GovernanceArtifactattachedToArtifact - the artifact the current artifact is attached toGovernanceException - throws if the operation failed.public void detach(String artifactId) throws GovernanceException
detach in interface GovernanceArtifactartifactId - the artifact id of the attached artifactGovernanceException - throws if the operation failed.protected void checkRegistryResourceAssociation()
throws GovernanceException
GovernanceException - if the resource is not associated with a registry.protected org.wso2.carbon.registry.core.Registry getAssociatedRegistry()
public String[] getPropertyKeys() throws GovernanceException
getPropertyKeys in interface GovernanceArtifactGovernanceException - throws if the operation failed.public void attach(String artifactId) throws GovernanceException
attach in interface GovernanceArtifactGovernanceExceptionpublic void addAssociation(String associationType, GovernanceArtifact attachedToArtifact) throws GovernanceException
addAssociation in interface GovernanceArtifactGovernanceExceptionpublic void addAssociation(String associationType, String artifactId) throws GovernanceException
addAssociation in interface GovernanceArtifactGovernanceExceptionpublic void addBidirectionalAssociation(String forwardType, String backwardType, GovernanceArtifact attachedToArtifact) throws GovernanceException
addBidirectionalAssociation in interface GovernanceArtifactGovernanceExceptionpublic void removeAssociation(String associationType, String artifactId) throws GovernanceException
removeAssociation in interface GovernanceArtifactGovernanceExceptionpublic void removeAssociation(String artifactId) throws GovernanceException
removeAssociation in interface GovernanceArtifactGovernanceExceptionpublic Map<String,List<GovernanceArtifact>> getAssociations() throws GovernanceException
getAssociations in interface GovernanceArtifactGovernanceExceptionpublic Map<String,List<String>> getAssociatedArtifactIds() throws GovernanceException
getAssociatedArtifactIds in interface GovernanceArtifactGovernanceExceptionpublic boolean isRegistryAwareArtifact()
isRegistryAwareArtifact in interface GovernanceArtifactpublic void addTag(String tag) throws GovernanceException
addTag in interface GovernanceArtifactGovernanceExceptionpublic void addTags(List<String> tags) throws GovernanceException
addTags in interface GovernanceArtifactGovernanceExceptionpublic List<String> listTags() throws GovernanceException
listTags in interface GovernanceArtifactGovernanceExceptionpublic void removeTag(String tag) throws GovernanceException
removeTag in interface GovernanceArtifactGovernanceExceptionpublic void removeTags(List<String> tags) throws GovernanceException
removeTags in interface GovernanceArtifactGovernanceExceptionpublic boolean uniqueTo(GovernanceArtifact artifact)
uniqueTo in interface GovernanceArtifactpublic boolean compareTo(GovernanceArtifact artifact)
compareTo in interface GovernanceArtifactpublic Map<String,String> getCurrentStateDuration(String artifactID, String lcName) throws GovernanceException
getCurrentStateDuration in interface GovernanceArtifactartifactID - lifecycle associated artifacts id.lcName - lifecycle name.GovernanceExceptionCopyright © 2017 WSO2. All Rights Reserved.