org.wso2.carbon.governance.api.services.dataobjects

## Class ServiceImpl

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

- All Implemented Interfaces:
    GovernanceArtifact, Service

      public class ServiceImpl
      extends GovernanceArtifactImpl
      implements Service

  This represents a service artifact stored on the Registry. Service artifacts are created as a result of adding a new service or uploading or importing a WSDL file into the registry.

- - ### Field Summary

    - ### Fields inherited from class org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifactImpl

      `attributes, properties`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `ServiceImpl(GovernanceArtifact service)` Copy constructor used for cloning.
    `` | `ServiceImpl(String id, org.apache.axiom.om.OMElement serviceContentElement)` Constructor accepting resource identifier and the service content.
    `` | `ServiceImpl(String id, QName qName)` Constructor accepting resource identifier and the qualified name.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()` Deprecated. since active functionality is no longer used.
    `void` | `attachEndpoint(Endpoint endpoint)` Attach an endpoint artifact to a service artifact.
    `void` | `attachPolicy(Policy policy)` Attach a policy artifact to a service artifact.
    `void` | `attachSchema(Schema schema)` Attach a schema artifact to a service artifact.
    `void` | `attachWSDL(Wsdl wsdl)` Attach a WSDL artifact to a service artifact.
    `void` | `deactivate()` Deprecated. since active functionality is no longer used.
    `void` | `detachEndpoint(String endpointId)` Detach an endpoint artifact from a service artifact.
    `void` | `detachPolicy(String policyId)` Detach a policy artifact from a service artifact.
    `void` | `detachSchema(String schemaId)` Detach a schema artifact from a service artifact.
    `void` | `detachWSDL(String wsdlId)` Detach a WSDL artifact from a service artifact.
    `Endpoint[]` | `getAttachedEndpoints()` Method to retrieve all endpoints attached to this service artifact.
    `Policy[]` | `getAttachedPolicies()` Method to retrieve all policies attached to this service artifact.
    `Schema[]` | `getAttachedSchemas()` Method to retrieve all schemas attached to this service artifact.
    `Wsdl[]` | `getAttachedWsdls()` Method to retrieve all WSDLs attached to this service artifact.
    `QName` | `getQName()` Returns the QName of the artifact.
    `boolean` | `isActive()` Deprecated. since active functionality is no longer used.
    `void` | `setActive(boolean isActive)` Deprecated. since active functionality is no longer used.
    `void` | `setQName(QName qName)` Method to set the qualified name of this service 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, getMediaType, 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, getMediaType, 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

    - #### ServiceImpl

          protected ServiceImpl(GovernanceArtifact service)

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

    - #### ServiceImpl

          public ServiceImpl(String id,
                             QName qName)

      Constructor accepting resource identifier and the qualified name.
      Parameters:
        `id` - the resource identifier.
        `qName` - the qualified name.

    - #### ServiceImpl

          public ServiceImpl(String id,
                             org.apache.axiom.om.OMElement serviceContentElement)
                      throws GovernanceException

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

  - ### Method Detail

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

    - #### setQName

          public void setQName(QName qName)
                        throws GovernanceException

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

    - #### activate

          public void activate()
                        throws GovernanceException

      Deprecated. since active functionality is no longer used.
      Method to activate this service.
      Specified by:
        `activate` in interface `Service`
      Throws:
        `GovernanceException` - if the operation failed.

    - #### deactivate

          public void deactivate()
                          throws GovernanceException

      Deprecated. since active functionality is no longer used.
      Method to deactivate this service.
      Specified by:
        `deactivate` in interface `Service`
      Throws:
        `GovernanceException` - if the operation failed.

    - #### setActive

          @Deprecated
          public void setActive(boolean isActive)
                                     throws GovernanceException

      Deprecated. since active functionality is no longer used.
      Method to set/unset the active status of this service.
      Parameters:
        `isActive` - whether the service is active.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### isActive

          public boolean isActive()
                           throws GovernanceException

      Deprecated. since active functionality is no longer used.
      Method to obtain whether this service is active or not.
      Specified by:
        `isActive` in interface `Service`
      Returns:
        true if this service is active, and false if not.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### attachPolicy

          public void attachPolicy(Policy policy)
                            throws GovernanceException

      Attach a policy artifact to a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `attachPolicy` in interface `Service`
      Parameters:
        `policy` - the policy to attach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### detachPolicy

          public void detachPolicy(String policyId)
                            throws GovernanceException

      Detach a policy artifact from a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `detachPolicy` in interface `Service`
      Parameters:
        `policyId` - the identifier of the policy to detach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### getAttachedPolicies

          public Policy[] getAttachedPolicies()
                                       throws GovernanceException

      Method to retrieve all policies attached to this service artifact.
      Specified by:
        `getAttachedPolicies` in interface `Service`
      Returns:
        all policies attached to this service artifact.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### attachSchema

          public void attachSchema(Schema schema)
                            throws GovernanceException

      Attach a schema artifact to a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `attachSchema` in interface `Service`
      Parameters:
        `schema` - the schema to attach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### detachSchema

          public void detachSchema(String schemaId)
                            throws GovernanceException

      Detach a schema artifact from a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `detachSchema` in interface `Service`
      Parameters:
        `schemaId` - the identifier of the schema to detach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### getAttachedSchemas

          public Schema[] getAttachedSchemas()
                                      throws GovernanceException

      Method to retrieve all schemas attached to this service artifact.
      Specified by:
        `getAttachedSchemas` in interface `Service`
      Returns:
        all schemas attached to this service artifact.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### attachWSDL

          public void attachWSDL(Wsdl wsdl)
                          throws GovernanceException

      Attach a WSDL artifact to a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `attachWSDL` in interface `Service`
      Parameters:
        `wsdl` - the WSDL to attach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### detachWSDL

          public void detachWSDL(String wsdlId)
                          throws GovernanceException

      Detach a WSDL artifact from a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `detachWSDL` in interface `Service`
      Parameters:
        `wsdlId` - the identifier of the WSDL to detach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### getAttachedWsdls

          public Wsdl[] getAttachedWsdls()
                                  throws GovernanceException

      Method to retrieve all WSDLs attached to this service artifact.
      Specified by:
        `getAttachedWsdls` in interface `Service`
      Returns:
        all WSDLs attached to this service artifact.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### attachEndpoint

          public void attachEndpoint(Endpoint endpoint)
                              throws GovernanceException

      Attach an endpoint artifact to a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `attachEndpoint` in interface `Service`
      Parameters:
        `endpoint` - the endpoint to attach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### detachEndpoint

          public void detachEndpoint(String endpointId)
                              throws GovernanceException

      Detach an endpoint artifact from a service artifact. Both the artifacts should be saved, before calling this method.
      Specified by:
        `detachEndpoint` in interface `Service`
      Parameters:
        `endpointId` - the identifier of the endpoint to detach.
      Throws:
        `GovernanceException` - if the operation failed.

    - #### getAttachedEndpoints

          public Endpoint[] getAttachedEndpoints()
                                          throws GovernanceException

      Method to retrieve all endpoints attached to this service artifact.
      Specified by:
        `getAttachedEndpoints` in interface `Service`
      Returns:
        all endpoints attached to this service artifact.
      Throws:
        `GovernanceException` - if the operation failed.

Copyright © 2017 WSO2. All rights reserved.