org.ow2.cmi.admin
Class CMIAdmin

java.lang.Object
  extended by org.ow2.cmi.admin.CMIAdmin
All Implemented Interfaces:
org.ow2.cmi.admin.CMIAdminMBean

@ThreadSafe
public final class CMIAdmin
extends java.lang.Object
implements org.ow2.cmi.admin.CMIAdminMBean

Provides methods to admin a cluster. This class is a front end for users of cluster. Low level aspects are delegated at a ClusterViewManager.

Author:
The new CMI team

Method Summary
 void addPooltoEmpty(java.lang.String objectName)
          Adds the pool of the object with the given name of the list of pool that should be empty.
 void addServerToBlackList(java.lang.String serverName)
          Adds a server to the blacklist.
static void destroy()
          Destroy the instance of CMIAdmin.
 java.lang.String getBusinessName(java.lang.String objectName)
          Returns the business interface name of an object bound with the given name (for ejb2 only).
 java.lang.String getClusterName(java.lang.String objectName)
          Returns the name of cluster for the object with the given name.
 java.util.Set<java.lang.String> getClusterNames()
          Returns the set of name of cluster.
static CMIAdmin getCMIAdmin(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
           
static CMIAdmin getCMIAdmin(javax.management.ObjectName objectName, org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
          Returns an instance of CMIAdmin MBean.
 java.lang.Integer getDelayToRefresh()
          Returns the time between each update of the cluster view by clients.
 java.lang.String getItfName(java.lang.String objectName)
          Returns a name of interface of this object.
 javax.management.remote.JMXServiceURL getJMXServiceURL(java.lang.String protocolName)
           
 java.util.Set<java.lang.String> getListPropertiesNamesForPolicy(java.lang.String objectName)
          Returns the set of property names (for which value is a list) for the object with the given name.
 java.util.List<java.lang.String> getListPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName)
          Returns the list of value of the property with the given name.
 java.lang.Integer getLoadFactor(java.lang.String serverRef)
          Returns the load-factor for the server with the given address.
 java.lang.Integer getMaxPoolSize(java.lang.String objectName)
          Returns the maximal size of pool of CMIReferenceable for a object with the given name.
 java.lang.Integer getMaxPoolWaiters(java.lang.String objectName)
          Returns the max waiters of pool of CMIReferenceable for a object with the given name.
 java.lang.Integer getMinPoolSize(java.lang.String objectName)
          Returns the minimal size of pool of CMIReferenceable for a object with the given name.
 java.lang.Integer getNbClientsConnectedToProvider()
           
 javax.management.ObjectName getObjectName()
          Returns the ObjectName binded in the MBean Server.
 java.util.Set<java.lang.String> getObjectNames()
           
 java.util.Set<java.lang.String> getObjectNames(java.lang.String clusterName)
           
 java.lang.String getPolicyClassName(java.lang.String objectName)
          Returns the name of class of policy for the object with the given name.
 java.lang.Long getPoolTimeout(java.lang.String objectName)
          Returns the pool timeout of CMIReferenceable for a object with the given name.
 java.util.Set<java.lang.String> getPropertiesNamesForPolicy(java.lang.String objectName)
          Returns the set of property names for the object with the given name.
 java.lang.String getPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName)
          Returns the value of the property with the given name, from a policy instance associated to the object instance.
 java.util.Set<java.lang.String> getProtocols()
           
 java.lang.String getRefOnLocalRegistry(java.lang.String protocolName)
           
 java.util.Set<java.lang.String> getServerObjectsForProtocol(java.lang.String serverUrl, java.lang.String protocolName)
          Gets objects hosted on a given server started with a given protocol.
 java.util.List<java.lang.String> getServerRefs(java.lang.String objectName)
          Returns a list of String representing a ServerRef for an object with the given name.
 java.util.List<java.lang.String> getServerRefs(java.lang.String objectName, java.lang.String protocolName)
          Returns a list of String representing a ServerRef for an object with the given name and protocol.
 java.util.Set<java.lang.String> getServerRefsForProtocol(java.lang.String protocolName)
           
 java.lang.Object getStaticPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName)
          Returns the value of the property with the given name, retrieved from clustering metadatas.
 java.lang.String getStrategyClassName(java.lang.String objectName)
          Returns the name of class of strategy for the object with the given name.
 boolean isPoolToEmpty(java.lang.String objectName)
          Returns true if the pool for object with the given name should be empty.
 boolean isReplicated(java.lang.String objectName)
           
 boolean isServerBlackListed(java.lang.String serverName)
          Returns true the server with the given reference if blacklisted.
 java.lang.Boolean receiveFile(java.lang.Byte[] fileBuff, java.lang.String fileName, java.lang.String attributeToSet)
          Receive file from remote sender.
 void removePoolToEmpty(java.lang.String objectName)
          Removes the pool of the object with the given name of the list of pool that should be empty.
 void removeServerFromBlackList(java.lang.String serverName)
          Removes a server from the blacklist.
 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> retrieveAvailablePoliciesAndStrategies()
          Gets available load balancing policies and strategies.
 void setAlgorithmForPolicy(java.lang.String objectName, java.lang.String policyClassName, java.lang.String strategyClassName, java.util.Map<java.lang.String,java.lang.Object> properties)
          Sets the algorithm of load-balancing for the object with the given name.
 void setDelayToRefresh(java.lang.Integer delay)
          Sets the time between each update of the cluster view by clients.
 void setListPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName, java.util.List<java.lang.String> propertyValue)
          Sets a property (a list of value) for a given object.
 void setLoadFactor(java.lang.String serverRef, java.lang.String loadFactor)
          Sets the load-factor for the server with the given address.
 void setMaxPoolSize(java.lang.String objectName, java.lang.Integer maxSize)
          Sets the maximal size of pool of CMIReferenceable for a object with the given name.
 void setMaxPoolWaiters(java.lang.String objectName, java.lang.Integer maxPoolWaiters)
          Sets the max waiters of pool of CMIReferenceable for a object with the given name.
 void setMinPoolSize(java.lang.String objectName, java.lang.Integer minSize)
          Sets the minimal size of pool of CMIReferenceable for a object with the given name.
 void setPolicyClassName(java.lang.String objectName, java.lang.String policyClassName)
          Sets a new policy for a given object.
 void setPoolTimeout(java.lang.String objectName, java.lang.Long poolTimeout)
          Sets the pool timeout of CMIReferenceable for a object with the given name.
 void setPropertiesForPolicy(java.lang.String objectName, java.util.Map<java.lang.String,java.lang.Object> properties)
          Sets the properties for a given object.
 void setPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName, java.lang.String propertyValue)
          Sets a property for a given object.
 void setStaticPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName, java.lang.String propertyValue)
          Sets a property on policy class of a given object(not object instance).
 void setStrategyClassName(java.lang.String objectName, java.lang.String strategyClassName)
          Sets a new strategy for a given object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCMIAdmin

