org.wso2.carbon.governance.api.common.dataobjects
Interface GovernanceArtifact

All Known Subinterfaces:
Endpoint, GenericArtifact, Policy, Schema, Service, Wsdl
All Known Implementing Classes:
EndpointImpl, GenericArtifactImpl, GovernanceArtifactImpl, PolicyImpl, SchemaImpl, ServiceImpl, WsdlImpl

public interface GovernanceArtifact


Method Summary
 void addAttribute(String key, String value)
          Adding an attribute to the artifact.
 void attachLifecycle(String name)
          Associates the named lifecycle with the artifact
 void checkLCItem(int order)
          Check the checklist item
 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 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 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.
 QName getQName()
          Returns the QName of the artifact.
 void invokeAction(String action)
          Promote the artifact to the next state of the lifecycle
 void invokeAction(String action, Map<String,String> parameters)
          Promote the artifact to the next state of the lifecycle
 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 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 uncheckLCItem(int order)
          Un-check the checklist item
 void unvote(int order)
          Unvote for an action
 void vote(int order)
          Vote for an action
 

Method Detail

getQName

QName getQName()
Returns the QName of the artifact.

Returns:
the QName of the artifact

getId

String getId()
Returns the id of the artifact

Returns:
the id

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.

getLifecycleName

String getLifecycleName()
                        throws GovernanceException
Returns the name of the lifecycle associated with this artifact.

Returns:
the name 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 lifecycle associated with this artifact.

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 key
newValues - 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 key
newValue - 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()
                                throws GovernanceException
Get all lifecycle actions for the current state of the lifecycle

Returns:
Action set which can be invoked
Throws:
GovernanceException - throws if the operation failed.

invokeAction

void invokeAction(String action)
                  throws GovernanceException
Promote the artifact to the next state of the lifecycle

Parameters:
action - lifecycle action tobe invoked
Throws:
GovernanceException - throws if the operation failed.

invokeAction

void invokeAction(String action,
                  Map<String,String> parameters)
                  throws GovernanceException
Promote the artifact to the next state of the lifecycle

Parameters:
action - lifecycle action tobe invoked
parameters - extra parameters needed when promoting
Throws:
GovernanceException - throws if the operation failed.

getAllCheckListItemNames

String[] getAllCheckListItemNames()
                                  throws GovernanceException
Retrieve name set of the checklist items

Returns:
Checklist item name set
Throws:
GovernanceException - throws if the operation failed.

checkLCItem

void checkLCItem(int order)
                 throws GovernanceException
Check the checklist item

Parameters:
order - order of the checklist item need to checked
Throws:
GovernanceException - throws if the operation failed.

isLCItemChecked

boolean isLCItemChecked(int order)
                        throws GovernanceException
Check whether the given ordered lifecycle checklist item is checked or not

Parameters:
order - order of the checklist item need to unchecked
Returns:
whether the given ordered lifecycle checklist item is checked or not
Throws:
GovernanceException - throws if the operation failed.

uncheckLCItem

void uncheckLCItem(int order)
                   throws GovernanceException
Un-check the checklist item

Parameters:
order - order of the checklist item need to unchecked
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)
          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)
                throws GovernanceException
Check 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)
            throws GovernanceException
Unvote for an action

Parameters:
order - order of the action which need to be unvoted
Throws:
GovernanceException - throws if the operation failed.


Copyright © 2013 WSO2 Inc. All Rights Reserved.