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.
  • Constructor Details

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

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