Interface GovernanceArtifact

    • 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
      • 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 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.
      • 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 invoked
        aspectName - 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 invoked
        aspectName - lifecycle name of which action to be invoked
        parameters - 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 GovernanceException
        Check the checklist item
        Parameters:
        order - order of the checklist item need to checked
        aspectName - lifecycle name of which action to be invoked
        Throws:
        GovernanceException - throws if the operation failed.
      • isLCItemChecked

        boolean isLCItemChecked​(int order,
                                String aspectName)
                         throws GovernanceException
        Check whether the given ordered lifecycle checklist item is checked or not
        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

        void uncheckLCItem​(int order,
                           String aspectName)
                    throws GovernanceException
        Un-check the checklist item
        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

        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.
      • vote

        void vote​(int order,
                  String aspectName)
           throws GovernanceException
        Vote for an action
        Parameters:
        order - order of the action which need to be voted
        aspectName - 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 GovernanceException
        Check whether the current user voted for given order event
        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

        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,
                    String aspectName)
             throws GovernanceException
        Unvote for an action
        Parameters:
        order - order of the action which need to be un voted
        aspectName - Lifecycle name
        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 un voted
        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.
      • 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.
      • isRegistryAwareArtifact

        boolean isRegistryAwareArtifact()
      • 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