org.ow2.carol.cmi.admin
Class CMIAdmin

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

@ThreadSafe
public final class CMIAdmin
extends java.lang.Object
implements org.ow2.carol.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.
 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()
          Returns an instance of CMIAdmin.
static CMIAdmin getCMIAdmin(javax.management.ObjectName objectName, org.ow2.carol.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.lang.String getLBPolicyClassName(java.lang.String objectName)
          Returns the name of class of policy for the object with the given name.
 java.lang.String getLBStrategyClassName(java.lang.String objectName)
          Returns the name of class of strategy for the object with the given name.
 java.util.Set<java.lang.String> getListPropertiesNamesForLBPolicy(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> getListPropertyForLBPolicy(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 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.util.Set<java.lang.String> getPropertiesNamesForLBPolicy(java.lang.String objectName)
          Returns the set of property names for the object with the given name.
 java.lang.String getPropertyForLBPolicy(java.lang.String objectName, java.lang.String propertyName)
          Returns the value of the property with the given name.
 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)
           
 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>> retrieveAvailableLBPoliciesAndStrategies()
          Gets available load balancing policies and strategies.
 void setAlgorithmForLBPolicy(java.lang.String objectName, java.lang.String lbPolicyClassName, java.lang.String lbStrategyClassName, java.util.Map<java.lang.String,java.lang.Object> properties)
          Sets the algorithm of load-balancing for the object with the given name.
static void setCMIAdmin(CMIAdmin cmiAdmin)
          Set the instance of CMIAdmin.
 void setDelayToRefresh(java.lang.Integer delay)
          Sets the time between each update of the cluster view by clients.
 void setLBPolicyClassName(java.lang.String objectName, java.lang.String lbPolicyClassName)
          Sets a new policy for a given object.
 void setLBStrategyClassName(java.lang.String objectName, java.lang.String lbStrategyClassName)
          Sets a new strategy for a given object.
 void setListPropertyForLBPolicy(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 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 setPropertiesForLBPolicy(java.lang.String objectName, java.util.Map<java.lang.String,java.lang.Object> properties)
          Sets the properties for a given object.
 void setPropertyForLBPolicy(java.lang.String objectName, java.lang.String propertyName, java.lang.String propertyValue)
          Sets a property 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.carol.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()
Returns an instance of CMIAdmin.

Returns:
an instance of CMIAdmin

setCMIAdmin

public static void setCMIAdmin(CMIAdmin cmiAdmin)
Set the instance of CMIAdmin.

Parameters:
cmiAdmin - an instance of CMIAdmin or null

getObjectName

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

Specified by:
getObjectName in interface org.ow2.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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

getLBPolicyClassName

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

Specified by:
getLBPolicyClassName in interface org.ow2.carol.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

setLBPolicyClassName

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

Specified by:
setLBPolicyClassName in interface org.ow2.carol.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
lbPolicyClassName - a name of class of LB 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

getLBStrategyClassName

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

Specified by:
getLBStrategyClassName in interface org.ow2.carol.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

setLBStrategyClassName

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

Specified by:
setLBStrategyClassName in interface org.ow2.carol.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
lbStrategyClassName - a name of class of LB 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

getPropertiesNamesForLBPolicy

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

Specified by:
getPropertiesNamesForLBPolicy in interface org.ow2.carol.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

getListPropertiesNamesForLBPolicy

public java.util.Set<java.lang.String> getListPropertiesNamesForLBPolicy(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:
getListPropertiesNamesForLBPolicy in interface org.ow2.carol.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

getPropertyForLBPolicy

public java.lang.String getPropertyForLBPolicy(java.lang.String objectName,
                                               java.lang.String propertyName)
                                        throws java.lang.IllegalArgumentException
Returns the value of the property with the given name.

Specified by:
getPropertyForLBPolicy in interface org.ow2.carol.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

getListPropertyForLBPolicy

public java.util.List<java.lang.String> getListPropertyForLBPolicy(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:
getListPropertyForLBPolicy in interface org.ow2.carol.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

setPropertyForLBPolicy

public void setPropertyForLBPolicy(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:
setPropertyForLBPolicy in interface org.ow2.carol.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 if the property doesn't exist or has an invalid type
java.lang.UnsupportedOperationException - if the used manager is at client-side

setListPropertyForLBPolicy

public void setListPropertyForLBPolicy(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:
setListPropertyForLBPolicy in interface org.ow2.carol.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

setPropertiesForLBPolicy

public void setPropertiesForLBPolicy(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:
setPropertiesForLBPolicy in interface org.ow2.carol.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

setAlgorithmForLBPolicy

public void setAlgorithmForLBPolicy(java.lang.String objectName,
                                    java.lang.String lbPolicyClassName,
                                    java.lang.String lbStrategyClassName,
                                    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:
setAlgorithmForLBPolicy in interface org.ow2.carol.cmi.admin.CMIAdminMBean
Parameters:
objectName - a name of object
lbPolicyClassName - a name of class of LB policy
lbStrategyClassName - a name of class of LB 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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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

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.carol.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

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.carol.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.carol.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.carol.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.carol.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.carol.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.carol.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

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.carol.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.carol.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

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.carol.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.carol.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.carol.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 LB strategy or LB policy class.

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

retrieveAvailableLBPoliciesAndStrategies

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

Specified by:
retrieveAvailableLBPoliciesAndStrategies in interface org.ow2.carol.cmi.admin.CMIAdminMBean
Returns:
Availaible LB strategies adn policies
Throws:
java.lang.UnsupportedOperationException - if the operation is not supported


Copyright © 2008 OW2 Consortium. All Rights Reserved.