org.openorb.notify.impl
Class ConsumerAdminImpl

java.lang.Object
  extended by org.omg.PortableServer.Servant
      extended by org.omg.CosNotifyChannelAdmin.ConsumerAdminPOA
          extended by org.openorb.notify.impl.ConsumerAdminImpl
All Implemented Interfaces:
org.omg.CORBA.portable.InvokeHandler, ConsumerAdminOperations, QoSAdminOperations, NotifySubscribeOperations, FilterAdminOperations, ConsumerAdminManagement, EventDispatcher, PersistenceManagement

public class ConsumerAdminImpl
extends ConsumerAdminPOA
implements EventDispatcher, ConsumerAdminManagement, PersistenceManagement

Version:
$Revision: 1.30 $ $Date: 2004/12/10 15:32:57 $
Author:
Olivier Modica

Constructor Summary
ConsumerAdminImpl(EventChannelImpl channel, ConsumerAdmin pssConsumerAdmin, org.omg.PortableServer.POA poa, Logger logger)
          Constructor -- used for recovery only
ConsumerAdminImpl(EventChannelImpl channel, org.omg.CORBA.ORB orb, org.omg.PortableServer.POA poa, InterFilterGroupOperator operator, int consumerAdminId, int channelId, Property[] qosProperties, Logger logger)
          Default constructor.
 
