org.wso2.carbon.governance.api.generic.dataobjects
Class GenericArtifactImpl

java.lang.Object
  extended by org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl
      extended by org.wso2.carbon.governance.api.generic.dataobjects.GenericArtifactImpl
All Implemented Interfaces:
GovernanceArtifact, GenericArtifact

public class GenericArtifactImpl
extends GovernanceArtifactImpl
implements GenericArtifact

Represents a generic governance artifact.


Field Summary
 
Fields inherited from class org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl
attributes
 
Constructor Summary
protected GenericArtifactImpl(GovernanceArtifact artifact, String mediaType)
          Copy constructor used for cloning.
  GenericArtifactImpl(String id, org.apache.axiom.om.OMElement artifactContentElement, String artifactNameAttribute, String artifactNamespaceAttribute, String artifactElementNamespace, String mediaType)
          Constructor accepting resource identifier and the artifact content.
  GenericArtifactImpl(String id, QName qName, String mediaType)
          Constructor accepting resource identifier and the qualified name.
  GenericArtifactImpl(String id, org.wso2.carbon.registry.core.Registry registry)
          Constructor accepting resource identifier and the artifact content.
 
Method Summary
 byte[] getContent()
          Method to obtain the content of this artifact.
 String getMediaType()
          Returns the media type of the artifact.
 QName getQName()
          Returns the QName of the artifact.
 void loadDetails()
          Method to load the details into this artifact.
 void setContent(byte[] content)
          Method to set the content of this artifact.
 void setQName(QName qName)
          Method to set the qualified name of this artifact.
 
Methods inherited from class org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl
addAttribute, associateRegistry, attach, attachLifecycle, checkLCItem, checkRegistryResourceAssociation, create, create, createVersion, detach, detachLifecycle, getAllCheckListItemNames, getAllLifecycleActions, getAllVotingItems, getArtifactPath, getAssociatedRegistry, getAttribute, getAttributeKeys, getAttributes, getDependencies, getDependents, getId, getLcName, getLcState, getLifecycleName, getLifecycleState, getPath, invokeAction, invokeAction, isLCItemChecked, isVoted, removeAttribute, setArtifactPath, setAttribute, setAttributes, setId, setLcName, setLcState, uncheckLCItem, unvote, updatePath, updatePath, vote
 
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
addAttribute, attachLifecycle, checkLCItem, getAllCheckListItemNames, getAllLifecycleActions, getAllVotingItems, getAttribute, getAttributeKeys, getAttributes, getDependencies, getDependents, getId, getLifecycleName, getLifecycleState, getPath, invokeAction, invokeAction, isLCItemChecked, isVoted, removeAttribute, setAttribute, setAttributes, setId, uncheckLCItem, unvote, vote
 

Constructor Detail

GenericArtifactImpl

protected GenericArtifactImpl(GovernanceArtifact artifact,
                              String mediaType)
Copy constructor used for cloning.

Parameters:
artifact - the object to be copied.

GenericArtifactImpl

public GenericArtifactImpl(String id,
                           QName qName,
                           String mediaType)
Constructor accepting resource identifier and the qualified name.

Parameters:
id - the resource identifier.
qName - the qualified name.

GenericArtifactImpl

public GenericArtifactImpl(String id,
                           org.apache.axiom.om.OMElement artifactContentElement,
                           String artifactNameAttribute,
                           String artifactNamespaceAttribute,
                           String artifactElementNamespace,
                           String mediaType)
                    throws GovernanceException
Constructor accepting resource identifier and the artifact content.

Parameters:
id - the resource identifier.
artifactContentElement - an XML element containing the content.
artifactNameAttribute - the attribute that specifies the name of the artifact.
artifactNamespaceAttribute - the attribute that specifies the namespace of the artifact.
artifactElementNamespace - the attribute that specifies the artifact element's namespace.
Throws:
GovernanceException - if the construction fails.

GenericArtifactImpl

public GenericArtifactImpl(String id,
                           org.wso2.carbon.registry.core.Registry registry)
                    throws GovernanceException
Constructor accepting resource identifier and the artifact content.

Parameters:
id - the resource identifier.
registry - the registry instance to fetch artifact content.
Throws:
GovernanceException - if the construction fails.
Method Detail

getContent

public byte[] getContent()
Description copied from interface: GenericArtifact
Method to obtain the content of this artifact.

Specified by:
getContent in interface GenericArtifact
Returns:
the content.

setContent

public void setContent(byte[] content)
Description copied from interface: GenericArtifact
Method to set the content of this artifact.

Specified by:
setContent in interface GenericArtifact
Parameters:
content - the element.

loadDetails

public void loadDetails()
                 throws GovernanceException
Method to load the details into this artifact.

Throws:
GovernanceException - if the operation failed.

getQName

public QName getQName()
Description copied from interface: GovernanceArtifact
Returns the QName of the artifact.

Specified by:
getQName in interface GovernanceArtifact
Returns:
the QName of the artifact

getMediaType

public String getMediaType()
Description copied from interface: GenericArtifact
Returns the media type of the artifact.

Specified by:
getMediaType in interface GenericArtifact
Returns:
the media type of the artifact

setQName

public void setQName(QName qName)
              throws GovernanceException
Method to set the qualified name of this artifact.

Parameters:
qName - the qualified name.
Throws:
GovernanceException - if the operation failed.


Copyright © 2013 WSO2 Inc. All Rights Reserved.