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

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.


Copyright © 2012 WSO2 Inc. All Rights Reserved.