Method Summary
 int add_filter(Filter new_filter)
          The add_filter operation accepts as input the reference to an object supporting the Filter interface.
 boolean canConnectConsumer()
          Method invoked to check if the MaxConsumers admin property applies.
 void destroy()
          The destroy operation can be invoked to destroy the target ConsumerAdmin instance, freeing all resources consumed by the instance.
 void dispatchEvent(java.lang.Object event)
          New event available
 int[] get_all_filters()
          The get_all_filters operation accepts no input parameters, and returns the list of unique identifiers which correspond to all of the filters currently associated with the target object.
 Filter get_filter(int filterId)
          The get_filter operation accepts as input a numeric identifier that is intended to correspond to one of the filter objects currently associated with the target object.
 ProxySupplier get_proxy_supplier(int proxyId)
          The get_proxy_supplier operation accepts as an input parameter the numeric unique identifier associated with one of the proxy supplier objects which has been created by the target ConsumerAdmin instance.
 Property[] get_qos()
          The get_qos operation takes no input parameters, and returns a sequence of name-value pairs which encapsulates the current quality of service settings for the target object (which could be an Event Channel, Admin, or Proxy object).
 java.lang.String getId()
          Get the ID ( ChannelID + ConsumerAdminID ) of the admin.
 java.lang.Object getNotifyProperty(java.lang.String key)
          Method invoked to get the value of a property defined in the notification module.
 org.omg.CORBA.ORB getORB()
          Get the ORB.
 byte[] getPid()
          Returns the pid of the persistent/transient object.
 org.omg.PortableServer.POA getPOA()
          Get the POA.
 boolean isEventQueueLogged()
          TODO
 boolean isFilterEvaluationLogged()
          TODO
 boolean isProxyMaxPerformance()
          The methods returns true if the consumer proxy threads should be configured as MaxPerformance.
 boolean isQueueMaxPerformance()
          The methods returns true if the event queue should be configured as MaxPerformance.
 MappingFilter lifetime_filter()
          The lifetime_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to lifetime.
 void lifetime_filter(MappingFilter value)
          The lifetime_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to lifetime.
 EventChannel MyChannel()
          The MyChannel attribute is a readonly attribute which maintains the object reference of the Notification Service event channel that created a given ConsumerAdmin instance.
 int MyID()
          The MyID attribute is a readonly attribute which maintains the unique identifier of the target ConsumerAdmin instance which is assigned to it upon creation by the Notification Service event channel.
 InterFilterGroupOperator MyOperator()
          The MyOperator attribute is a readonly attribute which maintains the information regarding whether AND or OR semantics will be used during the evaluation of a given event against a set of filter objects, when combining the filter objects associated with the target ConsumerAdmin and those defined locally on a given proxy supplier.
 ProxySupplier obtain_notification_pull_supplier(ClientType ctype, org.omg.CORBA.IntHolder proxy_id)
          The obtain_notification_pull_supplier operation can create instances of the various types of pull-style proxy supplier objects defined within the CosNotifyChannelAdmin module.
 ProxySupplier obtain_notification_push_supplier(ClientType ctype, org.omg.CORBA.IntHolder proxy_id)
          The obtain_notification_push_supplier operation can create instances of the various types of push-style proxy supplier objects defined within the CosNotifyChannelAdmin module.
 ProxyPullSupplier obtain_pull_supplier()
          Operation obtain_pull_supplier.
 ProxyPushSupplier obtain_push_supplier()
          Operation obtain_push_supplier
 MappingFilter priority_filter()
          The priority_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to priority.
 void priority_filter(MappingFilter value)
          The priority_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to priority.
 void proxySupplierRecovered(int id, org.omg.PortableServer.Servant proxySupplier)
          This method is invoked when a ProxySupplier was recovered.
 int[] pull_suppliers()
          The pull_suppliers attribute is a readonly attribute which contains the list of unique identifiers which have been assigned by a ConsumerAdmin instance to each pull-style proxy supplier object it has created.
 int[] push_suppliers()
          The push_suppliers attribute is a readonly attribute which contains the list of unique identifiers which have been assigned by a ConsumerAdmin instance to each push-style proxy supplier object it has created.
 void remove_all_filters()
          The remove_all_filters operation accepts no input parameters, and removes all filter objects from the list of those currently associated with the target object.
 void remove_filter(int filterId)
          The remove_filter operation accepts as input a numeric value that is intended to be the unique identifier of a filter object that is currently associated with the target object.
 void reportConsumerConnection()
          A proxy supplier has been connected.
 void reportEventDelivery(int proxyId, int eventPid)
          An event has been delivered or discarded
 void reportPullConsumerDisconnection(byte[] proxyPid)
          A pull proxy supplier has been destroyed
 void reportPushConsumerDisconnection(byte[] proxyPid)
          A push proxy supplier has been destroyed
 void set_qos(Property[] qos)
          The set_qos operation takes as an input parameter a sequence of name-value pairs which encapsulates quality of service property settings that a client is requesting that the target object (which could be an Event Channel, Admin, or Proxy object) support as its default quality of service.
 void subscription_change(EventType[] added, EventType[] removed)
          The subscription_change operation takes as input two sequences of event type names: the first specifying those event types which the associated Consumer wants to add to its subscription list, and the second specifying those event types which the associated consumer wants to remove from its subscription list.
 void validate_qos(Property[] required_qos, NamedPropertyRangeSeqHolder available_qos)
          The validate_qos operation accepts as input a sequence of QoS property name-value pairs which specify a set of QoS settings that a client would like to know if the target object is capable of supporting.
 
Methods inherited from class org.omg.CosNotifyChannelAdmin.ConsumerAdminPOA
_all_interfaces, _invoke, _this, _this
 
Methods inherited from class org.omg.PortableServer.Servant
_default_POA, _get_delegate, _get_interface_def, _is_a, _non_existent, _object_id, _orb, _poa, _set_delegate, _this_object, _this_object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerAdminImpl

public ConsumerAdminImpl(EventChannelImpl channel,
                         org.omg.CORBA.ORB orb,
                         org.omg.PortableServer.POA poa,
                         InterFilterGroupOperator operator,
                         int consumerAdminId,
                         int channelId,
                         Property[] qosProperties,
                         Logger logger)
Default constructor.


ConsumerAdminImpl

public ConsumerAdminImpl(EventChannelImpl channel,
                         ConsumerAdmin pssConsumerAdmin,
                         org.omg.PortableServer.POA poa,
                         Logger logger)
