| |
- Acspy.Nc.CommonNC.CommonNC
-
- Consumer(CosNotifyComm__POA.StructuredPushConsumer, Acspy.Nc.CommonNC.CommonNC)
- CosNotifyComm__POA.StructuredPushConsumer(CosNotifyComm__POA.NotifyPublish)
-
- Consumer(CosNotifyComm__POA.StructuredPushConsumer, Acspy.Nc.CommonNC.CommonNC)
class Consumer(CosNotifyComm__POA.StructuredPushConsumer, Acspy.Nc.CommonNC.CommonNC) |
|
Class Consumer is the implementation of a CORBA Structured Push Consumer.
It is provided to hide details of the CORBA Notification Service from
the developer. It can be instantiated as-is or it can be subclassed and
the developer should override the processEvent method. |
|
- Method resolution order:
- Consumer
- CosNotifyComm__POA.StructuredPushConsumer
- CosNotifyComm__POA.NotifyPublish
- omniORB.PortableServer.Servant
- Acspy.Nc.CommonNC.CommonNC
Methods defined here:
- __init__(self, name, component=None, domain=None)
- Constructor.
Params:
- name is the channel name in string format
- component is the component this supplier has been instantiated from
(if applicable). This parameter is likely to become mandatory in future
version of ACS
- domain is the name of the domain of notification channels the channel
belongs to
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- addFilter(self, type_of_event, filter_exp)
- add a filter.
Parameters:
- type_of_event is the actual Python class for the IDL struct.
- filter_exp is an EXTENDED_TCL string.
Returns: The ID of the newly created filter (positive integer?)
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- addSubscription(self, name, handler_function=None)
- add a subscription to a given type.
Parameters
- name is the actual Python class for the IDL struct.
- handler_function If a structured event is received and the
registerHandler method has been defined on that SEs type_name, the
handler_function must be able to process filterable_data[0].value.value().
In other words every time an event of this nature is received, the
Consumer object will first try to invoke the handler_function
using the REAL object extracted from the CORBA Any in the structured
event located at the the first position of the filterable_data list.
IF THIS FAILS, the Consumer simply passes the event to the
processEvent(...) method which will have hopefully been overriden by
the developer.
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- consumerReady(self)
- Consumer can now begin receiving events after invoking consumerReady.
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- disconnect(self)
- Consumer client must call this to disconnect from notification channel.
Once disconnect has been called, the Consumer object should be treated
as if it has been deleted.
Parameters: None
Returns: Nothing
Raises: Nothing
- disconnect_structured_push_consumer(self)
- Called by a supplier to inform this consumer it is disconnecting from
the channel. Developer code must never call this.
Parameters: None
Returns: Nothing
Raises: Nothing
- getFilterLanguage(self)
- This method returns a constant character pointer to the type of filter
constraint language to be used for filtering events which is normally
equivalent to acsnc::FILTER_LANGUAGE_NAME. Override to change this
behavior.
Parameters: None
Returns: string
Raises: nothing
- initCORBA(self)
- Handles all the CORBA involved in creating a Consumer.
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- offer_change(self, added, removed)
- Called by a supplier to inform this consumer its offering a change in the
events in publishing. Developer code must never call this.
Parameters:
- added is a list of domain/type pairs a supplier will begin publishing
- removed is a list of domain/type pairs a supplier will stop
publishing
Returns: Nothing
Raises: Nothing
- processEvent(self, type_name=None, event_name=None, corba_any=None, se=None)
- Developer should override this method if handlers are not used. It does
NOT narrow the corba_any for the developer as there is no guarantee the
correct Python CORBA stub module has been imported!
Parameters:
- type_name corresponds to the type_name field of a structured event (i.e.,
string)
- event_name is the event_name field of a structured event (i.e., string)
- corba_any is filterable_data[0].value (i.e., CORBA any). Most
developers are only interested in this.
- se is the entire structured event.
Returns: Nothing
Raises: Developer is free to raise any exception.
- push_structured_event(self, event)
- CORBA method that is invoked by suppliers. If a correct handler function
has been provided via the addSubscription method, this is used to do
something useful with the event. Furthermore, if the user-defined handler
function raises an exception, this is caught and the processEvent
method is also invoked. Otherwise, its up to the developer to subclass
Consumer and override the processEvent method.
Parameters: event is a CosNotification.StructuredEvent
Returns: Nothing
Raises: Nothing
- reconnect(self, ecf)
- removeFilter(self, filter_id)
- remove a filter defined by filter_id.
Parameters: filter_id should be what is returned by the addFilter
method
Returns: 1 on success and 0 on failure.
Raises: Nothing
- removeSubscription(self, name)
- remove a subscription type.
Parameters: name is the actual Python class for the IDL struct.
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- resume(self)
- Resume receiving structured events. All events queued by the Supplier
will be forwarded to this Consumer instance.
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- suspend(self)
- Stop receiving structured events. All events published on this
channel will not be processed by this Consumer instance, but will
be queued for later delivery by the Supplier.
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
Methods inherited from Acspy.Nc.CommonNC.CommonNC:
- configAdminProps(self)
- Configures the administrative properties for this channel.
Only useful if the channel has not been created yet and this particular
method is being overriden.
Parameters: None
Returns: A sequence of Administrative properties.
Raises: Nothing
- configQofS(self)
- Configures the quality of service properties for this channel.
Only useful if the channel has not been created yet and this particular
method is being overriden.
Parameters: None
Returns: A sequence of Quality of Service properties.
Raises: Nothing
- createNotificationChannel(self)
- Creates the notification channel. Only to be called if it does not already
exist.
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- destroyNotificationChannel(self)
- Destroys the channel and unregisters it from the naming service. ONLY
USE THIS METHOD IF YOU KNOW FOR CERTAIN THERE IS ONLY ONE SUPPLIER FOR
THE CHANNEL!!! To be used with extreme caution. Likely to be removed with
future versions of ACS.
Parameters: None
Returns: 1 on success and 0 on failure
Raises: Nothing
- getChannelDomain(self)
- This method returns a constant character pointer to the notification channel
domain which is normally equivalent to acscommon::ALMADOMAIN. The sole
reason this method is provided is to accomodate subclasses which
subscribe/publish non-ICD style events (ACS archiving channel for example).
In that case, the developer would override this method.
Parameters: None
Returns: a constant string.
Raises: Nothing
- getChannelKind(self)
- This method returns a constant character pointer to the "kind" of
notification channel as registered with the naming service (i.e., the kind
field of a CosNaming.Name) which is normally equivalent to
acscommon::NC_KIND. The sole reason this method is provided is to accomodate
subclasses which subscribe/publish non-ICD style events (ACS archiving
channel for example).In that case, the developer would override this method.
Parameters: None
Returns:a constant string.
Raises: Nothing
- getNotificationFactoryName(self)
- This method returns the name of the notification service as registered
with the CORBA Naming Service.
Parameters: None
Returns: pointer to a constant string. Normally
acscommon::NOTIFICATION_FACTORY_NAME
Raises: Nothing
- getNotificationFactoryNameForChannel(self, channel, domain=None)
- This method returns the name of the notification service for the channel
or domain from the configuration information given in the CDB.
Parameters:
- channel is the channel name of the desired factory
- domain is the domain of the desired factory
Returns: string containing the factory name or None
Raises: Nothing
| |