| |
- Acspy.Nc.CommonNC.CommonNC
-
- Supplier(CosNotifyComm__POA.StructuredPushSupplier, Acspy.Nc.CommonNC.CommonNC)
- CosNotifyComm__POA.StructuredPushSupplier(CosNotifyComm__POA.NotifySubscribe)
-
- Supplier(CosNotifyComm__POA.StructuredPushSupplier, Acspy.Nc.CommonNC.CommonNC)
class Supplier(CosNotifyComm__POA.StructuredPushSupplier, Acspy.Nc.CommonNC.CommonNC) |
|
Class Supplier is the implementation of a CORBA structured push supplier. It
is provided to hide details of the CORBA Notificiation Service
from the developer. Furthermore, one can reconfigure the quality of service
properties and administrator properties for a given notification channel by
overriding the correct methods in this class. |
|
- Method resolution order:
- Supplier
- CosNotifyComm__POA.StructuredPushSupplier
- CosNotifyComm__POA.NotifySubscribe
- omniORB.PortableServer.Servant
- Acspy.Nc.CommonNC.CommonNC
Methods defined here:
- __init__(self, channelname, component=None, domain=None)
- Constructor.
Params:
- channelName is the channel name
- 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
- disconnect(self)
- User code MUST call this method when the Supplier is no longer useful.
Failure to do so can result in remote memory leaks!
Params: None
Returns: Nothing
Raises: Nothing
- disconnect_structured_push_supplier(self)
- Override this method to do something when a consumer unsubscribes from the
channel. Developer code must never invoke this method!
Params: Nothing
Returns: Nothing
Raises: Nothing
- initCORBA(self)
- Handles all the CORBA involved in creating a Supplier.
Parameters: None
Returns: Nothing
Raises: ACSErrTypeCommonImpl.CORBAProblemExImpl on critical failures
- publishEvent(self, simple_data=None, event_callback=None, type_name=None, event_name='', se=None, supplier_name=None)
- publishEvent is the one method developers have to use.
publishEvent() is designed so Supplier does not have to be subclassed.
Params:
- simple_data is a user-defined IDL struct. If this parameter is not
specified by the developer, se MUST be used. 99% of the time developers
should specify the simple_data parameter and NOTHING ELSE!
- event_callback is a reference to the user implemented eventProcessCallback
the user must implements: eventSent(self, simple_data),
eventDropped(self, simple_data) and eventStoredInQueue(self, simple_data)
methods.
- type_name is literally the type_name field of a structured event. This
is an optional parameter and should not be specified under normal
circumstances. If unspecified, the name of the simple_data object is used.
- event_name is the event_name field of the structured event. Not really
useful.
- se is a fully-defined structured event. If this parameter is specified,
all other parameters will be completely ignored. A check is made to ensure
that this object is really what it claims to be. This parameter is
reserved for ACS internal usage.
- suppier_name is the name of the supplier publishing the event. This
parameter is reserved for ACS internal usage.
Returns: Nothing
Raises:
- ACSErrTypeCommonImpl.CORBAProblemExImpl
- ACSErrTypeCommonImpl.CouldntPerformActionExImpl
- ACSErrTypeCommonImpl.TypeNotSupportedExImpl
- reconnect(self, ecf)
- subscription_change(self, added, removed)
- Override this method so a "smart" Supplier subclass can publish (or not
pubish) events based on Consumer demands. Not very useful when there is
more than one Supplier instance for a given channel.
Params:
- added subscription list
- removed subscription list
Returns: Nothing
Raises:
- InvalidEventType Throw this exception when a consumer subscribes (or
unsubscribes) to a bad domain/type
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
| |