Interface GovernanceArtifact
-
- All Known Subinterfaces:
DetachedGenericArtifact,Endpoint,GenericArtifact,Policy,Schema,Service,Wsdl
- All Known Implementing Classes:
DetachedGenericArtifactImpl,EndpointImpl,GenericArtifactImpl,GovernanceArtifactImpl,PolicyImpl,SchemaImpl,ServiceImpl,WsdlImpl
public interface GovernanceArtifact
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAssociation(String associationType, String artifactId)voidaddAssociation(String associationType, GovernanceArtifact attachedToArtifact)voidaddAttribute(String key, String value)Adding an attribute to the artifact.voidaddBidirectionalAssociation(String forwardType, String backwardType, GovernanceArtifact attachedToArtifact)voidaddTag(String tag)voidaddTags(List<String> tags)voidattach(String artifactId)voidattach(GovernanceArtifact attachedToArtifact)Attach the current artifact to an another artifact.voidattachLifecycle(String name)Associates the named lifecycle with the artifactvoidcheckLCItem(int order, String aspectName)Check the checklist itembooleancompareTo(GovernanceArtifact artifact)voiddetach(String artifactId)Detach the current artifact from the provided artifact.String[]getAllCheckListItemNames(String aspectName)Retrieve name set of the checklist itemsString[]getAllLifecycleActions(String lifeCycleName)Get all lifecycle actions for the current state of the lifecycleString[]getAllVotingItems()Retrieve action set which need votesString[]getAllVotingItems(String aspectName)Retrieve action set which need votesMap<String,List<String>>getAssociatedArtifactIds()Map<String,List<GovernanceArtifact>>getAssociations()StringgetAttribute(String key)Returns the attribute of a given key.String[]getAttributeKeys()Returns the available attribute keysString[]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.StringgetId()Returns the id of the artifactStringgetLifecycleName()Returns the name of the default lifecycle associated with this artifact.String[]getLifecycleNames()Returns the names of the lifecycle associated with this artifact.StringgetLifecycleState()Returns the state of the default lifecycle associated with this artifact.StringgetLifecycleState(String lifeCycleName)Returns the state of the lifecycle associated with this artifact.StringgetMediaType()Returns the media type of the artifact.StringgetPath()Returns the path of the artifact, need to save the artifact before getting the path.String[]getPropertyKeys()Returns the available attribute keysQNamegetQName()Returns the QName of the artifact.voidinvokeAction(String action, String aspectName)Promote the artifact to the next state of the lifecyclevoidinvokeAction(String action, Map<String,String> parameters, String aspectName)Promote the artifact to the next state of the lifecyclebooleanisLCItemChecked(int order, String aspectName)Check whether the given ordered lifecycle checklist item is checked or notbooleanisRegistryAwareArtifact()booleanisVoted(int order)Check whether the current user voted for given order eventbooleanisVoted(int order, String aspectName)Check whether the current user voted for given order eventList<String>listTags()voidremoveAssociation(String artifactId)voidremoveAssociation(String associationType, String artifactId)voidremoveAttribute(String key)Remove attribute with the given key.voidremoveTag(String tag)voidremoveTags(List<String> tags)voidsetAttribute(String key, String newValue)Set/Update an attribute with a single value.voidsetAttributes(String key, String[] newValues)Set/Update an attribute with multiple values.voidsetId(String id)Set the idvoidsetQName(QName qName)Set the QName of the artifact.voiduncheckLCItem(int order, String aspectName)Un-check the checklist itembooleanuniqueTo(GovernanceArtifact artifact)voidunvote(int order)Unvote for an actionvoidunvote(int order, String aspectName)Unvote for an actionvoidvote(int order)Vote for an actionvoidvote(int order, String aspectName)Vote for an action
-
-
-
Method Detail
-
getQName
QName getQName()
Returns the QName of the artifact.- Returns:
- the QName of the artifact
-
setQName
void setQName(QName qName) throws GovernanceException
Set the QName of the artifact.- Parameters:
qName- of the artifact- Throws:
GovernanceException
-
getId
String getId()
Returns the id of the artifact- Returns:
- the id
-
getMediaType
String getMediaType()
Returns the media type of the artifact.- Returns:
- the media type of the artifact
-
setId
void setId(String id)
Set the id- Parameters:
id- the id
-
getPath
String getPath() throws GovernanceException
Returns the path of the artifact, need to save the artifact before getting the path.- Returns:
- here we return the path of the artifact.
- Throws:
GovernanceException- if an error occurred.
-
getLifecycleNames
String[] getLifecycleNames() throws GovernanceException
Returns the names of the lifecycle associated with this artifact.- Returns:
- the names of the lifecycle associated with this artifact as an array
- Throws:
GovernanceException- if an error occurred.
-
getLifecycleName
String getLifecycleName() throws GovernanceException
Returns the name of the default lifecycle associated with this artifact.- Returns:
- the names of the lifecycle associated with this artifact.
- Throws:
GovernanceException- if an error occurred.
-
attachLifecycle
void attachLifecycle(String name) throws GovernanceException
Associates the named lifecycle with the artifact- Parameters:
name- the name of the lifecycle to be associated with this artifact.- Throws:
GovernanceException- if an error occurred.
-
getLifecycleState
String getLifecycleState() throws GovernanceException
Returns the state of the default lifecycle associated with this artifact.- Returns:
- the state of the default lifecycle associated with this artifact.
- Throws:
GovernanceException- if an error occurred.
-
getLifecycleState
String getLifecycleState(String lifeCycleName) throws GovernanceException
Returns the state of the lifecycle associated with this artifact.- Parameters:
lifeCycleName- the name of the lifecycle of which the state is required- Returns:
- the state of the lifecycle associated with this artifact.
- Throws:
GovernanceException- if an error occurred.
-
addAttribute
void addAttribute(String key, String value) throws GovernanceException
Adding an attribute to the artifact. The artifact should be saved to get effect the change. In the case of a single-valued attribute, this method will set or replace the existing attribute with the provided value. In the case of a multi-valued attribute, this method will append the provided value to the existing list.- Parameters:
key- the key.value- the value.- Throws:
GovernanceException- throws if the operation failed.
-
setAttributes
void setAttributes(String key, String[] newValues) throws GovernanceException
Set/Update an attribute with multiple values. The artifact should be saved to get effect the change.- Parameters:
key- the keynewValues- the value- Throws:
GovernanceException- throws if the operation failed.
-
setAttribute
void setAttribute(String key, String newValue) throws GovernanceException
Set/Update an attribute with a single value. The artifact should be saved to get effect the change. This method will replace the existing attribute with the provided value. In the case of a multi-valued attribute this will remove all existing values. If you want to append the provided value to a list values of a multi-valued attribute, use the addAttribute method instead.- Parameters:
key- the keynewValue- the value- Throws:
GovernanceException- throws if the operation failed.
-
getAttribute
String getAttribute(String key) throws GovernanceException
Returns the attribute of a given key.- Parameters:
key- the key- Returns:
- the value of the attribute, if there are more than one attribute for the key this returns the first value.
- Throws:
GovernanceException- throws if the operation failed.
-
getAttributeKeys
String[] getAttributeKeys() throws GovernanceException
Returns the available attribute keys- Returns:
- an array of attribute keys.
- Throws:
GovernanceException- throws if the operation failed.
-
getAttributes
String[] getAttributes(String key) throws GovernanceException
Returns the attribute values for a key.- Parameters:
key- the key.- Returns:
- attribute values for the key.
- Throws:
GovernanceException- throws if the operation failed.
-
removeAttribute
void removeAttribute(String key) throws GovernanceException
Remove attribute with the given key. The artifact should be saved to get effect the change.- Parameters:
key- the key- Throws:
GovernanceException- throws if the operation failed.
-
getDependencies
GovernanceArtifact[] getDependencies() throws GovernanceException
Get dependencies of an artifacts. The artifacts should be saved, before calling this method.- Returns:
- an array of dependencies of this artifact.
- Throws:
GovernanceException- throws if the operation failed.
-
getDependents
GovernanceArtifact[] getDependents() throws GovernanceException
Get dependents of an artifact. The artifacts should be saved, before calling this method.- Returns:
- an array of artifacts that is dependent on this artifact.
- Throws:
GovernanceException- throws if the operation failed.
-
getAllLifecycleActions
String[] getAllLifecycleActions(String lifeCycleName) throws GovernanceException
Get all lifecycle actions for the current state of the lifecycle- Parameters:
lifeCycleName- lifecycle name of which actions are needed- Returns:
- Action set which can be invoked
- Throws:
GovernanceException- throws if the operation failed.
-
invokeAction
void invokeAction(String action, String aspectName) throws GovernanceException
Promote the artifact to the next state of the lifecycle- Parameters:
action- lifecycle action tobe invokedaspectName- lifecycle name of which action to be invoked- Throws:
GovernanceException- throws if the operation failed.
-
invokeAction
void invokeAction(String action, Map<String,String> parameters, String aspectName) throws GovernanceException
Promote the artifact to the next state of the lifecycle- Parameters:
action- lifecycle action tobe invokedaspectName- lifecycle name of which action to be invokedparameters- extra parameters needed when promoting- Throws:
GovernanceException- throws if the operation failed.
-
getAllCheckListItemNames
String[] getAllCheckListItemNames(String aspectName) throws GovernanceException
Retrieve name set of the checklist items- Parameters:
aspectName- lifecycle name of which action to be invoked- Returns:
- Checklist item name set
- Throws:
GovernanceException- throws if the operation failed.
-
checkLCItem
void checkLCItem(int order, String aspectName) throws GovernanceExceptionCheck the checklist item- Parameters:
order- order of the checklist item need to checkedaspectName- lifecycle name of which action to be invoked- Throws:
GovernanceException- throws if the operation failed.
-
isLCItemChecked
boolean isLCItemChecked(int order, String aspectName) throws GovernanceExceptionCheck whether the given ordered lifecycle checklist item is checked or not- Parameters:
order- order of the checklist item need to uncheckedaspectName- lifecycle name of which action to be invoked- Returns:
- whether the given ordered lifecycle checklist item is checked or not
- Throws:
GovernanceException- throws if the operation failed.
-
uncheckLCItem
void uncheckLCItem(int order, String aspectName) throws GovernanceExceptionUn-check the checklist item- Parameters:
order- order of the checklist item need to uncheckedaspectName- lifecycle name of which action to be invoked- Throws:
GovernanceException- throws if the operation failed.
-
getAllVotingItems
String[] getAllVotingItems(String aspectName) throws GovernanceException
Retrieve action set which need votes- Parameters:
aspectName- Lifecycle name- Returns:
- Action set which can vote
- Throws:
GovernanceException- throws if the operation failed.
-
getAllVotingItems
String[] getAllVotingItems() throws GovernanceException
Retrieve action set which need votes- Returns:
- Action set which can vote
- Throws:
GovernanceException- throws if the operation failed.
-
vote
void vote(int order, String aspectName) throws GovernanceExceptionVote for an action- Parameters:
order- order of the action which need to be votedaspectName- Lifecycle name- Throws:
GovernanceException- throws if the operation failed.
-
vote
void vote(int order) throws GovernanceException
Vote for an action- Parameters:
order- order of the action which need to be voted- Throws:
GovernanceException- throws if the operation failed.
-
isVoted
boolean isVoted(int order, String aspectName) throws GovernanceExceptionCheck whether the current user voted for given order event- Parameters:
order- order of the action which need to be votedaspectName- Lifecycle name- Returns:
- whether the current user voted for the given order event
- Throws:
GovernanceException- throws if the operation failed.
-
isVoted
boolean isVoted(int order) throws GovernanceExceptionCheck whether the current user voted for given order event- Parameters:
order- order of the action which need to be voted- Returns:
- whether the current user voted for the given order event
- Throws:
GovernanceException- throws if the operation failed.
-
unvote
void unvote(int order, String aspectName) throws GovernanceExceptionUnvote for an action- Parameters:
order- order of the action which need to be un votedaspectName- Lifecycle name- Throws:
GovernanceException- throws if the operation failed.
-
unvote
void unvote(int order) throws GovernanceExceptionUnvote for an action- Parameters:
order- order of the action which need to be un voted- Throws:
GovernanceException- throws if the operation failed.
-
getPropertyKeys
String[] getPropertyKeys() throws GovernanceException
Returns the available attribute keys- Returns:
- an array of attribute keys.
- Throws:
GovernanceException- throws if the operation failed.
-
attach
void attach(GovernanceArtifact attachedToArtifact) throws GovernanceException
Attach the current artifact to an another artifact. Both the artifacts should be saved, before calling this method. This method will two generic artifact types. There are specific methods- Parameters:
attachedToArtifact- the artifact the current artifact is attached to- Throws:
GovernanceException- throws if the operation failed.
-
attach
void attach(String artifactId) throws GovernanceException
- Throws:
GovernanceException
-
detach
void detach(String artifactId) throws GovernanceException
Detach the current artifact from the provided artifact. Both the artifacts should be saved, before calling this method.- Parameters:
artifactId- the artifact id of the attached artifact- Throws:
GovernanceException- throws if the operation failed.
-
addAssociation
void addAssociation(String associationType, GovernanceArtifact attachedToArtifact) throws GovernanceException
- Throws:
GovernanceException
-
addAssociation
void addAssociation(String associationType, String artifactId) throws GovernanceException
- Throws:
GovernanceException
-
removeAssociation
void removeAssociation(String associationType, String artifactId) throws GovernanceException
- Throws:
GovernanceException
-
removeAssociation
void removeAssociation(String artifactId) throws GovernanceException
- Throws:
GovernanceException
-
getAssociations
Map<String,List<GovernanceArtifact>> getAssociations() throws GovernanceException
- Throws:
GovernanceException
-
getAssociatedArtifactIds
Map<String,List<String>> getAssociatedArtifactIds() throws GovernanceException
- Throws:
GovernanceException
-
isRegistryAwareArtifact
boolean isRegistryAwareArtifact()
-
addTag
void addTag(String tag) throws GovernanceException
- Throws:
GovernanceException
-
addTags
void addTags(List<String> tags) throws GovernanceException
- Throws:
GovernanceException
-
listTags
List<String> listTags() throws GovernanceException
- Throws:
GovernanceException
-
removeTag
void removeTag(String tag) throws GovernanceException
- Throws:
GovernanceException
-
removeTags
void removeTags(List<String> tags) throws GovernanceException
- Throws:
GovernanceException
-
addBidirectionalAssociation
void addBidirectionalAssociation(String forwardType, String backwardType, GovernanceArtifact attachedToArtifact) throws GovernanceException
- Throws:
GovernanceException
-
uniqueTo
boolean uniqueTo(GovernanceArtifact artifact)
-
compareTo
boolean compareTo(GovernanceArtifact artifact)
-
getCurrentStateDuration
Map<String,String> getCurrentStateDuration(String artifactID, String lcName) throws GovernanceException
This method is used to get a lifecycle's current state duration information.- Parameters:
artifactID- lifecycle associated artifacts ID.lcName- lifecycle name.- Returns:
- a map of current lifecycle state duration colour and duration.
- Throws:
GovernanceException
-
-