org.openorb.notify.impl
Class ConsumerAdminImpl
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, ORB orb, POA poa, InterFilterGroupOperator operator, int consumerAdminId, int channelId, Property[] qosProperties, Logger logger)
Default constructor. |
| ConsumerAdminImpl(EventChannelImpl channel, ConsumerAdmin pssConsumerAdmin, POA poa, Logger logger)
Constructor -- used for recovery only |
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(Object event)
New event available |
String | getId()
Get the ID ( ChannelID + ConsumerAdminID ) of the admin. |
Object | getNotifyProperty(String key)
Method invoked to get the value of a property defined in the
notification module. |
ORB | getORB()
Get the ORB. |
byte[] | getPid()
Returns the pid of the persistent/transient object. |
POA | getPOA()
Get the POA. |
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).
|
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, 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, 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, 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.
|
Default constructor.
Constructor -- used for recovery only
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.
Parameters: new_filter filter to add
Returns: filter id
public boolean canConnectConsumer()
Method invoked to check if the MaxConsumers admin property applies.
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.
public void dispatchEvent(Object event)
New event available
public String getId()
Get the ID ( ChannelID + ConsumerAdminID ) of the admin.
public Object getNotifyProperty(String key)
Method invoked to get the value of a property defined in the
notification module.
public ORB getORB()
Get the ORB.
public byte[] getPid()
Returns the pid of the persistent/transient object.
public POA getPOA()
Get the POA.
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.
Returns: Array of all filters's id
public
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. If this
is the case, the object reference of the corresponding filter object is returned.
Otherwise, the FilterNotFound exception is raised.
Parameters: filterId Id of the filter to get
Returns: The filter object
Throws: org.omg.CosNotifyFilter.FilterNotFound Id doesn't match to any filter
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.
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).
Returns: Object QosProperties
public boolean isEventQueueLogged()
TODO
public boolean isFilterEvaluationLogged()
TODO
public boolean isProxyMaxPerformance()
The methods returns true if the consumer proxy threads should be
configured as MaxPerformance.
public boolean isQueueMaxPerformance()
The methods returns true if the event queue should be configured as
MaxPerformance.
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.
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.
The MyChannel attribute is a readonly attribute which maintains the
object reference of the Notification Service event channel that
created a given ConsumerAdmin instance.
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.
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.
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.
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.
Operation obtain_pull_supplier.
Operation obtain_push_supplier
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.
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.
public void proxySupplierRecovered(int id, Servant proxySupplier)
This method is invoked when a ProxySupplier was recovered.
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.
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.
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.
public 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.
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.
Parameters: filterId Id of the filter
Throws: FilterNotFound Id doesn't match to any filter
public void reportConsumerConnection()
A proxy supplier has been connected.
public void reportEventDelivery(int proxyId, int eventPid)
An event has been delivered or discarded
public void reportPullConsumerDisconnection(byte[] proxyPid)
A pull proxy supplier has been destroyed
public void reportPushConsumerDisconnection(byte[] proxyPid)
A push proxy supplier has been destroyed
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
Parameters: qos QosProperties to assign to object
Throws: org.omg.CosNotification.UnsupportedQoS
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.
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.
Parameters: required_qos available_qos
Throws: org.omg.CosNotification.UnsupportedQoS