org.ow2.cmi.controller.server
Interface IPolicyStrategyManager


public interface IPolicyStrategyManager

Interface for strategy/policy managers. The server-side manager delegates management of policies and strategies to this manager.

Author:
The new CMI team

Method Summary
 void addDefaultPolicyClassName(java.lang.String objectName, java.lang.String policyClassName)
          Add default policy for the objectName parameter.
 void addDefaultStrategyClassName(java.lang.String objectName, java.lang.String strategyClassName)
          Add default strategy for the objectName parameter.
 java.lang.Object addLoadBalancingArchive(byte[] bytesOfFile, java.lang.String location, java.lang.Class<?>[] policies, java.lang.Class<?>[] strategies)
          Receives archive containing load balancing classes.
 void addPolicyClass(java.lang.Class<? extends IPolicy<?>> policyClass, boolean overwrite)
          Add a policy class.
 void addStrategyClass(java.lang.Class<? extends IStrategy<?>> strategyClass, boolean overwrite)
          Add a strategy class.
 java.lang.Class<? extends IPolicy<?>> getPolicyClass(java.lang.String objectName)
          Returns the class that defines the policy for an object with the given name.
 java.util.Collection<? extends java.lang.String> getPolicyClassNames()
          Get all the policies.
 java.lang.Class<? extends IStrategy<?>> getStrategyClass(java.lang.String objectName)
          Returns the class that defines the strategy for an object with the given name.
 java.util.Collection<? extends java.lang.String> getStrategyClassNames()
          Get all the strategies.
 boolean isEmbeddedPolicy(java.lang.String className)
          Return true if the given class name is embedded policy class.
 boolean isEmbeddedStrategy(java.lang.String className)
          Return true if the given class name is embedded strategy class.
 void loadEmbeddedLBClasses()
          Load classes embedded in the CMI distribution.
 void removeLoadBalancingArchive(java.lang.Object archiveId, java.lang.String[] policies, java.lang.String[] strategies, boolean isArchiveOwner)
          Remove Load Balancing Archive, previously added.
 

Method Detail

getPolicyClass

java.lang.Class<? extends IPolicy<?>> getPolicyClass(java.lang.String objectName)
                                                     throws ObjectNotFoundException,
                                                            ServerClusterViewManagerException
Returns the class that defines the policy for an object with the given name.

Parameters:
objectName - a name of object
Returns:
the class that defines the policy for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name
ServerClusterViewManagerException - if the class cannot be loaded

getStrategyClass

java.lang.Class<? extends IStrategy<?>> getStrategyClass(java.lang.String objectName)
                                                         throws ObjectNotFoundException,
                                                                ServerClusterViewManagerException
Returns the class that defines the strategy for an object with the given name.

Parameters:
objectName - a name of object
Returns:
the class that defines the strategy for an object with the given name
Throws:
ObjectNotFoundException - if none object has the given name
ServerClusterViewManagerException - if the class cannot be loaded

addLoadBalancingArchive

java.lang.Object addLoadBalancingArchive(byte[] bytesOfFile,
                                         java.lang.String location,
                                         java.lang.Class<?>[] policies,
                                         java.lang.Class<?>[] strategies)
Receives archive containing load balancing classes. The server cluster view manager delegate the call to the policy/Strategy manager. Since complex treatment might be performed, to assume the reception of the archive.

Parameters:
bytesOfFile - Bytes content of the file
location - File location
strategies - policies exported by the archive
policies - strategies exported by the archive
Returns:
The archive Id used by PolicyStrategyManager to register the new archive.

addStrategyClass

void addStrategyClass(java.lang.Class<? extends IStrategy<?>> strategyClass,
                      boolean overwrite)
                      throws ServerClusterViewManagerException
Add a strategy class.

Parameters:
strategyClass - the strategy class to add.
overwrite - if true then existing class with the given name be overwritten.
Throws:
ServerClusterViewManagerException - if strategyClass cannot be added.

addPolicyClass

void addPolicyClass(java.lang.Class<? extends IPolicy<?>> policyClass,
                    boolean overwrite)
                    throws ServerClusterViewManagerException
Add a policy class.

Parameters:
policyClass - the policy class to add.
overwrite - if true then existing class with the given name be overwritten.
Throws:
ServerClusterViewManagerException - if policyClass cannot be added.

removeLoadBalancingArchive

void removeLoadBalancingArchive(java.lang.Object archiveId,
                                java.lang.String[] policies,
                                java.lang.String[] strategies,
                                boolean isArchiveOwner)
                                throws java.lang.Exception
Remove Load Balancing Archive, previously added.

Parameters:
archiveId - The Id of the archive.
policies - names of the policies to remove
strategies - names of the policies to remove
isArchiveOwner - if true then the call is performed by the archive owner. The archive owner is the first server that deployed the archive.
Throws:
java.lang.Exception

addDefaultPolicyClassName

void addDefaultPolicyClassName(java.lang.String objectName,
                               java.lang.String policyClassName)
Add default policy for the objectName parameter.

Parameters:
objectName - name of the object.
policyClassName - the policy name

addDefaultStrategyClassName

void addDefaultStrategyClassName(java.lang.String objectName,
                                 java.lang.String strategyClassName)
Add default strategy for the objectName parameter.

Parameters:
objectName - name of the object.
strategyClassName - the policy name

getPolicyClassNames

java.util.Collection<? extends java.lang.String> getPolicyClassNames()
Get all the policies.

Returns:
the policy class names.

getStrategyClassNames

java.util.Collection<? extends java.lang.String> getStrategyClassNames()
Get all the strategies.

Returns:
the strategy class names.

loadEmbeddedLBClasses

void loadEmbeddedLBClasses()
Load classes embedded in the CMI distribution.


isEmbeddedPolicy

boolean isEmbeddedPolicy(java.lang.String className)
Return true if the given class name is embedded policy class.

Parameters:
className - a name of class
Returns:
true if the given class name is embedded policy class

isEmbeddedStrategy

boolean isEmbeddedStrategy(java.lang.String className)
Return true if the given class name is embedded strategy class.

Parameters:
className - a name of class
Returns:
true if the given class name is embedded strategy class


Copyright © 2009 OW2 Consortium. All Rights Reserved.