org.ow2.carol.cmi.controller.server
Interface ServerClusterViewManager

All Superinterfaces:
ClusterViewManager, SmartConnector

public interface ServerClusterViewManager
extends ClusterViewManager, SmartConnector

Interface for a manager of the cluster view at server-side.

Author:
The new CMI team

Method Summary
 void addObjectInstance(ClusteredObjectInfo clusteredObjectInfo, CMIReference cmiReference)
          Adds an instance of a clustered object.
 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 addProtocol(java.lang.String initialContextFactoryName, ServerRef serverRef, javax.naming.Context cmiContext)
          Adds a new protocol.
 void addServerToBlackList(ServerRef serverRef)
          Adds a server to the blacklist.
 java.lang.String getBusinessName(java.lang.String objectName)
          Returns a name of business interface of this object (for ejb2 only).
 java.util.Set<java.lang.String> getClusterNames()
          Returns the set of name of cluster.
 java.util.List<CMIReference> getCMIReferences(java.lang.String objectName)
          Returns a list of CMIReference for an object with the given name.
 java.net.InetAddress getInetAddress()
          Returns the address of the local registries.
 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)
           
 int getNbClientsConnectedToProvider()
           
 java.util.Set<java.lang.String> getObjectNames()
           
 java.util.Set<java.lang.String> getObjectNames(java.lang.String clusterName)
          Returns the set of name of object for a given name of cluster.
 java.util.List<java.lang.String> getProviderURLs(java.lang.String protocolName)
          Returns the list of Provider URL.
 ServerRef getRefOnLocalRegistry(java.lang.String protocolName)
           
 java.util.Set<ServerRef> getServerRefs(java.lang.String protocolName)
           
 boolean isReplicationManagerStarted()
           
 boolean isServerBlackListed(ServerRef serverRef)
          Returns true the server with the given reference if blacklisted.
 void registerClient(java.util.UUID uuid)
          Register a new client.
 void removeCMIReference(CMIReference cmiReference)
          Removes a CMIReference from the cluster view.
 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(ServerRef serverRef)
          Removes a server to the blacklist.
 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.
 void setDelayToRefresh(int 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 policy for a given object.
 void setLoadFactor(ServerRef serverRef, int loadFactor)
          Sets the load-factor for the server with the given address.
 void setMaxPoolSize(java.lang.String objectName, int maxPoolSize)
          Sets the maximal size of pool of CMIReferenceable for a object with the given name.
 void setMinPoolSize(java.lang.String objectName, int minPoolSize)
          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 properties for a given object.
 void setPropertyForLBPolicy(java.lang.String objectName, java.lang.String propertyName, java.lang.Object propertyValue)
          Sets a property for a given object.
 void setReplicationManagerStarted(boolean replicationManagerStarted)
          Set if the replication manager is started.
 
Methods inherited from interface org.ow2.carol.cmi.controller.common.ClusterViewManager
addObjectToWatch, getClusterName, getCMIReferences, getDateOfProperties, getDelayToRefresh, getInitialContextFactoryName, getInterface, getLBPolicy, getLBPolicyClass, getLBPolicyClassName, getLBStrategyClass, getLBStrategyClassName, getLoadFactor, getMaxPoolSize, getMinPoolSize, getPool, getPropertiesForLBPolicy, getPropertyForLBPolicy, getProtocols, getRemoteClass, getSessionId, getUUID, isClustered, isPoolToEmpty, isReplicated, setPool
 
Methods inherited from interface org.ow2.carol.cmi.smart.api.SmartConnector
getInitialContextFactoryName
 

Method Detail

setLBPolicyClassName

void setLBPolicyClassName(java.lang.String objectName,
                          java.lang.String lbPolicyClassName)
                          throws ObjectNotFoundException
Sets a new policy for a given object.

Parameters:
objectName - a name of object
lbPolicyClassName - a name of class of LB policy
Throws:
ObjectNotFoundException - if no object is bound with the given name

setLBStrategyClassName

void setLBStrategyClassName(java.lang.String objectName,
                            java.lang.String lbStrategyClassName)
                            throws ObjectNotFoundException
Sets a new policy for a given object.

Parameters:
objectName - a name of object
lbStrategyClassName - a name of class of LB strategy
Throws:
ObjectNotFoundException - if no object is bound with the given name

setPropertiesForLBPolicy

void setPropertiesForLBPolicy(java.lang.String objectName,
                              java.util.Map<java.lang.String,java.lang.Object> properties)
                              throws ObjectNotFoundException
Sets properties for a given object.

Parameters:
objectName - a name of object
properties - properties for the LB policy of the given object
Throws:
ObjectNotFoundException - if the specified object doesn't exist

setPropertyForLBPolicy

void setPropertyForLBPolicy(java.lang.String objectName,
                            java.lang.String propertyName,
                            java.lang.Object propertyValue)
                            throws ObjectNotFoundException
Sets a property for a given object.

Parameters:
objectName - a name of object
propertyName - a name of property for the LB policy of the given object
propertyValue - a value for the given name of property
Throws:
ObjectNotFoundException - if the specified object doesn't exist

setAlgorithmForLBPolicy

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 ObjectNotFoundException
Sets the algorithm of load-balancing for the object with the given name.

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:
ObjectNotFoundException - if none object has the given name

getCMIReferences

java.util.List<CMIReference> getCMIReferences(java.lang.String objectName)
                                              throws ObjectNotFoundException
Returns a list of CMIReference for an object with the given name.

Parameters:
objectName - a name of object
Returns:
a list of CMIReference for an object with the given name
Throws:
ObjectNotFoundException - if no object is bound with the given name

removeCMIReference

void removeCMIReference(CMIReference cmiReference)
Removes a CMIReference from the cluster view.

Parameters:
cmiReference - a reference on a clustered object

getClusterNames

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

Returns:
a set of name of cluster

getObjectNames

java.util.Set<java.lang.String> getObjectNames()
Specified by:
getObjectNames in interface ClusterViewManager
Returns:
the set of name of object

getObjectNames

java.util.Set<java.lang.String> getObjectNames(java.lang.String clusterName)
Returns the set of name of object for a given name of cluster.

Parameters:
clusterName - a name of cluster
Returns:
the set of name of object for a given name of cluster

addObjectInstance

void addObjectInstance(ClusteredObjectInfo clusteredObjectInfo,
                       CMIReference cmiReference)
                       throws ServerClusterViewManagerException
Adds an instance of a clustered object.

Parameters:
clusteredObjectInfo - informations on a clustered object
cmiReference - reference on a clustered object
Throws:
ServerClusterViewManagerException - if the object cannot be added to the cluster.

getItfName

java.lang.String getItfName(java.lang.String objectName)
                            throws ObjectNotFoundException
Returns a name of interface of this object.

Parameters:
objectName - a name of object
Returns:
a name of interface of this object
Throws:
ObjectNotFoundException - if no object is bound with the given name

getBusinessName

java.lang.String getBusinessName(java.lang.String objectName)
                                 throws ObjectNotFoundException
Returns a name of business interface of this object (for ejb2 only).

Parameters:
objectName - a name of object
Returns:
a name of business interface of this object
Throws:
ObjectNotFoundException - if no object is bound with the given name

getProviderURLs

java.util.List<java.lang.String> getProviderURLs(java.lang.String protocolName)
                                                 throws ServerClusterViewManagerException
Returns the list of Provider URL.

Specified by:
getProviderURLs in interface SmartConnector
Parameters:
protocolName - a name of protocol
Returns:
providers of the cluster view for the protocol with the given name
Throws:
ServerClusterViewManagerException - if none provider exists for the protocol with the given name

addProtocol

void addProtocol(java.lang.String initialContextFactoryName,
                 ServerRef serverRef,
                 javax.naming.Context cmiContext)
                 throws ServerClusterViewManagerException
Adds a new protocol. This method also binds a provider of the cluster view for clients and a dummy context, into the given instance of CMIContext.

Parameters:
initialContextFactoryName - a InitialContextFactory for this protocol
serverRef - a reference onto the local registry
cmiContext - a instance of CMIContext to bind a provider of the cluster view for clients and a dummy context
Throws:
ServerClusterViewManagerException - if the protocol cannot be added

getInetAddress

java.net.InetAddress getInetAddress()
Returns the address of the local registries.

Returns:
the address of the local registries

setDelayToRefresh

void setDelayToRefresh(int delay)
Sets the time between each update of the cluster view by clients.

Parameters:
delay - the time between each update of the cluster view by clients

setMinPoolSize

void setMinPoolSize(java.lang.String objectName,
                    int minPoolSize)
                    throws ObjectNotFoundException
Sets the minimal size of pool of CMIReferenceable for a object with the given name.

Parameters:
objectName - a name of object
minPoolSize - the minimal size of pool of CMIReferenceable for a object with the given name
Throws:
ObjectNotFoundException - if no object is bound with the given name

setMaxPoolSize

void setMaxPoolSize(java.lang.String objectName,
                    int maxPoolSize)
                    throws ObjectNotFoundException
Sets the maximal size of pool of CMIReferenceable for a object with the given name.

Parameters:
objectName - a name of object
maxPoolSize - the maximal size of pool of CMIReferenceable for a object with the given name
Throws:
ObjectNotFoundException - if no object is bound with the given name

removePoolToEmpty

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.

Parameters:
objectName - a name of object

addPoolToEmpty

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.

Parameters:
objectName - a name of object

isServerBlackListed

boolean isServerBlackListed(ServerRef serverRef)
Returns true the server with the given reference if blacklisted.

Parameters:
serverRef - a reference on a server
Returns:
true the server with the given reference if blacklisted

addServerToBlackList

void addServerToBlackList(ServerRef serverRef)
Adds a server to the blacklist.

Parameters:
serverRef - a reference on a server

removeServerFromBlackList

void removeServerFromBlackList(ServerRef serverRef)
Removes a server to the blacklist.

Parameters:
serverRef - a reference on a server

setLoadFactor

void setLoadFactor(ServerRef serverRef,
                   int loadFactor)
Sets the load-factor for the server with the given address.

Parameters:
serverRef - a reference on a server
loadFactor - the load-factor for the server with the given address

getJMXServiceURL

javax.management.remote.JMXServiceURL getJMXServiceURL(java.lang.String protocolName)
Parameters:
protocolName - a name of protocol
Returns:
the JMX service URL to access to this MBean or null if the protocol doesn't exist

getRefOnLocalRegistry

ServerRef getRefOnLocalRegistry(java.lang.String protocolName)
Parameters:
protocolName - a name of protocol
Returns:
the reference on the local registry for the given protocol

getServerRefs

java.util.Set<ServerRef> getServerRefs(java.lang.String protocolName)
                                       throws ServerClusterViewManagerException
Parameters:
protocolName - a name of protocol
Returns:
the set of references on server connected to this server
Throws:
ServerClusterViewManagerException - if the given protocol name doesn't exist

getNbClientsConnectedToProvider

int getNbClientsConnectedToProvider()
Returns:
the numbers of clients connected to a provider of the cluster view

registerClient

void registerClient(java.util.UUID uuid)
Register a new client.

Parameters:
uuid - the Universally Unique Identifier of the client

isReplicationManagerStarted

boolean isReplicationManagerStarted()
Returns:
true if the replication manager is started

setReplicationManagerStarted

void setReplicationManagerStarted(boolean replicationManagerStarted)
Set if the replication manager is started.

Parameters:
replicationManagerStarted - true if the replication manager is started


Copyright © 2007 OW2 Consortium. All Rights Reserved.