Constructor -- used for recovery only

Method Detail

MyID

public int MyID()
The MyID attribute is a readonly attribute which maintains the unique identifier of the target ConsumerAdmin instance which is assigned to it upon creation by the Notification Service event channel.


MyChannel

public EventChannel MyChannel()
The MyChannel attribute is a readonly attribute which maintains the object reference of the Notification Service event channel that created a given ConsumerAdmin instance.


MyOperator

public InterFilterGroupOperator MyOperator()
The MyOperator attribute is a readonly attribute which maintains the information regarding whether AND or OR semantics will be used during the evaluation of a given event against a set of filter objects, when combining the filter objects associated with the target ConsumerAdmin and those defined locally on a given proxy supplier.


priority_filter

public MappingFilter priority_filter()
The priority_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to priority. Note that each proxy supplier object also has an associated attribute which maintains a reference to a mapping filter object for the priority property. This local mapping filter object is only used by the proxy supplier in the event that the priority_filter attribute of the ConsumerAdmin instance which created it is set to OBJECT_NIL. Otherwise, the mapping filter object referred to by the priority_filter attribute of the ConsumerAdmin is used instead of the mapping filter object referred to by the priority_filter attribute defined locally to the proxy supplier object.


priority_filter

public void priority_filter(MappingFilter value)
The priority_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to priority. Note that each proxy supplier object also has an associated attribute which maintains a reference to a mapping filter object for the priority property. This local mapping filter object is only used by the proxy supplier in the event that the priority_filter attribute of the ConsumerAdmin instance which created it is set to OBJECT_NIL. Otherwise, the mapping filter object referred to by the priority_filter attribute of the ConsumerAdmin is used instead of the mapping filter object referred to by the priority_filter attribute defined locally to the proxy supplier object.


lifetime_filter

public MappingFilter lifetime_filter()
The lifetime_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to lifetime. Note that each proxy supplier object also has an associated attribute which maintains a reference to a mapping filter object for the lifetime property. This local mapping filter object is only used by the proxy supplier in the event that the lifetime_filter attribute of the ConsumerAdmin instance which created it is set to OBJECT_NIL. Otherwise, the mapping filter object referred to by the lifetime_filter attribute of the ConsumerAdmin is used instead of the mapping filter object referred to by the lifetime_filter attribute defined locally to the proxy supplier object.


lifetime_filter

public void lifetime_filter(MappingFilter value)
The lifetime_filter attribute maintains a reference to a mapping filter object which affects the way in which each proxy supplier object created by the target ConsumerAdmin instance treats each event it receives with respect to lifetime. Note that each proxy supplier object also has an associated attribute which maintains a reference to a mapping filter object for the lifetime property. This local mapping filter object is only used by the proxy supplier in the event that the lifetime_filter attribute of the ConsumerAdmin instance which created it is set to OBJECT_NIL. Otherwise, the mapping filter object referred to by the lifetime_filter attribute of the ConsumerAdmin is used instead of the mapping filter object referred to by the lifetime_filter attribute defined locally to the proxy supplier object.


pull_suppliers

public int[] pull_suppliers()
The pull_suppliers attribute is a readonly attribute which contains the list of unique identifiers which have been assigned by a ConsumerAdmin instance to each pull-style proxy supplier object it has created.


push_suppliers

public int[] push_suppliers()
The push_suppliers attribute is a readonly attribute which contains the list of unique identifiers which have been assigned by a ConsumerAdmin instance to each push-style proxy supplier object it has created.


get_proxy_supplier

public ProxySupplier get_proxy_supplier(int proxyId)
                                 throws ProxyNotFound
The get_proxy_supplier operation accepts as an input parameter the numeric unique identifier associated with one of the proxy supplier objects which has been created by the target ConsumerAdmin instance. If the input parameter does correspond to the unique identifier of a proxy supplier object that has been created by the target ConsumerAdmin instance, that proxy supplier object?s reference is returned as the result of the operation. Otherwise, the ProxyNotFound exception is raised.

