|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl
public abstract class GovernanceArtifactImpl
Governance Artifact abstract class, This is overwritten by Endpoint, Policy, Schema, Service, WSDL, People classes. This keeps common methods shared by all the governance artifacts
Field Summary | |
---|---|
protected Map<String,List<String>> |
attributes
Map of attributes associated with this governance artifact. |
Constructor Summary | |
---|---|
|
GovernanceArtifactImpl()
Construct a governance artifact. |
protected |
GovernanceArtifactImpl(GovernanceArtifactImpl artifact)
Copy constructor used for cloning. |
|
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. |
Method Summary | |
---|---|
void |
addAttribute(String key,
String value)
Adding an attribute to the artifact. |
void |
associateRegistry(org.wso2.carbon.registry.core.Registry registry)
Associate a registry, this is mostly used by the artifact manager when creating the artifact. |
protected void |
attach(GovernanceArtifact attachedToArtifact)
Attach the current artifact to an another artifact. |
void |
attachLifecycle(String name)
Associates the named lifecycle with the artifact |
void |
checkLCItem(int order)
Check the checklist item |
protected void |
checkRegistryResourceAssociation()
Validate the resource is associated with a registry |
static GovernanceArtifactImpl |
create(org.wso2.carbon.registry.core.Registry registry,
String artifactId)
|
static GovernanceArtifactImpl |
create(org.wso2.carbon.registry.core.Registry registry,
String artifactId,
org.apache.axiom.om.OMElement content)
|
void |
createVersion()
Create a version of the artifact. |
protected void |
detach(String artifactId)
Detach the current artifact from the provided artifact. |
void |
detachLifecycle()
De-associate lifecycle associated with the artifact |
String[] |
getAllCheckListItemNames()
Retrieve name set of the checklist items |
String[] |
getAllLifecycleActions()
Get all lifecycle actions for the current state of the lifecycle |
String[] |
getAllVotingItems()
Retrieve action set which need votes |
String |
getArtifactPath()
|
protected org.wso2.carbon.registry.core.Registry |
getAssociatedRegistry()
Returns the associated registry to the artifact. |
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. |
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 |
getLifecycleState()
Returns the state of the lifecycle associated with this artifact. |
String |
getPath()
Returns the path of the artifact, need to save the artifact before getting the path. |
void |
invokeAction(String action)
Invoke lifecycle action |
void |
invokeAction(String action,
Map<String,String> parameters)
Invoke lifecycle action |
boolean |
isLCItemChecked(int order)
Check whether the given ordered lifecycle checklist item is checked or not |
boolean |
isVoted(int order)
Check whether the current user voted for given order event |
void |
removeAttribute(String key)
Remove attribute with the given key. |
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 |
uncheckLCItem(int order)
Un-check the checklist item |
void |
unvote(int order)
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact |
---|
getQName |
Field Detail |
---|
protected Map<String,List<String>> attributes
Constructor Detail |
---|
public GovernanceArtifactImpl(String id)
id
- the idpublic GovernanceArtifactImpl()
protected GovernanceArtifactImpl(GovernanceArtifactImpl artifact)
artifact
- the object to be copied.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.Method Detail |
---|
public 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
GovernanceException
public static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry, String artifactId, org.apache.axiom.om.OMElement content) throws GovernanceException
GovernanceException
public String getId()
getId
in interface GovernanceArtifact
public void setId(String id)
setId
in interface GovernanceArtifact
id
- the idpublic String getPath() throws GovernanceException
getPath
in interface GovernanceArtifact
GovernanceException
- if an error occurred.public String getLifecycleName() throws GovernanceException
getLifecycleName
in interface GovernanceArtifact
GovernanceException
- if an error occurred.public void attachLifecycle(String name) throws GovernanceException
attachLifecycle
in interface GovernanceArtifact
name
- the name of the lifecycle to be associated with this artifact.
GovernanceException
- if an error occurred.public void detachLifecycle() throws GovernanceException
GovernanceException
- if an error occurred.public String getLifecycleState() throws GovernanceException
getLifecycleState
in interface GovernanceArtifact
GovernanceException
- if an error occurred.public void updatePath() throws GovernanceException
GovernanceException
- if an error occurred.public void updatePath(String artifactId) throws GovernanceException
artifactId
-
GovernanceException
- 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 GovernanceArtifact
key
- the key.value
- the value.
GovernanceException
- throws if the operation failed.public void setAttributes(String key, String[] newValues) throws GovernanceException
setAttributes
in interface GovernanceArtifact
key
- the keynewValues
- the value
GovernanceException
- throws if the operation failed.public void setAttribute(String key, String newValue) throws GovernanceException
setAttribute
in interface GovernanceArtifact
key
- the keynewValue
- the value
GovernanceException
- throws if the operation failed.public String getAttribute(String key) throws GovernanceException
getAttribute
in interface GovernanceArtifact
key
- the key
GovernanceException
- throws if the operation failed.public String[] getAttributeKeys() throws GovernanceException
getAttributeKeys
in interface GovernanceArtifact
GovernanceException
- throws if the operation failed.public String[] getAttributes(String key) throws GovernanceException
getAttributes
in interface GovernanceArtifact
key
- the key.
GovernanceException
- throws if the operation failed.public void removeAttribute(String key) throws GovernanceException
removeAttribute
in interface GovernanceArtifact
key
- the key
GovernanceException
- throws if the operation failed.public GovernanceArtifact[] getDependencies() throws GovernanceException
getDependencies
in interface GovernanceArtifact
GovernanceException
- throws if the operation failed.public GovernanceArtifact[] getDependents() throws GovernanceException
getDependents
in interface GovernanceArtifact
GovernanceException
- throws if the operation failed.public String[] getAllLifecycleActions() throws GovernanceException
getAllLifecycleActions
in interface GovernanceArtifact
GovernanceException
- throws if the operation failed.public void invokeAction(String action) throws GovernanceException
invokeAction
in interface GovernanceArtifact
action
- lifecycle action tobe invoked
GovernanceException
- throws if the operation failed.public void invokeAction(String action, Map<String,String> parameters) throws GovernanceException
invokeAction
in interface GovernanceArtifact
action
- lifecycle action tobe invokedparameters
- extra parameters needed when promoting
GovernanceException
- throws if the operation failed.public String[] getAllCheckListItemNames() throws GovernanceException
getAllCheckListItemNames
in interface GovernanceArtifact
GovernanceException
- throws if the operation failed.public void checkLCItem(int order) throws GovernanceException
checkLCItem
in interface GovernanceArtifact
order
- order of the checklist item need to checked
GovernanceException
- throws if the operation failed.public boolean isLCItemChecked(int order) throws GovernanceException
isLCItemChecked
in interface GovernanceArtifact
order
- order of the checklist item need to unchecked
GovernanceException
- throws if the operation failed.public void uncheckLCItem(int order) throws GovernanceException
uncheckLCItem
in interface GovernanceArtifact
order
- order of the checklist item need to unchecked
GovernanceException
- throws if the operation failed.public String[] getAllVotingItems() throws GovernanceException
getAllVotingItems
in interface GovernanceArtifact
GovernanceException
- throws if the operation failed.public void vote(int order) throws GovernanceException
vote
in interface GovernanceArtifact
order
- order of the action which need to be voted
GovernanceException
- throws if the operation failed.public boolean isVoted(int order) throws GovernanceException
isVoted
in interface GovernanceArtifact
order
- order of the action which need to be voted
GovernanceException
- throws if the operation failed.public void unvote(int order) throws GovernanceException
unvote
in interface GovernanceArtifact
order
- order of the action which need to be unvoted
GovernanceException
- throws if the operation failed.protected void attach(GovernanceArtifact attachedToArtifact) throws GovernanceException
attachedToArtifact
- the artifact the current artifact is attached to
GovernanceException
- throws if the operation failed.protected void detach(String artifactId) throws GovernanceException
artifactId
- the artifact id of the attached artifact
GovernanceException
- 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |