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

## Class GenericArtifactImpl

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

- All Implemented Interfaces:
    GovernanceArtifact, GenericArtifact
  Direct Known Subclasses:
    DetachedGenericArtifactImpl

      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, properties`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `GenericArtifactImpl(GovernanceArtifact artifact, String mediaType)` Copy constructor used for cloning.
    `protected` | `GenericArtifactImpl(GovernanceArtifact artifact, String mediaType, List<String> uniqueAttributes)`
    `` | `GenericArtifactImpl(QName qName, String mediaType)`
    `` | `GenericArtifactImpl(QName qName, String mediaType, List<String> uniqueAttributes)`
    `` | `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, QName qName, String mediaType, List<String> uniqueAttributes)`
    `` | `GenericArtifactImpl(String id, org.wso2.carbon.registry.core.Registry registry)` Constructor accepting resource identifier and the artifact content.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `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

      `addAssociation, addAssociation, addAttribute, addBidirectionalAssociation, addTag, addTags, associateRegistry, attach, attach, attachLifecycle, checkLCItem, checkRegistryResourceAssociation, compareTo, create, create, create, create, createVersion, detach, detachLifecycle, equals, getAllCheckListItemNames, getAllLifecycleActions, getAllVotingItems, getAllVotingItems, getArtifactPath, getAssociatedArtifactIds, getAssociatedRegistry, getAssociations, getAttribute, getAttributeKeys, getAttributes, getCurrentStateDuration, getDependencies, getDependents, getId, getLcName, getLcState, getLifecycleName, getLifecycleNames, getLifecycleState, getLifecycleState, getPath, getPropertyKeys, getUniqueAttributes, invokeAction, invokeAction, isLCItemChecked, isRegistryAwareArtifact, isVoted, isVoted, listTags, removeAssociation, removeAssociation, removeAttribute, removeTag, removeTags, setArtifactPath, setAttribute, setAttributes, setId, setLcName, setLcState, setUniqueAttributes, toString, uncheckLCItem, uniqueTo, unvote, unvote, updatePath, updatePath, vote, vote`

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

      `addAssociation, addAssociation, addAttribute, addBidirectionalAssociation, addTag, addTags, attach, attach, attachLifecycle, checkLCItem, compareTo, detach, getAllCheckListItemNames, getAllLifecycleActions, getAllVotingItems, getAllVotingItems, getAssociatedArtifactIds, getAssociations, getAttribute, getAttributeKeys, getAttributes, getCurrentStateDuration, getDependencies, getDependents, getId, getLifecycleName, getLifecycleNames, getLifecycleState, getLifecycleState, getPath, getPropertyKeys, invokeAction, invokeAction, isLCItemChecked, isRegistryAwareArtifact, isVoted, isVoted, listTags, removeAssociation, removeAssociation, removeAttribute, removeTag, removeTags, setAttribute, setAttributes, setId, uncheckLCItem, uniqueTo, unvote, unvote, vote, vote`

- - ### Constructor Detail

    - #### GenericArtifactImpl

          protected GenericArtifactImpl(GovernanceArtifact artifact,
                                        String mediaType)

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

    - #### GenericArtifactImpl

          protected GenericArtifactImpl(GovernanceArtifact artifact,
                                        String mediaType,
                                        List<String> uniqueAttributes)

    - #### 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,
                                     QName qName,
                                     String mediaType,
                                     List<String> uniqueAttributes)

    - #### GenericArtifactImpl

          public GenericArtifactImpl(QName qName,
                                     String mediaType)

    - #### GenericArtifactImpl

          public GenericArtifactImpl(QName qName,
                                     String mediaType,
                                     List<String> uniqueAttributes)

    - #### 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: `GovernanceArtifact`
      Returns the media type of the artifact.
      Specified by:
        `getMediaType` in interface `GovernanceArtifact`
      Specified by:
        `getMediaType` in interface `GenericArtifact`
      Overrides:
        `getMediaType` in class `GovernanceArtifactImpl`
      Returns:
        the media type of the artifact

    - #### setQName

          public void setQName(QName qName)

      Method to set the qualified name of this artifact.
      Specified by:
        `setQName` in interface `GovernanceArtifact`
      Parameters:
        `qName` - the qualified name.
      Throws:
        `GovernanceException` - if the operation failed.

Copyright © 2017 WSO2. All rights reserved.