Throws:
ProxyNotFound

obtain_notification_pull_supplier

public ProxySupplier obtain_notification_pull_supplier(ClientType ctype,
                                                       org.omg.CORBA.IntHolder proxy_id)
                                                throws AdminLimitExceeded
The obtain_notification_pull_supplier operation can create instances of the various types of pull-style proxy supplier objects defined within the CosNotifyChannelAdmin module. Recall that three varieties of pull-style proxy supplier objects are defined within this module: instances of the ProxyPullSupplier interface support connections to pull consumers which receive events as Anys, instances of the StructuredProxyPullSupplier interface support connections to pull consumers which receive events as Structured Events, and instances of the SequenceProxyPullSupplier interface support connections to pull consumers which receive events as sequences of Structured Events. The obtain_notification_pull_supplier operation thus accepts as an input parameter a flag which indicates which style of pull-style proxy supplier instance should be created. If the number of consumers currently connected to the channel with which the target ConsumerAdmin object is associated exceeds the value of the MaxConsumers administrative property, the AdminLimitExceeded exception is raised. Otherwise, the target ConsumerAdmin creates the new pull-style proxy supplier instance and assigns a numeric identifier to it that is unique among all proxy suppliers it has created. The unique identifier is returned as the output parameter of the operation, and the reference to the new proxy supplier instance is returned as the operation result.

Throws:
AdminLimitExceeded

obtain_notification_push_supplier

public ProxySupplier obtain_notification_push_supplier(ClientType ctype,
                                                       org.omg.CORBA.IntHolder proxy_id)
                                                throws AdminLimitExceeded
The obtain_notification_push_supplier operation can create instances of the various types of push-style proxy supplier objects defined within the CosNotifyChannelAdmin module. Recall that three varieties of push-style proxy supplier objects are defined within this module: instances of the ProxyPushSupplier interface support connections to push consumers which receive events as Anys, instances of the StructuredProxyPushSupplier interface support connections to push consumers which receive events as Structured Events, and instances of the SequenceProxyPushSupplier interface support connections to push consumers which receive events as sequences of Structured Events. The obtain_notification_push_supplier operation thus accepts as an input parameter a flag which indicates which style of push-style proxy supplier instance should be created. If the number of consumers currently connected to the channel with which the target ConsumerAdmin object is associated exceeds the value of the MaxConsumers administrative property, the AdminLimitExceeded exception is raised. Otherwise, the target ConsumerAdmin creates the new push-style proxy supplier instance and assigns a numeric identifier to it that is unique among all proxy suppliers it has created. The unique identifier is returned as the output parameter of the operation, and the reference to the new proxy supplier instance is returned as the operation result.

Throws:
AdminLimitExceeded

destroy

public void destroy()
The destroy operation can be invoked to destroy the target ConsumerAdmin instance, freeing all resources consumed by the instance. Note that destroy can be invoked on a ConsumerAdmin instance that is current managing proxy supplier objects that support open connections to consumers. In this case, the effect of invoking destroy on the ConsumerAdmin is that the operation will disconnect each of the proxy supplier objects being managed by the target ConsumerAdmin from their consumers, and destroy each of these proxy suppliers. Ultimately, the ConsumerAdmin instance itself will be destroyed.


get_qos

public Property[] get_qos()
The get_qos operation takes no input parameters, and returns a sequence of name-value pairs which encapsulates the current quality of service settings for the target object (which could be an Event Channel, Admin, or Proxy object).

Specified by:
get_qos in interface QoSAdminOperations
Returns:
Object QosProperties

set_qos

public void set_qos(Property[] qos)
             throws UnsupportedQoS
