Acspy.Nc.LoggingConsumer
index
/alma/ACS-2016.6/ACSSW/lib/python/site-packages/Acspy/Nc/LoggingConsumer.py

TODO:
- everything

 
Modules
       
acscommon

 
Classes
       
Acspy.Nc.Consumer.Consumer(CosNotifyComm__POA.StructuredPushConsumer, Acspy.Nc.CommonNC.CommonNC)
LoggingConsumer

 
class LoggingConsumer(Acspy.Nc.Consumer.Consumer)
    LoggingConsumer is a a Consumer-derived class designed solely for the purpose of
processing notification channel structured events sent automatically by the logging
system. Basically all one has to do to use this 
class is create a LoggingConsumer object providing an object with implements
"receive(String xml)"
and then invoke the consumerReady() method. Since logging events do not contain
complex IDL structs, filtering using the extended trader constraint language
should work as well.
 
 
Method resolution order:
LoggingConsumer
Acspy.Nc.Consumer.Consumer
CosNotifyComm__POA.StructuredPushConsumer
CosNotifyComm__POA.NotifyPublish
omniORB.PortableServer.Servant
Acspy.Nc.CommonNC.CommonNC
__builtin__.object

Methods defined here:
__init__(self, handler)
Constructor.
 
Params:
- handler
 
Returns: Nothing
 
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
getChannelDomain(self)
Overridden.
 
Parameters: None
 
Returns: pointer to a constant string.
 
Raises: Nothing
getChannelKind(self)
Overridden.
 
Parameters: None
 
Returns: pointer to a constant string.
 
Raises: Nothing
getNotificationFactoryName(self)
Overridden.
 
Parameters: None
 
Returns: pointer to a constant string. Normally
acscommon::LOGGING_NOTIFICATION_FACTORY_NAME
 
Raises: Nothing
push_structured_event(self, event)
Overridden.
 
Parameters: event is a CosNotification.StructuredEvent
 
Returns: Nothing
 
Raises: Nothing

Methods inherited from Acspy.Nc.Consumer.Consumer:
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.
reconnect(self, ecf)
reinitConnection(self)
Consumer reinitializes the connection to the Channel.
 
Parameters: None
 
Returns: Nothing
 
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
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

Data descriptors inherited from omniORB.PortableServer.Servant:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from Acspy.Nc.CommonNC.CommonNC:
combineChannelAndDomainName(self)
#------------------------------------------------------------------------------
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
getChannelTimestamp(self)
getChannelTimestampKind(self)
Naming context Kind value used to bind the channel with its creation time
Parameters: None
 
Returns:a constant string.
 
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
iniChannelTimestamp(self)
setChannelTimestamp(self)
set_autoreconnect(self, autoreconnect)
Set autoreconnection on/off in case the Notify Service restarted.
 
Params: Nothing
 
Returns: Nothing
 
Raises: Nothing

 
Data
        __revision__ = '$Id: LoggingConsumer.py,v 1.3 2008/11/05 19:34:21 rtobar Exp $'