org.wso2.carbon.governance.api.sla
Class SLAManager

java.lang.Object
  extended by org.wso2.carbon.governance.api.sla.SLAManager

public class SLAManager
extends Object

This provides the management functionality for sla artifacts stored on the registry.


Constructor Summary
SLAManager(Registry registry)
          Constructor accepting an instance of the registry to use.
 
Method Summary
 void addSLA(SLA sla)
          Adds the given sla artifact to the registry.
 SLA[] findSLA(SLAFilter criteria)
          Finds all sla artifacts matching the given filter criteria.
 SLA[] getAllSLA()
          Finds all sla artifacts on the registry.
 String[] getAllSLAIds()
          Finds all identifiers of the sla artifacts on the registry.
 SLA getSLA(String slaId)
          Fetches the given sla artifact on the registry.
 SLA newSLA(org.apache.axiom.om.OMElement content)
          Creates a new sla artifact from the given content.
 SLA newSLA(QName qName)
          Creates a new sla artifact from the given qualified name.
 void removeSLA(String slaId)
          Removes the given sla artifact from the registry.
protected  void setContent(SLA sla, Resource slaResource)
          Sets content of the given sla artifact to the given resource on the registry.
 void updateSLA(SLA sla)
          Updates the given sla artifact on the registry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SLAManager

public SLAManager(Registry registry)
Constructor accepting an instance of the registry to use.

Parameters:
registry - the instance of the registry.
Method Detail

newSLA

public SLA newSLA(QName qName)
           throws GovernanceException
Creates a new sla artifact from the given qualified name.

Parameters:
qName - the qualified name of this sla.
Returns:
the artifact added.
Throws:
GovernanceException - if the operation failed.

newSLA

public SLA newSLA(org.apache.axiom.om.OMElement content)
           throws GovernanceException
Creates a new sla artifact from the given content.

Parameters:
content - the sla content.
Returns:
the artifact added.
Throws:
GovernanceException - if the operation failed.

addSLA

public void addSLA(SLA sla)
            throws GovernanceException
Adds the given sla artifact to the registry.

Parameters:
sla - the sla artifact.
Throws:
GovernanceException - if the operation failed.

updateSLA

public void updateSLA(SLA sla)
               throws GovernanceException
Updates the given sla artifact on the registry.

Parameters:
sla - the sla artifact.
Throws:
GovernanceException - if the operation failed.

getSLA

public SLA getSLA(String slaId)
           throws GovernanceException
Fetches the given sla artifact on the registry.

Parameters:
slaId - the identifier of the sla artifact.
Returns:
the sla artifact.
Throws:
GovernanceException - if the operation failed.

removeSLA

public void removeSLA(String slaId)
               throws GovernanceException
Removes the given sla artifact from the registry.

Parameters:
slaId - the identifier of the sla artifact.
Throws:
GovernanceException - if the operation failed.

setContent

protected void setContent(SLA sla,
                          Resource slaResource)
                   throws GovernanceException
Sets content of the given sla artifact to the given resource on the registry.

Parameters:
sla - the sla artifact.
slaResource - the content resource.
Throws:
GovernanceException - if the operation failed.

findSLA

public SLA[] findSLA(SLAFilter criteria)
              throws GovernanceException
Finds all sla artifacts matching the given filter criteria.

Parameters:
criteria - the filter criteria to be matched.
Returns:
the sla artifacts that match.
Throws:
GovernanceException - if the operation failed.

getAllSLA

public SLA[] getAllSLA()
                throws GovernanceException
Finds all sla artifacts on the registry.

Returns:
all sla artifacts on the registry.
Throws:
GovernanceException - if the operation failed.

getAllSLAIds

public String[] getAllSLAIds()
                      throws GovernanceException
Finds all identifiers of the sla artifacts on the registry.

Returns:
an array of identifiers of the sla artifacts.
Throws:
GovernanceException - if the operation failed.


Copyright © 2011 WSO2 Inc. All Rights Reserved.