org.apache.imperius.spl.manager
Interface PolicyManager


public interface PolicyManager


Method Summary
 boolean createPolicy(java.lang.String policyName, java.lang.String policyString)
          Creates a policy with the specified name and string
 void deletePolicy(java.lang.String policyName)
          Deletes the policy with the given name
 void enableLogging(boolean enableOrDisable)
           
 java.lang.Object evaluatePolicy(java.lang.String policyName, java.util.Map instance)
          Evaluates the policy with the given name.
 java.lang.Object evaluatePolicyString(java.lang.String policyName, java.lang.String policyString, java.util.Map instances)
           
 java.util.Map getAllPolicies()
          Returns a map (policyName -> policy String) of all policies stored in the repository
 java.util.List getAllPolicyNames()
          Gets a list of names of all policies in the system
 java.lang.String getPolicy(java.lang.String name)
          Returns the policy as a String
 PolicyInfo getPolicyInfo(java.lang.String policyName)
          Returns a policyInfo object that contains the anchor class names and qualifiers.
 java.lang.String getSPLHome()
           
 void init(DataCollector dc, Actuator ac)
          Initializes the SPL Engine, Inputs are instances of DataCollector and Actuator
 void setSPLHome(java.lang.String location)
           
 void shutdown()
          Shutsdown the SPL Engine
 void updatePolicy(java.lang.String policyName, java.lang.String policyString)
          Updates the policy with the given name with the provided string
 boolean validatePolicyString(java.lang.String policyString)
           
 

Method Detail

getPolicy

java.lang.String getPolicy(java.lang.String name)
                           throws SPLException
Returns the policy as a String

Parameters:
name -
Returns:
Throws:
SPLException

getPolicyInfo

PolicyInfo getPolicyInfo(java.lang.String policyName)
                         throws SPLException
Returns a policyInfo object that contains the anchor class names and qualifiers.

Parameters:
policyName -
Returns:
Throws:
SPLException

createPolicy

boolean createPolicy(java.lang.String policyName,
                     java.lang.String policyString)
                     throws SPLException
Creates a policy with the specified name and string

Parameters:
policyName -
policyString -
Returns:
Throws:
SPLException

updatePolicy

void updatePolicy(java.lang.String policyName,
                  java.lang.String policyString)
                  throws SPLException
Updates the policy with the given name with the provided string

Parameters:
policyName -
policyString -
Throws:
SPLException

deletePolicy

void deletePolicy(java.lang.String policyName)
                  throws SPLException
Deletes the policy with the given name

Parameters:
policyName -
Throws:
SPLException

getAllPolicies

java.util.Map getAllPolicies()
                             throws SPLException
Returns a map (policyName -> policy String) of all policies stored in the repository

Returns:
Throws:
SPLException

getAllPolicyNames

java.util.List getAllPolicyNames()
                                 throws SPLException
Gets a list of names of all policies in the system

Returns:
Throws:
SPLException

evaluatePolicy

java.lang.Object evaluatePolicy(java.lang.String policyName,
                                java.util.Map instance)
                                throws SPLException
Evaluates the policy with the given name. The input map should be of the following format -> List of InstanceInfo objects Where InstanceInfo object contains and an empty object

Parameters:
policyName -
instance -
Returns:
Throws:
SPLException

init

void init(DataCollector dc,
          Actuator ac)
          throws SPLException,
                 java.io.IOException
Initializes the SPL Engine, Inputs are instances of DataCollector and Actuator

Parameters:
dc -
ac -
Throws:
SPLException
java.io.IOException

setSPLHome

void setSPLHome(java.lang.String location)

getSPLHome

java.lang.String getSPLHome()

evaluatePolicyString

java.lang.Object evaluatePolicyString(java.lang.String policyName,
                                      java.lang.String policyString,
                                      java.util.Map instances)
                                      throws SPLException
Throws:
SPLException

enableLogging

void enableLogging(boolean enableOrDisable)

shutdown

void shutdown()
Shutsdown the SPL Engine


validatePolicyString

boolean validatePolicyString(java.lang.String policyString)
                             throws SPLException
Throws:
SPLException