The set_qos operation takes as an input parameter a sequence of name-value pairs which encapsulates quality of service property settings that a client is requesting that the target object (which could be an Event Channel, Admin, or Proxy object) support as its default quality of service. If the implementation of the target object is not capable of supporting any of the requested quality of service settings, or if any of the requested settings would be in conflict with a QoS property defined at a higher level of the object hierarchy with respect to QoS, the UnsupportedQoS exception is raised. This exception contains as data a sequence of data structures, each of which identifies the name of a QoS property in the input list whose requested setting could not be satisfied, along with an error code and a range of settings for the property which could be satisfied. The meanings of the error codes which might be returned are described in Table 2-5 of CosNotification Service specification

Specified by:
set_qos in interface QoSAdminOperations
Parameters:
qos - QosProperties to assign to object
Throws:
UnsupportedQoS

validate_qos

public void validate_qos(Property[] required_qos,
                         NamedPropertyRangeSeqHolder available_qos)
                  throws UnsupportedQoS
The validate_qos operation accepts as input a sequence of QoS property name-value pairs which specify a set of QoS settings that a client would like to know if the target object is capable of supporting. If the any of the requested settings could not be satisfied by the target object, the operation raises the UnsupportedQoS exception. This exception contains as data a sequence of data structures, each of which identifies the name of a QoS property in the input list whose requested setting could not be satisfied, along with an error code and a range of settings for the property which could be satisfied. The meanings of the error codes which might be returned are described in Table 2-5. If all requested QoS property value settings could be satisfied by the target object, the operation returns successfully (without actually setting the QoS properties on the target object) with an output parameter that contains a sequence of PropertyRange data structures. Each element in this sequence includes the name of a an additional QoS property supported by the target object which could have been included on the input list and resulted in a successful return from the operation, along with the range of values that would have been acceptable for each such property.

Specified by:
validate_qos in interface QoSAdminOperations
Parameters:
required_qos -
available_qos -
Throws:
UnsupportedQoS

subscription_change

public void subscription_change(EventType[] added,
                                EventType[] removed)
                         throws InvalidEventType
The subscription_change operation takes as input two sequences of event type names: the first specifying those event types which the associated Consumer wants to add to its subscription list, and the second specifying those event types which the associated consumer wants to remove from its subscription list. This operation raises the InvalidEventType exception if one of the event type names supplied in either input parameter is syntactically invalid. If this case, the invalid name is returned in the type field of the exception. Note that each event type name is comprised of two components: the name of the domain in which the event type has meaning, and the name of the actual event type. Also note that either component of a type name may specify a complete domain/event type name, a domain/event type name containing the wildcard ?? character, or the special event type name %ALL described in section 2.6.5.

Specified by:
subscription_change in interface NotifySubscribeOperations
Throws:
InvalidEventType

add_filter

public int add_filter(Filter new_filter)
The add_filter operation accepts as input the reference to an object supporting the Filter interface. The affect of this operation is that the input filter object is appended to the list of filter objects associated with the target object upon which the operation was invoked. The operation associates with the newly added filter object a numeric identifier that is unique among all filter objects currently associated with the target, and returns that value as the result of the operation.

Specified by:
add_filter in interface FilterAdminOperations
Parameters:
new_filter - filter to add
Returns:
filter id

remove_filter

public void remove_filter(int filterId)
                   throws FilterNotFound
The remove_filter operation accepts as input a numeric value that is intended to be the unique identifier of a filter object that is currently associated with the target object. If identifier supplied does correspond to a filter object currently associated with the target object, then the corresponding filter object will be removed from the list of filters associated with the target object. Otherwise, the FilterNotFound exception will be raised.

Specified by:
remove_filter in interface FilterAdminOperations
Parameters:
filterId - Id of the filter
Throws:
FilterNotFound - Id doesn't match to any filter

get_filter

public Filter get_filter(int filterId)
                  throws FilterNotFound
The get_filter operation accepts as input a numeric identifier that is intended to correspond to one of the filter objects currently associated with the target object. If this is the case, the object reference of the corresponding filter object is returned. Otherwise, the FilterNotFound exception is raised.

