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

java.lang.Object
  extended by org.wso2.carbon.governance.api.common.dataobjects.GovernanceArtifact
      extended by org.wso2.carbon.governance.api.services.dataobjects.Service

public class Service
extends GovernanceArtifact

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.GovernanceArtifact
attributes
 
Constructor Summary
Service(String id, org.apache.axiom.om.OMElement serviceContentElement)
          Constructor accepting resource identifier and the service content.
Service(String id, QName qName)
          Constructor accepting resource identifier and the qualified name.
 
Method Summary
 void activate()
          Method to activate this service.
 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()
          Method to deactivate this service.
 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()
          Method to obtain whether this service is active or not.
 void setActive(boolean isActive)
          Method to set/unset the active status of this service.
 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.GovernanceArtifact
addAttribute, associateRegistry, attach, checkRegistryResourceAssociation, createVersion, detach, getAssociatedRegistry, getAttribute, getAttributeKeys, getAttributes, getDependencies, getDependents, getId, getPath, removeAttribute, setAttribute, setAttributes, setId, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Service

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

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

Service

public Service(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 class: GovernanceArtifact
Returns the QName of the artifact.

Specified by:
getQName in class 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.

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

activate

public void activate()
              throws GovernanceException
Method to activate this service.

Throws:
GovernanceException - if the operation failed.

deactivate

public void deactivate()
                throws GovernanceException
Method to deactivate this service.

Throws:
GovernanceException - if the operation failed.

setActive

public void setActive(boolean isActive)
               throws GovernanceException
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
Method to obtain whether this service is active or not.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Returns:
all endpoints attached to this service artifact.
Throws:
GovernanceException - if the operation failed.


Copyright © 2010 WSO2 Inc. All Rights Reserved.