org.ow2.cmi.controller.server
Interface ServerClusterViewManager

All Superinterfaces:
ClusterViewManager, CMIManagedObject, SmartConnector

public interface ServerClusterViewManager
extends ClusterViewManager, SmartConnector

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

Author:
The new CMI team

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ow2.cmi.controller.common.ClusterViewManager
ClusterViewManager.State
 
Method Summary
 void addCMIReference(CMIReference cmiReference)
          Add a CMIReference to the cluster view.
 void addFilter(java.lang.String objectName, IFilter filter)
          Add a new filter for the given object name.
 void addGlobalFilter(IFilter filter)
          Add a new global filter.
 java.lang.Object addLoadBalancingArchive(byte[] bytesOfFile, java.lang.String location, java.lang.Class<?>[] policies, java.lang.Class<?>[] strategies)
          Adds an archive containing load balancing classes.
 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.
 boolean addProtocol(java.lang.String initialContextFactoryName, ServerId serverRef, javax.naming.Context cmiContext)
          Adds a new protocol.
 void addServerToBlackList(ServerRef serverRef)
          Adds a server to the blacklist.
 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getAvailablePoliciesAndStrategies()
          Gets available load balancing policies and strategies.
 java.util.Set<ServerId> getBlacklistedServers()
           
 java.lang.String getBusinessName(java.lang.String objectName)
          Returns a name of business interface of this object (for ejb2 only).
 IUpdatedClientConfig getClientConfig()
           
 java.util.Set<java.lang.String> getClusterNames()
          Returns the set of name of cluster.
 java.util.Collection<CMIReference> getCMIReferences(java.lang.String objectName)
          Returns a list of CMIReference for an object with the given name.
 java.util.Collection<CMIReference> getCMIReferences(java.lang.String objectName, java.lang.String protocolName, java.util.Set<java.lang.Object> qualities)
          Return a filtered list of CMIReference for an object with the given name.
 java.util.Set<CMIReference> getCMIRefsForServerRef(ServerRef serverRef)
           
 long getDateOfConfiguration()
           
 java.util.Set<java.lang.String> getDomainNames()
           
 java.util.List<IFilter> getFilters(java.lang.String objectName)
          Return the filters that are used to restrict accesses on the given object.
 java.util.List<IFilter> getGlobalFilters()
          Return the global filters.
 ImmutableClusteredObjectInfos getImmutableInfos(java.lang.String objectName)
           
 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.
 ServerId getRefOnLocalRegistry(java.lang.String protocolName)
           
 java.util.Set<ServerId> getRefsOnRegistries(java.lang.String serverName)
           
 java.util.Set<java.lang.String> getServerNames(java.lang.String domainName)
           
 java.util.Set<java.lang.String> getServerObjectForProtocol(java.lang.String serverUrl, java.lang.String protocolName)
          Gets all objects hosted on a given server started with the given protocol.
 java.util.Set<ServerId> getServerRefs(java.lang.String protocolName)
           
 boolean hasProtocol(java.lang.String protocolName)
           
 boolean isRegistrationOpened()
           
 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.
 boolean removeFilter(java.lang.String objectName, IFilter filter)
          Remove a filter for the given object name.
 void removeGlobalFilter(IFilter filter)
          Remove a global filter.
 void removeLoadBalancingArchive(java.lang.Object archiveId, java.lang.String[] policies, java.lang.String[] strategies, boolean isArchiveOwner)
          Remove Load Balancing Archive, previously added.
 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 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(int delay)
          Sets the time between each update of the cluster view by clients.
 void setLoadFactor(ServerRef serverRef, int loadFactor)
          Sets the load-factor for the server with the given address.
 void setPolicyClassName(java.lang.String objectName, java.lang.String policyClassName)
          Sets a new policy for a given object.
 void setPoolConfiguration(java.lang.String objectName, org.ow2.util.pool.api.IPoolConfiguration poolConfiguration)
          Set the configuration of pool 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 properties for a given object.
 void setPropertyForPolicy(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.
 void setStaticPropertyForPolicy(java.lang.String objectName, java.lang.String propertyName, java.lang.Object 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 policy for a given object.
 
Methods inherited from interface org.ow2.cmi.controller.common.ClusterViewManager
addObjectToWatch, destroy, getApplicationExceptionNames, getClusterName, getCMIReferences, getConfig, getDateOfProperties, getDelayToRefresh, getEventDispatcher, getInitialContextFactoryName, getInterface, getLoadFactor, getPolicy, getPolicyClass, getPolicyClassName, getPool, getPoolConfiguration, getPropertiesForPolicy, getPropertyForPolicy, getProtocols, getRemoteClass, getSessionId, getState, getStrategyClass, getStrategyClassName, getUUID, hasState, isClustered, isPoolToEmpty, isProxyEnabled, isReplicated, setPool, start, stop
 
Methods inherited from interface org.ow2.cmi.event.CMIManagedObject
getCMIManagedObjectId, getComponent
 
Methods inherited from interface org.ow2.cmi.smart.api.SmartConnector
getInitialContextFactoryName
 

Method Detail

setPolicyClassName

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

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

setStrategyClassName

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

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

setPropertiesForPolicy

void setPropertiesForPolicy(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

setPropertyForPolicy

void setPropertyForPolicy(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 policy of the given object
propertyValue - a value for the given name of property
Throws:
ObjectNotFoundException - if the specified object doesn't exist

setAlgorithmForPolicy

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

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

getCMIReferences

java.util.Collection<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

getCMIReferences

java.util.Collection<CMIReference> getCMIReferences(java.lang.String objectName,
                                                    java.lang.String protocolName,
                                                    java.util.Set<java.lang.Object> qualities)
                                                    throws ObjectNotFoundException
Return a filtered list of CMIReference for an object with the given name.

Parameters:
objectName - an object name
protocolName - a protocol name
qualities - qualities to get associated filters. If null, no filter is applied
Returns:
a filtered list of CMIReference
Throws:
ObjectNotFoundException - if no object is bound with the given name

addCMIReference

void addCMIReference(CMIReference cmiReference)
Add a CMIReference to the cluster view.

Parameters:
cmiReference - a reference on a clustered object

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

boolean addProtocol(java.lang.String initialContextFactoryName,
                    ServerId 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
Returns:
true if the context should not be closed
Throws:
ServerClusterViewManagerException - if the protocol cannot be added

hasProtocol

boolean hasProtocol(java.lang.String protocolName)
Parameters:
protocolName - a protocol name
Returns:
true if the protocol is registered

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

setPoolConfiguration

void setPoolConfiguration(java.lang.String objectName,
                          org.ow2.util.pool.api.IPoolConfiguration poolConfiguration)
                          throws ObjectNotFoundException
Set the configuration of pool of CMIReferenceable for a object with the given name.

Parameters:
objectName - a name of object
poolConfiguration - the configuration of pool of CMIReferenceable for a object with the given name
Throws:
ObjectNotFoundException - if none object has 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)
                                                       throws ProtocolNotFoundException
Parameters:
protocolName - a name of protocol
Returns:
the JMX service URL to access to this MBean or null if the protocol doesn't exist
Throws:
ProtocolNotFoundException - if none protocol have a such name

getRefOnLocalRegistry

ServerId getRefOnLocalRegistry(java.lang.String protocolName)
                               throws ProtocolNotFoundException
Parameters:
protocolName - a name of protocol
Returns:
the reference on the local registry for the given protocol
Throws:
ProtocolNotFoundException - if none protocol have a such name

getServerRefs

java.util.Set<ServerId> getServerRefs(java.lang.String protocolName)
                                      throws ProtocolNotFoundException
Parameters:
protocolName - a name of protocol
Returns:
the set of references on server connected to this server
Throws:
ProtocolNotFoundException - if none protocol have a such name

getRefsOnRegistries

java.util.Set<ServerId> getRefsOnRegistries(java.lang.String serverName)
Parameters:
serverName - a server name
Returns:
references on registries of the given server

getServerObjectForProtocol

java.util.Set<java.lang.String> getServerObjectForProtocol(java.lang.String serverUrl,
                                                           java.lang.String protocolName)
                                                           throws ProtocolNotFoundException
Gets all objects hosted on a given server started with the given protocol.

Parameters:
serverUrl - a server reference
protocolName - a given protocol
Returns:
the set of references on objects for the given server.
Throws:
ProtocolNotFoundException - if none protocol have a such name

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

getAvailablePoliciesAndStrategies

java.util.Map<java.lang.String,java.util.Set<java.lang.String>> getAvailablePoliciesAndStrategies()
Gets available load balancing policies and strategies.

Returns:
available policies and strategies

getDomainNames

java.util.Set<java.lang.String> getDomainNames()
Returns:
domain names

getServerNames

java.util.Set<java.lang.String> getServerNames(java.lang.String domainName)
Parameters:
domainName - domain name
Returns:
names of CMI server

getBlacklistedServers

java.util.Set<ServerId> getBlacklistedServers()
Returns:
references of blacklisted server

getCMIRefsForServerRef

java.util.Set<CMIReference> getCMIRefsForServerRef(ServerRef serverRef)
Parameters:
serverRef - a reference on CMI server
Returns:
references on clustered object for a given server

addLoadBalancingArchive

java.lang.Object addLoadBalancingArchive(byte[] bytesOfFile,
                                         java.lang.String location,
                                         java.lang.Class<?>[] policies,
                                         java.lang.Class<?>[] strategies)
Adds an archive containing load balancing classes. This archive might have been sent by a remote client or server.

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

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

getGlobalFilters

java.util.List<IFilter> getGlobalFilters()
Return the global filters.

Returns:
a list of global filters

addGlobalFilter

void addGlobalFilter(IFilter filter)
                     throws java.lang.IllegalArgumentException
Add a new global filter.

Parameters:
filter - a global filter
Throws:
java.lang.IllegalArgumentException - if the provided filter is not serializable

removeGlobalFilter

void removeGlobalFilter(IFilter filter)
Remove a global filter.

Parameters:
filter - a global filter

getFilters

java.util.List<IFilter> getFilters(java.lang.String objectName)
                                   throws ObjectNotFoundException
Return the filters that are used to restrict accesses on the given object.

Parameters:
objectName - an object name
Returns:
a list of filters
Throws:
ObjectNotFoundException - if none object has the given name

addFilter

void addFilter(java.lang.String objectName,
               IFilter filter)
               throws java.lang.IllegalArgumentException,
                      ObjectNotFoundException
Add a new filter for the given object name.

Parameters:
objectName - an object name
filter - a filter to add
Throws:
java.lang.IllegalArgumentException - if the provided filter is not serializable
ObjectNotFoundException - if none object has the given name

removeFilter

boolean removeFilter(java.lang.String objectName,
                     IFilter filter)
                     throws ObjectNotFoundException
Remove a filter for the given object name.

Parameters:
objectName - an object name
filter - a filter to remove
Returns:
true if the filter has been removed
Throws:
ObjectNotFoundException - if none object has the given name

getClientConfig

IUpdatedClientConfig getClientConfig()

getImmutableInfos

ImmutableClusteredObjectInfos getImmutableInfos(java.lang.String objectName)
                                                throws ObjectNotFoundException
Throws:
ObjectNotFoundException

getDateOfConfiguration

long getDateOfConfiguration()

isRegistrationOpened

boolean isRegistrationOpened()
Returns:
true if some new protocols can be registered by using this server.

setStaticPropertyForPolicy

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

Parameters:
objectName - a name of object
propertyName - a name of property
propertyValue - a value for the given name of property
Throws:
ObjectNotFoundException - if the used manager is at client-side
java.lang.RuntimeException


Copyright © 2009 OW2 Consortium. All Rights Reserved.