Specified by:
get_filter in interface FilterAdminOperations
Parameters:
filterId - Id of the filter to get
Returns:
The filter object
Throws:
FilterNotFound - Id doesn't match to any filter

get_all_filters

public int[] get_all_filters()
The get_all_filters operation accepts no input parameters, and returns the list of unique identifiers which correspond to all of the filters currently associated with the target object.

Specified by:
get_all_filters in interface FilterAdminOperations
Returns:
Array of all filters's id

remove_all_filters

public void remove_all_filters()
The remove_all_filters operation accepts no input parameters, and removes all filter objects from the list of those currently associated with the target object.

Specified by:
remove_all_filters in interface FilterAdminOperations

obtain_push_supplier

public ProxyPushSupplier obtain_push_supplier()
Operation obtain_push_supplier

Specified by:
obtain_push_supplier in interface ConsumerAdminOperations

obtain_pull_supplier

public ProxyPullSupplier obtain_pull_supplier()
Operation obtain_pull_supplier.

Specified by:
obtain_pull_supplier in interface ConsumerAdminOperations

dispatchEvent

public void dispatchEvent(java.lang.Object event)
New event available

Specified by:
dispatchEvent in interface EventDispatcher

getId

public java.lang.String getId()
Get the ID ( ChannelID + ConsumerAdminID ) of the admin.

Specified by:
getId in interface ConsumerAdminManagement

proxySupplierRecovered

public void proxySupplierRecovered(int id,
                                   org.omg.PortableServer.Servant proxySupplier)
This method is invoked when a ProxySupplier was recovered.

Specified by:
proxySupplierRecovered in interface ConsumerAdminManagement

getORB

public org.omg.CORBA.ORB getORB()
Get the ORB.

Specified by:
getORB in interface ConsumerAdminManagement

getPOA

public org.omg.PortableServer.POA getPOA()
Get the POA.

Specified by:
getPOA in interface ConsumerAdminManagement

reportConsumerConnection

public void reportConsumerConnection()
A proxy supplier has been connected.

Specified by:
reportConsumerConnection in interface ConsumerAdminManagement

canConnectConsumer

public boolean canConnectConsumer()
Method invoked to check if the MaxConsumers admin property applies.

Specified by:
canConnectConsumer in interface ConsumerAdminManagement

reportPullConsumerDisconnection

public void reportPullConsumerDisconnection(byte[] proxyPid)
A pull proxy supplier has been destroyed

Specified by:
reportPullConsumerDisconnection in interface ConsumerAdminManagement

reportPushConsumerDisconnection

public void reportPushConsumerDisconnection(byte[] proxyPid)
A push proxy supplier has been destroyed

Specified by:
reportPushConsumerDisconnection in interface ConsumerAdminManagement

reportEventDelivery

public void reportEventDelivery(int proxyId,
                                int eventPid)
An event has been delivered or discarded

Specified by:
reportEventDelivery in interface ConsumerAdminManagement

isEventQueueLogged

public boolean isEventQueueLogged()
TODO


isFilterEvaluationLogged

public boolean isFilterEvaluationLogged()
TODO


isQueueMaxPerformance

public boolean isQueueMaxPerformance()
The methods returns true if the event queue should be configured as MaxPerformance.

Specified by:
isQueueMaxPerformance in interface ConsumerAdminManagement

isProxyMaxPerformance

public boolean isProxyMaxPerformance()
The methods returns true if the consumer proxy threads should be configured as MaxPerformance.

Specified by:
isProxyMaxPerformance in interface ConsumerAdminManagement

getNotifyProperty

public java.lang.Object getNotifyProperty(java.lang.String key)
Method invoked to get the value of a property defined in the notification module.

Specified by:
getNotifyProperty in interface ConsumerAdminManagement

getPid

public byte[] getPid()
Returns the pid of the persistent/transient object.

Specified by:
getPid in interface PersistenceManagement