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

## Class GovernanceArtifactImpl

- java.lang.Object
- - org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl

- All Implemented Interfaces:
    GovernanceArtifact
  Direct Known Subclasses:
    EndpointImpl, GenericArtifactImpl, PolicyImpl, SchemaImpl, ServiceImpl, WsdlImpl

      public abstract class GovernanceArtifactImpl
      extends Object
      implements GovernanceArtifact

  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

    Fields
    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.

  - ### Constructor Summary

    Constructors
    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)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact

      `getQName, setQName`

- - ### Field Detail

    - #### attributes

          protected Map<String,List<String>> attributes

      Map of attributes associated with this governance artifact.

    - #### properties

          protected Map<String,List<String>> properties

      Map of properties associated with this governance artifact.

  - ### Constructor Detail

    - #### GovernanceArtifactImpl

          public GovernanceArtifactImpl(String id)

      Construct a governance artifact object from the path and the id.
      Parameters:
        `id` - the id

    - #### GovernanceArtifactImpl

          public GovernanceArtifactImpl()

      Construct a governance artifact. The default constructor.

    - #### GovernanceArtifactImpl

          protected GovernanceArtifactImpl(GovernanceArtifactImpl artifact)

      Copy constructor used for cloning.
      Parameters:
        `artifact` - the object to be copied.

    - #### GovernanceArtifactImpl

          protected GovernanceArtifactImpl(GovernanceArtifactImpl artifact,
                                           List<String> uniqueAttributes)

    - #### GovernanceArtifactImpl

          public GovernanceArtifactImpl(String id,
                                        org.apache.axiom.om.OMElement contentElement)
                                 throws GovernanceException

      Constructor accepting resource identifier and the XML content.
      Parameters:
        `id` - the resource identifier.
        `contentElement` - an XML element containing the content.
      Throws:
        `GovernanceException` - if the construction fails.

    - #### GovernanceArtifactImpl

          public GovernanceArtifactImpl(String id,
                                        org.apache.axiom.om.OMElement contentElement,
                                        List<String> uniqueAttributes)
                                 throws GovernanceException

      Throws:
        `GovernanceException`

  - ### Method Detail

    - #### getUniqueAttributes

          public List<String> getUniqueAttributes()

    - #### setUniqueAttributes

          public void setUniqueAttributes(List<String> uniqueAttributes)

    - #### getLcName

          public String getLcName()

    - #### setLcName

          public void setLcName(String lcName)

    - #### getLcState

          public String getLcState()

    - #### setLcState

          public void setLcState(String lcState)

    - #### getArtifactPath

          public String getArtifactPath()

    - #### setArtifactPath

          public void setArtifactPath(String artifactPath)

    - #### create

          public static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry,
                                                      String artifactId)
                                               throws GovernanceException

      Throws:
        `GovernanceException`

    - #### create

          public static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry,
                                                      String artifactId,
                                                      org.apache.axiom.om.OMElement content)
                                               throws GovernanceException

      Throws:
        `GovernanceException`

    - #### create

          public static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry,
                                                      String artifactId,
                                                      List<String> uniqueAttributes)
                                               throws GovernanceException

      Throws:
        `GovernanceException`

    - #### create

          public static GovernanceArtifactImpl create(org.wso2.carbon.registry.core.Registry registry,
                                                      String artifactId,
                                                      org.apache.axiom.om.OMElement content,
                                                      List<String> uniqueAttributes)
                                               throws GovernanceException

      Throws:
        `GovernanceException`

    - #### getId

          public String getId()

      Returns the id of the artifact
      Specified by:
        `getId` in interface `GovernanceArtifact`
      Returns:
        the id

    - #### setId

          public void setId(String id)

      Set the id
      Specified by:
        `setId` in interface `GovernanceArtifact`
      Parameters:
        `id` - the id

    - #### getPath

          public String getPath()
                         throws GovernanceException

      Returns the path of the artifact, need to save the artifact before getting the path.
      Specified by:
        `getPath` in interface `GovernanceArtifact`
      Returns:
        here we return the path of the artifact.
      Throws:
        `GovernanceException` - if an error occurred.

    - #### getMediaType

          public String getMediaType()

      Description copied from interface: `GovernanceArtifact`
      Returns the media type of the artifact.
      Specified by:
        `getMediaType` in interface `GovernanceArtifact`
      Returns:
        the media type of the artifact

    - #### getLifecycleName

          public String getLifecycleName()
                                  throws GovernanceException

      Returns the name of the lifecycle associated with this artifact.
      Specified by:
        `getLifecycleName` in interface `GovernanceArtifact`
      Returns:
        the name of the lifecycle associated with this artifact.
      Throws:
        `GovernanceException` - if an error occurred.

    - #### getLifecycleNames

          public String[] getLifecycleNames()
                                     throws GovernanceException

      Returns the name of the lifecycle associated with this artifact.
      Specified by:
        `getLifecycleNames` in interface `GovernanceArtifact`
      Returns:
        the name of the lifecycle associated with this artifact.
      Throws:
        `GovernanceException` - if an error occurred.

    - #### attachLifecycle

          public void attachLifecycle(String name)
                               throws GovernanceException

      Associates the named lifecycle with the artifact
      Specified by:
        `attachLifecycle` in interface `GovernanceArtifact`
      Parameters:
        `name` - the name of the lifecycle to be associated with this artifact.
      Throws:
        `GovernanceException` - if an error occurred.

    - #### detachLifecycle

          public void detachLifecycle(String lifecycleName)
                               throws GovernanceException

      De-associate lifecycle associated with the artifact
      Throws:
        `GovernanceException` - if an error occurred.

    - #### getLifecycleState

          public String getLifecycleState()
                                   throws GovernanceException

      Returns the state of the lifecycle associated with this artifact.
      Specified by:
        `getLifecycleState` in interface `GovernanceArtifact`
      Returns:
        the state of the lifecycle associated with this artifact.
      Throws:
        `GovernanceException` - if an error occurred.

    - #### getLifecycleState

          public String getLifecycleState(String lifeCycleName)
                                   throws GovernanceException

      Returns the state of the lifecycle associated with this artifact.
      Specified by:
        `getLifecycleState` in interface `GovernanceArtifact`
      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.

    - #### updatePath

          public void updatePath()
                          throws GovernanceException

      update the path after moving the resource.
      Throws:
        `GovernanceException` - if an error occurred.

    - #### updatePath

          public void updatePath(String artifactId)
                          throws GovernanceException

      update the path after moving the resource.
      Parameters:
        `artifactId` - id of the artifact
      Throws:
        `GovernanceException` - if an error occurred.

    - #### createVersion

          public void createVersion()
                             throws GovernanceException

      Create a version of the artifact.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### associateRegistry

          public void associateRegistry(org.wso2.carbon.registry.core.Registry registry)
                                 throws GovernanceException

      Associate a registry, this is mostly used by the artifact manager when creating the artifact.
      Parameters:
        `registry` - the registry.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### addAttribute

          public 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.
      Specified by:
        `addAttribute` in interface `GovernanceArtifact`
      Parameters:
        `key` - the key.
        `value` - the value.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### setAttributes

          public 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.
      Specified by:
        `setAttributes` in interface `GovernanceArtifact`
      Parameters:
        `key` - the key
        `newValues` - the value
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### setAttribute

          public 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.
      Specified by:
        `setAttribute` in interface `GovernanceArtifact`
      Parameters:
        `key` - the key
        `newValue` - the value
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getAttribute

          public String getAttribute(String key)
                              throws GovernanceException

      Returns the attribute of a given key.
      Specified by:
        `getAttribute` in interface `GovernanceArtifact`
      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

          public String[] getAttributeKeys()
                                    throws GovernanceException

      Returns the available attribute keys
      Specified by:
        `getAttributeKeys` in interface `GovernanceArtifact`
      Returns:
        an array of attribute keys.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getAttributes

          public String[] getAttributes(String key)
                                 throws GovernanceException

      Returns the attribute values for a key.
      Specified by:
        `getAttributes` in interface `GovernanceArtifact`
      Parameters:
        `key` - the key.
      Returns:
        attribute values for the key.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### removeAttribute

          public void removeAttribute(String key)
                               throws GovernanceException

      Remove attribute with the given key. The artifact should be saved to get effect the change.
      Specified by:
        `removeAttribute` in interface `GovernanceArtifact`
      Parameters:
        `key` - the key
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getDependencies

          public GovernanceArtifact[] getDependencies()
                                               throws GovernanceException

      Get dependencies of an artifacts. The artifacts should be saved, before calling this method.
      Specified by:
        `getDependencies` in interface `GovernanceArtifact`
      Returns:
        an array of dependencies of this artifact.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getDependents

          public GovernanceArtifact[] getDependents()
                                             throws GovernanceException

      Get dependents of an artifact. The artifacts should be saved, before calling this method.
      Specified by:
        `getDependents` in interface `GovernanceArtifact`
      Returns:
        an array of artifacts that is dependent on this artifact.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getAllLifecycleActions

          public String[] getAllLifecycleActions(String lifeCycleName)
                                          throws GovernanceException

      Get all lifecycle actions for the current state of the lifecycle
      Specified by:
        `getAllLifecycleActions` in interface `GovernanceArtifact`
      Parameters:
        `lifeCycleName` - lifecycle name of which actions are needed
      Returns:
        Action set which can be invoked
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### invokeAction

          public void invokeAction(String action,
                                   String aspectName)
                            throws GovernanceException

      Invoke lifecycle action
      Specified by:
        `invokeAction` in interface `GovernanceArtifact`
      Parameters:
        `action` - lifecycle action tobe invoked
        `aspectName` - aspect name of which the action need to be invoked
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### invokeAction

          public void invokeAction(String action,
                                   Map<String,String> parameters,
                                   String aspectName)
                            throws GovernanceException

      Invoke lifecycle action
      Specified by:
        `invokeAction` in interface `GovernanceArtifact`
      Parameters:
        `action` - lifecycle action tobe invoked
        `parameters` - extra parameters needed when promoting
        `aspectName` - aspect name of which the action need to be invoked
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getAllCheckListItemNames

          public String[] getAllCheckListItemNames(String aspectName)
                                            throws GovernanceException

      Retrieve name set of the checklist items
      Specified by:
        `getAllCheckListItemNames` in interface `GovernanceArtifact`
      Parameters:
        `aspectName` - lifecycle name of which action to be invoked
      Returns:
        Checklist item name set
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### checkLCItem

          public void checkLCItem(int order,
                                  String aspectName)
                           throws GovernanceException

      Check the checklist item
      Specified by:
        `checkLCItem` in interface `GovernanceArtifact`
      Parameters:
        `aspectName` - lifecycle name of which action to be invoked
        `order` - order of the checklist item need to checked
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### isLCItemChecked

          public boolean isLCItemChecked(int order,
                                         String aspectName)
                                  throws GovernanceException

      Check whether the given ordered lifecycle checklist item is checked or not
      Specified by:
        `isLCItemChecked` in interface `GovernanceArtifact`
      Parameters:
        `order` - order of the checklist item need to unchecked
        `aspectName` - 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

          public void uncheckLCItem(int order,
                                    String aspectName)
                             throws GovernanceException

      Un-check the checklist item
      Specified by:
        `uncheckLCItem` in interface `GovernanceArtifact`
      Parameters:
        `order` - order of the checklist item need to unchecked
        `aspectName` - lifecycle name of which action to be invoked
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getAllVotingItems

          public String[] getAllVotingItems(String aspectName)
                                     throws GovernanceException

      Retrieve action set which need votes.
      Specified by:
        `getAllVotingItems` in interface `GovernanceArtifact`
      Parameters:
        `aspectName` - Lifecycle name
      Returns:
        Action set which can vote
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### getAllVotingItems

          public String[] getAllVotingItems()
                                     throws GovernanceException

      Retrieve action set which need votes.
      Specified by:
        `getAllVotingItems` in interface `GovernanceArtifact`
      Returns:
        Action set which can vote
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### vote

          public void vote(int order,
                           String aspectName)
                    throws GovernanceException

      Vote for an action.
      Specified by:
        `vote` in interface `GovernanceArtifact`
      Parameters:
        `order` - order of the action which need to be voted
        `aspectName` - Lifecycle name
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### vote

          public void vote(int order)
                    throws GovernanceException

      Vote for an action.
      Specified by:
        `vote` in interface `GovernanceArtifact`
      Parameters:
        `order` - order of the action which need to be voted
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### isVoted

          public boolean isVoted(int order,
                                 String aspectName)
                          throws GovernanceException

      Check whether the current user voted for given order event
      Specified by:
        `isVoted` in interface `GovernanceArtifact`
      Parameters:
        `order` - order of the action which need to be voted
        `aspectName` - Lifecycle name
      Returns:
        whether the current user voted for the given order event
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### isVoted

          public boolean isVoted(int order)
                          throws GovernanceException

      Check whether the current user voted for given order event.
      Specified by:
        `isVoted` in interface `GovernanceArtifact`
      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

          public void unvote(int order,
                             String aspectName)
                      throws GovernanceException

      Unvote for an action
      Specified by:
        `unvote` in interface `GovernanceArtifact`
      Parameters:
        `order` - order of the action which need to be unvoted
        `aspectName` - Lifecycle name
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### unvote

          public void unvote(int order)
                      throws GovernanceException

      Unvote for an action.
      Specified by:
        `unvote` in interface `GovernanceArtifact`
      Parameters:
        `order` - order of the action which need to be un voted
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### attach

          public 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
      Specified by:
        `attach` in interface `GovernanceArtifact`
      Parameters:
        `attachedToArtifact` - the artifact the current artifact is attached to
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### detach

          public void detach(String artifactId)
                      throws GovernanceException

      Detach the current artifact from the provided artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `detach` in interface `GovernanceArtifact`
      Parameters:
        `artifactId` - the artifact id of the attached artifact
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### checkRegistryResourceAssociation

          protected void checkRegistryResourceAssociation()
                                                   throws GovernanceException

      Validate the resource is associated with a registry
      Throws:
        `GovernanceException` - if the resource is not associated with a registry.

    - #### getAssociatedRegistry

          protected org.wso2.carbon.registry.core.Registry getAssociatedRegistry()

      Returns the associated registry to the artifact.
      Returns:
        the associated registry

    - #### getPropertyKeys

          public String[] getPropertyKeys()
                                   throws GovernanceException

      Returns the available attribute keys
      Specified by:
        `getPropertyKeys` in interface `GovernanceArtifact`
      Returns:
        an array of attribute keys.
      Throws:
        `GovernanceException` - throws if the operation failed.

    - #### equals

          public boolean equals(Object artifact)

      Overrides:
        `equals` in class `Object`

    - #### attach

          public void attach(String artifactId)
                      throws GovernanceException

      Specified by:
        `attach` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### addAssociation

          public void addAssociation(String associationType,
                                     GovernanceArtifact attachedToArtifact)
                              throws GovernanceException

      Specified by:
        `addAssociation` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### addAssociation

          public void addAssociation(String associationType,
                                     String artifactId)
                              throws GovernanceException

      Specified by:
        `addAssociation` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### addBidirectionalAssociation

          public void addBidirectionalAssociation(String forwardType,
                                                  String backwardType,
                                                  GovernanceArtifact attachedToArtifact)
                                           throws GovernanceException

      Specified by:
        `addBidirectionalAssociation` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### removeAssociation

          public void removeAssociation(String associationType,
                                        String artifactId)
                                 throws GovernanceException

      Specified by:
        `removeAssociation` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### removeAssociation

          public void removeAssociation(String artifactId)
                                 throws GovernanceException

      Specified by:
        `removeAssociation` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### getAssociations

          public Map<String,List<GovernanceArtifact>> getAssociations()
                                                               throws GovernanceException

      Specified by:
        `getAssociations` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### getAssociatedArtifactIds

          public Map<String,List<String>> getAssociatedArtifactIds()
                                                            throws GovernanceException

      Specified by:
        `getAssociatedArtifactIds` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### isRegistryAwareArtifact

          public boolean isRegistryAwareArtifact()

      Specified by:
        `isRegistryAwareArtifact` in interface `GovernanceArtifact`

    - #### addTag

          public void addTag(String tag)
                      throws GovernanceException

      Specified by:
        `addTag` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### addTags

          public void addTags(List<String> tags)
                       throws GovernanceException

      Specified by:
        `addTags` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### listTags

          public List<String> listTags()
                                throws GovernanceException

      Specified by:
        `listTags` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### removeTag

          public void removeTag(String tag)
                         throws GovernanceException

      Specified by:
        `removeTag` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### removeTags

          public void removeTags(List<String> tags)
                          throws GovernanceException

      Specified by:
        `removeTags` in interface `GovernanceArtifact`
      Throws:
        `GovernanceException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### uniqueTo

          public boolean uniqueTo(GovernanceArtifact artifact)

      Specified by:
        `uniqueTo` in interface `GovernanceArtifact`

    - #### compareTo

          public boolean compareTo(GovernanceArtifact artifact)

      Specified by:
        `compareTo` in interface `GovernanceArtifact`

    - #### getCurrentStateDuration

          public Map<String,String> getCurrentStateDuration(String artifactID,
                                                            String lcName)
                                                     throws GovernanceException

      This method is used to get a lifecycle's current state duration information.
      Specified by:
        `getCurrentStateDuration` in interface `GovernanceArtifact`
      Parameters:
        `artifactID` - lifecycle associated artifacts id.
        `lcName` - lifecycle name.
      Returns:
        a map of current lifecycle state duration colour and duration.
      Throws:
        `GovernanceException`

Copyright © 2017 WSO2. All rights reserved.