org.apache.qpid.management.configuration
Class Configuration

java.lang.Object
  extended by org.apache.qpid.management.configuration.Configuration

public final class Configuration
extends Object

Qpid Management bridge configuration. Basically iy is a singleton that is holding all the configurtion data loaded at startup.


Field Summary
(package private)  Map<Integer,AccessMode> _accessModes
           
(package private)  Map<UUID,BrokerConnectionData> _brokerConnectionInfos
           
(package private)  Map<Character,IMessageHandler> _managementQueueHandlers
           
(package private)  Map<Character,IMessageHandler> _methodReplyQueueHandlers
           
(package private)  Map<Integer,Type> _typeMappings
           
(package private)  Map<Type,String> _validators
           
 
Method Summary
(package private)  void addAccessModeMapping(int code, AccessMode accessMode)
          Adds a new access mode mapping to this configuration.
(package private)  void addBrokerConnectionData(UUID brokerId, BrokerConnectionData connectionData)
          Adds to this configuration a new broker connection data.
(package private)  void addManagementMessageHandlerMapping(MessageHandlerMapping mapping)
          Adds a new management message handler to this configuration.
(package private)  void addMethodReplyMessageHandlerMapping(MessageHandlerMapping mapping)
          Adds a new method-reply message handler to this configuration.
(package private)  void addTypeMapping(int code, Type type)
          Adds a new type mapping to this configuration.
(package private)  void addTypeMapping(int code, Type type, String validatorClassName)
          Adds a new type mapping to this configuration.
 AccessMode getAccessMode(int code)
          Returns the access mode associated to the given code.
 BrokerConnectionData getBrokerConnectionData(UUID brokerId)
          Gets from this configuration the connection data of the broker associated with the given id.
 org.apache.qpid.transport.DeliveryProperties getCommandDeliveryProperties()
          Returns the command message delivery properties.
 org.apache.qpid.transport.Header getCommandMessageHeader()
          Returns the message header used for sending command message on management queue.
 org.apache.qpid.transport.MessageProperties getCommandMessageProperties()
          Returns the command message properties.
 Set<Map.Entry<UUID,BrokerConnectionData>> getConnectionInfos()
          Gets from this configuration the list of known broker (I mean, only their connection data).
static Configuration getInstance()
          Returns the singleton instance.
 Map<Character,IMessageHandler> getManagementQueueHandlers()
          Returns a map containing all the configured management message handlers.
 String getManagementQueueName()
          Returns the name of the management queue.
 Map<Character,IMessageHandler> getMethodReplyQueueHandlers()
          Returns a map containing all the configured method-reply message handlers.
 String getMethodReplyQueueName()
          Returns the name of the method-reply queue.
 Type getType(int code)
          Returns the type associated to the given code.
 String getValidatorClassName(Type type)
          Returns the validator class name associated to the given type.
 long getWorkerManagerKeepAliveTime()
          Returns the max amount of time that an excess thread can be idle before purging from the pool.
 int getWorkerManagerMaxPoolSize()
          Returns the maximum size of the worker manager thread pool size.
 int getWorkerManagerPoolSize()
          Returns the worker manager thread pool size.
 boolean hasOneOrMoreBrokersDefined()
          Returns true if this configuration has at least one broker configured.
(package private)  void setWorkerManagerKeepAliveTime(long keepAliveTime)
          Sets the max amount of time that an excess thread can be idle before purging from the pool.
(package private)  void setWorkerManagerMaxPoolSize(int maxPoolSize)
          Sets the maximum size of the worker manager thread pool size.
(package private)  void setWorkerManagerPoolSize(int poolSize)
          Sets the size of the worker manager thread pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_typeMappings

Map<Integer,Type> _typeMappings

_accessModes

Map<Integer,AccessMode> _accessModes

_validators

Map<Type,String> _validators

_brokerConnectionInfos

Map<UUID,BrokerConnectionData> _brokerConnectionInfos

_managementQueueHandlers

Map<Character,IMessageHandler> _managementQueueHandlers

_methodReplyQueueHandlers

Map<Character,IMessageHandler> _methodReplyQueueHandlers
Method Detail

getInstance

public static Configuration getInstance()
Returns the singleton instance.

Returns:
the singleton instance.

hasOneOrMoreBrokersDefined

public boolean hasOneOrMoreBrokersDefined()
Returns true if this configuration has at least one broker configured.

Returns:
true if this configuration has at least one broker configured.

getType

public Type getType(int code)
             throws UnknownTypeCodeException
Returns the type associated to the given code.

Parameters:
code - the code used as search criteria.
Returns:
the type associated to the given code.
Throws:
UnknownTypeCodeException - when the given code is not associated to any type.

getAccessMode

public AccessMode getAccessMode(int code)
                         throws UnknownAccessCodeException
Returns the access mode associated to the given code.

Parameters:
code - the code used as search criteria.
Returns:
the access mode associated to the given code.
Throws:
UnknownAccessCodeException - when the given code is not associated to any access mode.

getValidatorClassName

public String getValidatorClassName(Type type)
Returns the validator class name associated to the given type.