public static CMIAdmin getCMIAdmin(javax.management.ObjectName objectName,
                                   org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
Returns an instance of CMIAdmin MBean.

Parameters:
objectName - the name binded in the MBean Server
clusterViewManager - the manager of the cluster view to use
Returns:
an instance of CMIAdmin MBean

getCMIAdmin

public static CMIAdmin getCMIAdmin(org.ow2.cmi.controller.common.ClusterViewManager clusterViewManager)
Parameters:
clusterViewManager -
Returns:

destroy

public static void destroy()
Destroy the instance of CMIAdmin.


getObjectName

public javax.management.ObjectName getObjectName()
Returns the ObjectName binded in the MBean Server.

Specified by:
getObjectName in interface org.ow2.cmi.admin.CMIAdminMBean
Returns:
the ObjectName binded in the MBean Server

getJMXServiceURL

public javax.management.remote.JMXServiceURL getJMXServiceURL(java.lang.String protocolName)
                                                       throws java.lang.IllegalArgumentException,
                                                              java.lang.UnsupportedOperationException
Specified by:
getJMXServiceURL in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
protocolName - a name of protocol
Returns:
the JMX connector URL to access to this MBean
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

getProtocols

public java.util.Set<java.lang.String> getProtocols()
Specified by:
getProtocols in interface org.ow2.cmi.admin.CMIAdminMBean
Returns:
the protocols registered in the manager

getItfName

public java.lang.String getItfName(java.lang.String objectName)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.UnsupportedOperationException
Returns a name of interface of this object.

Specified by:
getItfName in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
a name of interface of this object
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

getBusinessName

public java.lang.String getBusinessName(java.lang.String objectName)
                                 throws java.lang.IllegalArgumentException,
                                        java.lang.UnsupportedOperationException
Returns the business interface name of an object bound with the given name (for ejb2 only). If the object is not an ejb2, null is returned.

Specified by:
getBusinessName in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the business interface name of an object bound with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

isReplicated

public boolean isReplicated(java.lang.String objectName)
                     throws java.lang.IllegalArgumentException
Specified by:
isReplicated in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
true if the object with the given name is replicated
Throws:
java.lang.IllegalArgumentException - if none object has the given name

getServerRefsForProtocol

public java.util.Set<java.lang.String> getServerRefsForProtocol(java.lang.String protocolName)
                                                         throws java.lang.IllegalArgumentException,
                                                                java.lang.UnsupportedOperationException
Specified by:
getServerRefsForProtocol in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
protocolName - a name of protocol
Returns:
the set of references on server connected to this server
Throws:
java.lang.IllegalArgumentException - if the given protocol name doesn't exist
java.lang.UnsupportedOperationException - if the used manager is at client-side

getServerObjectsForProtocol

public java.util.Set<java.lang.String> getServerObjectsForProtocol(java.lang.String serverUrl,
                                                                   java.lang.String protocolName)
                                                            throws java.lang.IllegalArgumentException,
                                                                   java.lang.UnsupportedOperationException
Gets objects hosted on a given server started with a given protocol.

Specified by:
getServerObjectsForProtocol in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
serverUrl - a server reference
protocolName - a name of protocol
Returns:
set of objects hosted on the server
Throws:
java.lang.IllegalArgumentException - if the given protocol name doesn't exist or the server is not registered for the given protocol
java.lang.UnsupportedOperationException - if the used manager is at client-side

getObjectNames

public java.util.Set<java.lang.String> getObjectNames()
Specified by:
getObjectNames in interface org.ow2.cmi.admin.CMIAdminMBean
Returns:
the set of clustered object names

getRefOnLocalRegistry

public java.lang.String getRefOnLocalRegistry(java.lang.String protocolName)
                                       throws java.lang.IllegalArgumentException,
                                              java.lang.UnsupportedOperationException
Specified by:
getRefOnLocalRegistry in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
protocolName - a name of protocol
Returns:
the reference on the local registry for the given protocol
Throws:
java.lang.IllegalArgumentException - if the given protocol name doesn't exist
java.lang.UnsupportedOperationException - if the used manager is at client-side

getPolicyClassName

public java.lang.String getPolicyClassName(java.lang.String objectName)
                                    throws java.lang.IllegalArgumentException
Returns the name of class of policy for the object with the given name.

Specified by:
getPolicyClassName in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - name of the object
Returns:
the name of class of policy for the object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

setPolicyClassName

public void setPolicyClassName(java.lang.String objectName,
                               java.lang.String policyClassName)
                        throws java.lang.IllegalArgumentException,
                               java.lang.UnsupportedOperationException,
                               java.lang.ClassNotFoundException
Sets a new policy for a given object.

Specified by:
setPolicyClassName in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
policyClassName - a name of class of policy
Throws:
java.lang.IllegalArgumentException - if none object has the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side
java.lang.ClassNotFoundException - if the class is missing

getStrategyClassName

public java.lang.String getStrategyClassName(java.lang.String objectName)
                                      throws java.lang.IllegalArgumentException
Returns the name of class of strategy for the object with the given name.

Specified by:
getStrategyClassName in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - name of the object
Returns:
the name of class of strategy for the object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

setStrategyClassName

public void setStrategyClassName(java.lang.String objectName,
                                 java.lang.String strategyClassName)
                          throws java.lang.IllegalArgumentException,
                                 java.lang.UnsupportedOperationException,
                                 java.lang.ClassNotFoundException
Sets a new strategy for a given object.

Specified by:
setStrategyClassName in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
strategyClassName - a name of class of strategy
Throws:
java.lang.IllegalArgumentException - if none object has the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side
java.lang.ClassNotFoundException - if the class is missing

getPropertiesNamesForPolicy

public java.util.Set<java.lang.String> getPropertiesNamesForPolicy(java.lang.String objectName)
                                                            throws java.lang.IllegalArgumentException
Returns the set of property names for the object with the given name.

Specified by:
getPropertiesNamesForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the set of property names for the object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

getListPropertiesNamesForPolicy

public java.util.Set<java.lang.String> getListPropertiesNamesForPolicy(java.lang.String objectName)
                                                                throws java.lang.IllegalArgumentException
Returns the set of property names (for which value is a list) for the object with the given name.

Specified by:
getListPropertiesNamesForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the set of property names for the object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

getPropertyForPolicy

public java.lang.String getPropertyForPolicy(java.lang.String objectName,
                                             java.lang.String propertyName)
                                      throws java.lang.IllegalArgumentException
Returns the value of the property with the given name, from a policy instance associated to the object instance.

Specified by:
getPropertyForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
propertyName - a name of property
Returns:
the value of the property with the given name, or null if there is not property for this name
Throws:
java.lang.IllegalArgumentException - if none object has the given name, or if the value is a list

getStaticPropertyForPolicy

public java.lang.Object getStaticPropertyForPolicy(java.lang.String objectName,
                                                   java.lang.String propertyName)
                                            throws javax.management.JMRuntimeException,
                                                   java.lang.UnsupportedOperationException
Returns the value of the property with the given name, retrieved from clustering metadatas.

Specified by:
getStaticPropertyForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
propertyName - a name of property
Returns:
the value of the property with the given name, or null if there is not property for this name
Throws:
java.lang.IllegalArgumentException - if none object has the given name, or if the value is a list
java.lang.UnsupportedOperationException - if operation is not supported.
javax.management.JMRuntimeException

setStaticPropertyForPolicy

public void setStaticPropertyForPolicy(java.lang.String objectName,
                                       java.lang.String propertyName,
                                       java.lang.String propertyValue)
                                throws java.lang.IllegalArgumentException,
                                       java.lang.UnsupportedOperationException
Sets a property on policy class of a given object(not object instance). A property is either a String or a list of String.

Specified by:
setStaticPropertyForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
propertyName - a name of property
propertyValue - a value for the given name of property
Throws:
java.lang.IllegalArgumentException - if none object has the given name, or if the property doesn't exist or has an invalid type
java.lang.UnsupportedOperationException - if the used manager is at client-side

getListPropertyForPolicy

public java.util.List<java.lang.String> getListPropertyForPolicy(java.lang.String objectName,
                                                                 java.lang.String propertyName)
                                                          throws java.lang.IllegalArgumentException
Returns the list of value of the property with the given name.

Specified by:
getListPropertyForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
propertyName - a name of property
Returns:
the list of value of the property with the given name, or null if there is not property for this name
Throws:
java.lang.IllegalArgumentException - if none object has the given name, or if if the value is not a list

setPropertyForPolicy

public void setPropertyForPolicy(java.lang.String objectName,
                                 java.lang.String propertyName,
                                 java.lang.String propertyValue)
                          throws java.lang.IllegalArgumentException,
                                 java.lang.UnsupportedOperationException
Sets a property for a given object.

Specified by:
setPropertyForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
propertyName - a name of property
propertyValue - a value for the given name of property
Throws:
java.lang.IllegalArgumentException - if none object has the given name or if the property doesn't exist or has an invalid type
java.lang.UnsupportedOperationException - if the used manager is at client-side

setListPropertyForPolicy

public void setListPropertyForPolicy(java.lang.String objectName,
                                     java.lang.String propertyName,
                                     java.util.List<java.lang.String> propertyValue)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.UnsupportedOperationException
Sets a property (a list of value) for a given object.

Specified by:
setListPropertyForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
propertyName - a name of property
propertyValue - a list of value for the given name of property
Throws:
java.lang.IllegalArgumentException - if none object has the given name, or if the property doesn't exist or has an invalid type
java.lang.UnsupportedOperationException - if the used manager is at client-side

setPropertiesForPolicy

public void setPropertiesForPolicy(java.lang.String objectName,
                                   java.util.Map<java.lang.String,java.lang.Object> properties)
                            throws java.lang.IllegalArgumentException,
                                   java.lang.UnsupportedOperationException
Sets the properties for a given object. A property is either a String or a list of String.

Specified by:
setPropertiesForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
properties - properties a set of properties
Throws:
java.lang.IllegalArgumentException - if none object has the given name, or if a property doesn't exist or has an invalid type
java.lang.UnsupportedOperationException - if the used manager is at client-side

setAlgorithmForPolicy

public void setAlgorithmForPolicy(java.lang.String objectName,
                                  java.lang.String policyClassName,
                                  java.lang.String strategyClassName,
                                  java.util.Map<java.lang.String,java.lang.Object> properties)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.UnsupportedOperationException,
                                  java.lang.ClassNotFoundException
Sets the algorithm of load-balancing for the object with the given name.

Specified by:
setAlgorithmForPolicy in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
policyClassName - a name of class of policy
strategyClassName - a name of class of strategy
properties - a set of properties
Throws:
java.lang.IllegalArgumentException - if none object has the given name, or if a property doesn't exist or has an invalid type
java.lang.UnsupportedOperationException - if the used manager is at client-side
java.lang.ClassNotFoundException - if the class is missing

getServerRefs

public java.util.List<java.lang.String> getServerRefs(java.lang.String objectName,
                                                      java.lang.String protocolName)
                                               throws java.lang.IllegalArgumentException
Returns a list of String representing a ServerRef for an object with the given name and protocol.

Specified by:
getServerRefs in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
protocolName - a name of protocol
Returns:
a list of String representing a ServerRef for an object with the given name and protocol
Throws:
java.lang.IllegalArgumentException - if none object has the given name

getServerRefs

public java.util.List<java.lang.String> getServerRefs(java.lang.String objectName)
                                               throws java.lang.IllegalArgumentException,
                                                      java.lang.UnsupportedOperationException
Returns a list of String representing a ServerRef for an object with the given name.

Specified by:
getServerRefs in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
a list of String representing a ServerRef for an object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

getClusterNames

public java.util.Set<java.lang.String> getClusterNames()
                                                throws java.lang.UnsupportedOperationException
Returns the set of name of cluster.

Specified by:
getClusterNames in interface org.ow2.cmi.admin.CMIAdminMBean
Returns:
the set of name of cluster
Throws:
java.lang.UnsupportedOperationException - if the used manager is at client-side

getObjectNames

public java.util.Set<java.lang.String> getObjectNames(java.lang.String clusterName)
                                               throws java.lang.UnsupportedOperationException
Specified by:
getObjectNames in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
clusterName - The cluster name
Returns:
The set of object names included in the given cluster
Throws:
java.lang.UnsupportedOperationException - if the used manager is at client-side

getDelayToRefresh

public java.lang.Integer getDelayToRefresh()
Returns the time between each update of the cluster view by clients.

Specified by:
getDelayToRefresh in interface org.ow2.cmi.admin.CMIAdminMBean
Returns:
the time between each update of the cluster view by clients

setDelayToRefresh

public void setDelayToRefresh(java.lang.Integer delay)
                       throws java.lang.UnsupportedOperationException
Sets the time between each update of the cluster view by clients.

Specified by:
setDelayToRefresh in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
delay - the time between each update of the cluster view by clients
Throws:
java.lang.UnsupportedOperationException - if the used manager is at client-side

getClusterName

public java.lang.String getClusterName(java.lang.String objectName)
                                throws java.lang.IllegalArgumentException
Returns the name of cluster for the object with the given name.

Specified by:
getClusterName in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the name of cluster for a object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

getMaxPoolSize

public java.lang.Integer getMaxPoolSize(java.lang.String objectName)
                                 throws java.lang.IllegalArgumentException
Returns the maximal size of pool of CMIReferenceable for a object with the given name.

Specified by:
getMaxPoolSize in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the maximal size of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

setMaxPoolSize

public void setMaxPoolSize(java.lang.String objectName,
                           java.lang.Integer maxSize)
                    throws java.lang.IllegalArgumentException,
                           java.lang.UnsupportedOperationException
Sets the maximal size of pool of CMIReferenceable for a object with the given name.

Specified by:
setMaxPoolSize in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
maxSize - the maximal size of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

setMinPoolSize

public void setMinPoolSize(java.lang.String objectName,
                           java.lang.Integer minSize)
                    throws java.lang.IllegalArgumentException,
                           java.lang.UnsupportedOperationException
Sets the minimal size of pool of CMIReferenceable for a object with the given name.

Specified by:
setMinPoolSize in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
minSize - the minimal size of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

getMinPoolSize

public java.lang.Integer getMinPoolSize(java.lang.String objectName)
                                 throws java.lang.IllegalArgumentException
Returns the minimal size of pool of CMIReferenceable for a object with the given name.

Specified by:
getMinPoolSize in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the minimal size of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

setMaxPoolWaiters

public void setMaxPoolWaiters(java.lang.String objectName,
                              java.lang.Integer maxPoolWaiters)
                       throws java.lang.IllegalArgumentException,
                              java.lang.UnsupportedOperationException
Sets the max waiters of pool of CMIReferenceable for a object with the given name.

Specified by:
setMaxPoolWaiters in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
maxPoolWaiters - the max waiters of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

getMaxPoolWaiters

public java.lang.Integer getMaxPoolWaiters(java.lang.String objectName)
                                    throws java.lang.IllegalArgumentException
Returns the max waiters of pool of CMIReferenceable for a object with the given name.

Specified by:
getMaxPoolWaiters in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the maximal waiters of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

setPoolTimeout

public void setPoolTimeout(java.lang.String objectName,
                           java.lang.Long poolTimeout)
                    throws java.lang.IllegalArgumentException,
                           java.lang.UnsupportedOperationException
Sets the pool timeout of CMIReferenceable for a object with the given name.

Specified by:
setPoolTimeout in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
poolTimeout - the timeout of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

getPoolTimeout

public java.lang.Long getPoolTimeout(java.lang.String objectName)
                              throws java.lang.IllegalArgumentException
Returns the pool timeout of CMIReferenceable for a object with the given name.

Specified by:
getPoolTimeout in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
the timeout of pool of CMIReferenceable for a object with the given name
Throws:
java.lang.IllegalArgumentException - if none object has the given name

isPoolToEmpty

public boolean isPoolToEmpty(java.lang.String objectName)
                      throws java.lang.IllegalArgumentException
Returns true if the pool for object with the given name should be empty.

Specified by:
isPoolToEmpty in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Returns:
true if the pool for object with the given name should be empty
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name

isServerBlackListed

public boolean isServerBlackListed(java.lang.String serverName)
                            throws java.lang.UnsupportedOperationException,
                                   java.net.MalformedURLException,
                                   java.net.UnknownHostException
Returns true the server with the given reference if blacklisted.

Specified by:
isServerBlackListed in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
serverName - a reference on a server
Returns:
true the server with the given reference if blacklisted
Throws:
java.lang.UnsupportedOperationException - if the used manager is at client-side
java.net.MalformedURLException - if the URL is malformed
java.net.UnknownHostException - if the given host cannot be resolved

addPooltoEmpty

public void addPooltoEmpty(java.lang.String objectName)
                    throws java.lang.IllegalArgumentException,
                           java.lang.UnsupportedOperationException
Adds the pool of the object with the given name of the list of pool that should be empty.

Specified by:
addPooltoEmpty in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

addServerToBlackList

public void addServerToBlackList(java.lang.String serverName)
                          throws java.lang.UnsupportedOperationException,
                                 java.net.MalformedURLException,
                                 java.net.UnknownHostException
Adds a server to the blacklist.

Specified by:
addServerToBlackList in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
serverName - a reference on a server
Throws:
java.lang.UnsupportedOperationException - if the used manager is at client-side
java.net.MalformedURLException - if the URL is malformed
java.net.UnknownHostException - if the given host cannot be resolved

removePoolToEmpty

public void removePoolToEmpty(java.lang.String objectName)
                       throws java.lang.IllegalArgumentException,
                              java.lang.UnsupportedOperationException
Removes the pool of the object with the given name of the list of pool that should be empty.

Specified by:
removePoolToEmpty in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
Throws:
java.lang.IllegalArgumentException - if no object is bound with the given name
java.lang.UnsupportedOperationException - if the used manager is at client-side

removeServerFromBlackList

public void removeServerFromBlackList(java.lang.String serverName)
                               throws java.lang.UnsupportedOperationException,
                                      java.net.MalformedURLException,
                                      java.net.UnknownHostException
Removes a server from the blacklist.

Specified by:
removeServerFromBlackList in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
serverName - a reference on a server
Throws:
java.lang.UnsupportedOperationException - if the used manager is at client-side
java.net.MalformedURLException - if the URL is malformed
java.net.UnknownHostException - if the given host cannot be resolved

getLoadFactor

public java.lang.Integer getLoadFactor(java.lang.String serverRef)
                                throws java.lang.IllegalArgumentException,
                                       java.net.MalformedURLException,
                                       java.net.UnknownHostException
Returns the load-factor for the server with the given address.

Specified by:
getLoadFactor in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
serverRef - a reference on a server
Returns:
the load-factor for the server with the given address
Throws:
java.lang.IllegalArgumentException - if none server has the given address
java.net.MalformedURLException - if the URL is malformed
java.net.UnknownHostException - if the given host cannot be resolved

setLoadFactor

public void setLoadFactor(java.lang.String serverRef,
                          java.lang.String loadFactor)
                   throws java.lang.UnsupportedOperationException,
                          java.net.MalformedURLException,
                          java.net.UnknownHostException
Sets the load-factor for the server with the given address.

Specified by:
setLoadFactor in interface org.ow2.cmi.admin.CMIAdminMBean
Parameters:
serverRef - a reference on a server
loadFactor - the load-factor for the server with the given address
Throws:
java.lang.UnsupportedOperationException - if the used manager is at client-side
java.net.MalformedURLException - if the URL is malformed
java.net.UnknownHostException - if the given host cannot be resolved

getNbClientsConnectedToProvider

public java.lang.Integer getNbClientsConnectedToProvider()
Specified by:
getNbClientsConnectedToProvider in interface org.ow2.cmi.admin.CMIAdminMBean
Returns:
the numbers of clients connected to a provider of the cluster view

receiveFile

public java.lang.Boolean receiveFile(java.lang.Byte[] fileBuff,
                                     java.lang.String fileName,
                                     java.lang.String attributeToSet)
                              throws java.lang.IllegalArgumentException,
                                     java.lang.UnsupportedOperationException
Receive file from remote sender. Used to set strategy or policy class.

Parameters:
fileBuff - Byte buffer
fileName - The file name
attributeToSet - The attribute to set policies || strategies
Returns:
Throws:
java.lang.IllegalArgumentException
java.lang.UnsupportedOperationException

retrieveAvailablePoliciesAndStrategies

public java.util.Map<java.lang.String,java.util.Set<java.lang.String>> retrieveAvailablePoliciesAndStrategies()
                                                                                                       throws java.lang.UnsupportedOperationException
Gets available load balancing policies and strategies.

Specified by:
retrieveAvailablePoliciesAndStrategies in interface org.ow2.cmi.admin.CMIAdminMBean
Returns:
available policies and strategies
Throws:
java.lang.UnsupportedOperationException - if the operation is not supported


Copyright © 2009 OW2 Consortium. All Rights Reserved.