Parameters:
type - the type.
Returns:
the validator class name associated to the given type.

getConnectionInfos

public Set<Map.Entry<UUID,BrokerConnectionData>> getConnectionInfos()
Gets from this configuration the list of known broker (I mean, only their connection data).

Returns:
the list of known broker

getBrokerConnectionData

public BrokerConnectionData getBrokerConnectionData(UUID brokerId)
                                             throws UnknownBrokerException
Gets from this configuration the connection data of the broker associated with the given id.

Parameters:
brokerId - the broker identifier.
Returns:
the connection data of the broker associated with the given id.
Throws:
UnknownBrokerException - when the given id is not associated with any broker.

getManagementQueueName

public String getManagementQueueName()
Returns the name of the management queue.

Returns:
the name of the management queue.

getMethodReplyQueueName

public String getMethodReplyQueueName()
Returns the name of the method-reply queue.

Returns:
the name of the method-reply queue.

getManagementQueueHandlers

public Map<Character,IMessageHandler> getManagementQueueHandlers()
Returns a map containing all the configured management message handlers. A management message handler it is a basically a processor for a management queue incoming message associated with a specific opcode.

Returns:
a map containing all the configured management message handlers.

getMethodReplyQueueHandlers

public Map<Character,IMessageHandler> getMethodReplyQueueHandlers()
Returns a map containing all the configured method-reply message handlers. A management message handler it is a basically a processor for a method-reply queue incoming message associated with a specific opcode.

Returns:
a map containing all the configured method-reply message handlers.

getCommandMessageHeader

public org.apache.qpid.transport.Header getCommandMessageHeader()
Returns the message header used for sending command message on management queue.

Returns:
the message header used for sending command message on management queue.

getCommandMessageProperties

public org.apache.qpid.transport.MessageProperties getCommandMessageProperties()
Returns the command message properties.

Returns:
the command message properties.

getCommandDeliveryProperties

public org.apache.qpid.transport.DeliveryProperties getCommandDeliveryProperties()
Returns the command message delivery properties.

Returns:
the command message delivery properties.

addTypeMapping

void addTypeMapping(int code,
                    Type type,
                    String validatorClassName)
Adds a new type mapping to this configuration.

Parameters:
code - the code that will be associated with the declared type.
type - the type.
vailidatorClassName - the FQN of the validator class that will be associated with the given type.

addTypeMapping

void addTypeMapping(int code,
                    Type type)
Adds a new type mapping to this configuration.

Parameters:
code - the code that will be associated with the declared type.
type - the type.

addAccessModeMapping

void addAccessModeMapping(int code,
                          AccessMode accessMode)
Adds a new access mode mapping to this configuration.

Parameters:
code - the code that will be associated with the access mode,
accessMode - the accessMode.

addManagementMessageHandlerMapping

void addManagementMessageHandlerMapping(MessageHandlerMapping mapping)
Adds a new management message handler to this configuration. The incoming mapping object will contains an opcode and the class (as a string) of the message handler that will be used for processing incoming messages with that opcode.

Parameters:
mapping - the message handler mapping.

addMethodReplyMessageHandlerMapping

void addMethodReplyMessageHandlerMapping(MessageHandlerMapping mapping)
Adds a new method-reply message handler to this configuration. The incoming mapping object will contains an opcode and the class (as a string) of the message handler that will be used for processing incoming messages with that opcode.

Parameters:
mapping - the message handler mapping.

addBrokerConnectionData

void addBrokerConnectionData(UUID brokerId,
                             BrokerConnectionData connectionData)
                       throws BrokerAlreadyConnectedException,
                              BrokerConnectionException
Adds to this configuration a new broker connection data.

Parameters:
brokerId - the broker identifier.
connectionData - the connection data.
Throws:
BrokerAlreadyConnectedException - when the broker is already connected.
BrokerConnectionException - when a connection cannot be estabilished.

getWorkerManagerPoolSize

public int getWorkerManagerPoolSize()
Returns the worker manager thread pool size.

Returns:
the worker manager thread pool size.

setWorkerManagerPoolSize

void setWorkerManagerPoolSize(int poolSize)
Sets the size of the worker manager thread pool.

Parameters:
poolSize - the size of the worker manager thread pool.

getWorkerManagerMaxPoolSize

public int getWorkerManagerMaxPoolSize()
Returns the maximum size of the worker manager thread pool size.

Returns:
the max size of the worker manager thread pool.

setWorkerManagerMaxPoolSize

void setWorkerManagerMaxPoolSize(int maxPoolSize)
Sets the maximum size of the worker manager thread pool size.

Parameters:
maxPoolSize - the max size of the worker manager thread pool.

getWorkerManagerKeepAliveTime

public long getWorkerManagerKeepAliveTime()
Returns the max amount of time that an excess thread can be idle before purging from the pool.

Returns:
the max keep alive time.

setWorkerManagerKeepAliveTime

void setWorkerManagerKeepAliveTime(long keepAliveTime)
Sets the max amount of time that an excess thread can be idle before purging from the pool.

Parameters:
keepAliveTime - the max keep alive time.


Licensed to the Apache Software Foundation