Issue 1774: ProxyConsumer and ProxySupplier need readonly attributes to identify type. (notif_service-rtf) Source: (, ) Nature: Revision Severity: Summary: Summary: Currently it is possible to obtain a list of all ProxyConsumers being managed by a SupplierAdmin, and a list of all ProxySuppliers being managed by a ConsumerAdmin. But, given an entry on either one of these lists, the only way to determine its actual type is to try narrowing it to the Any, Structured, or Sequence version of the Proxy. If the ProxyConsumer and ProxySupplier interfaces maintained a readonly attribute that distinguishes each Proxy"s type, however, it would be easier for clients to walk through a list of Proxies obtained by performing a "get" operation on an Admin, and determine which type of Proxy each entry is. Resolution: Revised Text: Actions taken: August 4, 1998: received issue February 23, 1999: closed issue Discussion: End of Annotations:===== Return-Path: From: "Michael J. Greenberg" Subject: ProxyConsumer and ProxySupplier need readonly attributes to identify type... To: notif_service-rtf@omg.org, issues@omg.org Date: Tue, 4 Aug 1998 16:33:38 -0400 (EDT) Cc: dsm@syl.nj.nec.com Hello, Currently it is possible to obtain a list of all ProxyConsumers being managed by a SupplierAdmin, and a list of all ProxySuppliers being managed by a ConsumerAdmin. But, given an entry on either one of these lists, the only way to determine its actual type is to try narrowing it to the Any, Structured, or Sequence version of the Proxy. If the ProxyConsumer and ProxySupplier interfaces maintained a readonly attribute that distinguishes each Proxy's type, however, it would be easier for clients to walk through a list of Proxies obtained by performing a "get" operation on an Admin, and determine which type of Proxy each entry is. Below is my proposed modified version of CosNotifyChannelAdmin that supports the new functionality described above. The changes I made are enumerated below: - Defined an enumerated data type called ProxyType that can be used to distinguish between an Any, Structured, or Sequence style proxy. - Defined a new readonly attribute on both ProxyConsumer and ProxySupplier called MyType that is of type ProxyType. Note that the definition of ProxyType looks suspiciously similar to ClientType. However, I felt it was inappropriate to reuse ClientType for this purpose, because the meaning is completely different. Again, please send your comments. Regards, Mike module CosNotifyChannelAdmin { exception ConnectionAlreadyActive {}; exception ConnectionAlreadyInactive {}; // Forward declarations interface ConsumerAdmin; interface SupplierAdmin; interface EventChannel; interface EventChannelFactory; enum ProxyType { ANY_EVENT, STRUCTURED_EVENT, SEQUENCE_EVENT }; interface ProxyConsumer : CosNotification::QoSAdmin, CosNotifyFilter::FilterAdmin { readonly attribute ProxyType MyType; readonly attribute SupplierAdmin MyAdmin; CosNotification::EventTypeSeq obtain_subscription_types(); void validate_event_qos ( in CosNotification::QoSProperties required_qos, out CosNotification::PropertyRangeSeq available_qos) raises (CosNotification::UnsupportedQoS); }; // ProxyConsumer interface ProxySupplier : CosNotification::QoSAdmin, CosNotifyFilter::FilterAdmin { readonly attribute ProxyType MyType; readonly attribute ConsumerAdmin MyAdmin; attribute CosNotifyFilter::MappingFilter priority_filter; attribute CosNotifyFilter::MappingFilter lifetime_filter; CosNotification::EventTypeSeq obtain_offered_types(); void validate_event_qos ( in CosNotification::QoSProperties required_qos, out CosNotification::PropertyRangeSeq available_qos) raises (CosNotification::UnsupportedQoS); }; // ProxySupplier interface ProxyPushConsumer : ProxyConsumer, CosNotifyComm::PushConsumer { void connect_any_push_supplier ( in CosNotifyComm::PushSupplier push_supplier) raises (CosEventChannelAdmin::AlreadyConnected); }; // ProxyPushConsumer interface TxnProxyPushConsumer : ProxyPushConsumer, CosTransactions::TransactionalObject { }; TxnProxyPushConsumer interface StructuredProxyPushConsumer : ProxyConsumer, CosNotifyComm::StructuredPushConsumer { void connect_structured_push_supplier ( in CosNotifyComm::StructuredPushSupplier push_supplier) raises (CosEventChannelAdmin::AlreadyConnected); }; // StructuredProxyPushConsumer interface TxnStructuredProxyPushConsumer : StructuredProxyPushConsumer, CosTransactions::TransactionalObject { }; // TxnStructuredPushConsumer interface SequenceProxyPushConsumer : ProxyConsumer, CosNotifyComm::SequencePushConsumer { void connect_sequence_push_supplier ( in CosNotifyComm::SequencePushSupplier push_supplier) raises (CosEventChannelAdmin::AlreadyConnected); }; // SequenceProxyPushConsumer interface TxnSequenceProxyPushConsumer : SequenceProxyPushConsumer, CosTransactions::TransactionalObject { }; // TxnSequencePushConsumer interface ProxyPullSupplier : ProxySupplier, CosNotifyComm::PullSupplier { void connect_any_pull_consumer ( in CosNotifyComm::PullConsumer pull_consumer) raises (CosEventChannelAdmin::AlreadyConnected); }; // ProxyPullSupplier interface TxnProxyPullSupplier : ProxyPullSupplier, CosTransactions::TransactionalObject { }; // TxnProxyPullSupplier interface StructuredProxyPullSupplier : ProxySupplier, CosNotifyComm::StructuredPullSupplier { void connect_structured_pull_consumer ( in CosNotifyComm::StructuredPullConsumer pull_consumer) raises (CosEventChannelAdmin::AlreadyConnected); }; // StructuredProxyPullSupplier interface TxnStructuredProxyPullSupplier : StructuredProxyPullSupplier, CosTransactions::TransactionalObject { }; // TxnStructuredProxyPullSupplier interface SequenceProxyPullSupplier : ProxySupplier, CosNotifyComm::SequencePullSupplier { void connect_sequence_pull_consumer ( in CosNotifyComm::SequencePullConsumer pull_consumer) raises (CosEventChannelAdmin::AlreadyConnected); }; // SequenceProxyPullSupplier interface TxnSequenceProxyPullSupplier : SequenceProxyPullSupplier, CosTransactions::TransactionalObject { }; // TxnSequenceProxyPullSupplier interface ProxyPullConsumer : ProxyConsumer, CosNotifyComm::PullConsumer { void connect_any_pull_supplier ( in CosNotifyComm::PullSupplier pull_supplier) raises (CosEventChannelAdmin::AlreadyConnected, CosEventChannelAdmin::TypeError ); }; // ProxyPullConsumer interface StructuredProxyPullConsumer : ProxyConsumer, CosNotifyComm::StructuredPullConsumer { void connect_structured_pull_supplier ( in CosNotifyComm::StructuredPullSupplier pull_supplier) raises (CosEventChannelAdmin::AlreadyConnected, CosEventChannelAdmin::TypeError ); }; // StructuredProxyPullConsumer interface SequenceProxyPullConsumer : ProxyConsumer, CosNotifyComm::SequencePullConsumer { void connect_sequence_pull_supplier ( in CosNotifyComm::SequencePullSupplier pull_supplier) raises (CosEventChannelAdmin::AlreadyConnected, CosEventChannelAdmin::TypeError ); }; // SequenceProxyPullConsumer interface ProxyPushSupplier : ProxySupplier, CosNotifyComm::PushSupplier { void connect_any_push_consumer ( in CosNotifyComm::PushConsumer push_consumer) raises (CosEventChannelAdmin::AlreadyConnected, CosEventChannelAdmin::TypeError ); void suspend_connection() raises (ConnectionAlreadyInactive); void resume_connection() raises (ConnectionAlreadyActive); }; // ProxyPushSupplier interface StructuredProxyPushSupplier : ProxySupplier, CosNotifyComm::StructuredPushSupplier { void connect_structured_push_consumer ( in CosNotifyComm::StructuredPushConsumer push_consumer) raises (CosEventChannelAdmin::AlreadyConnected, CosEventChannelAdmin::TypeError ); void suspend_connection() raises (ConnectionAlreadyInactive); void resume_connection() raises (ConnectionAlreadyActive); }; // StructuredProxyPushSupplier interface SequenceProxyPushSupplier : ProxySupplier, CosNotifyComm::SequencePushSupplier { void connect_sequence_push_consumer ( in CosNotifyComm::SequencePushConsumer push_consumer) raises (CosEventChannelAdmin::AlreadyConnected, CosEventChannelAdmin::TypeError ); void suspend_connection() raises (ConnectionAlreadyInactive); void resume_connection() raises (ConnectionAlreadyActive); }; // SequenceProxyPushSupplier typedef long ProxyID; typedef sequence ProxyIDSeq; enum ClientType { ANY_EVENT, STRUCTURED_EVENT, SEQUENCE_EVENT }; enum InterFilterGroupOperator { AND_OP, OR_OP }; typedef long AdminID; typedef sequence AdminIDSeq; exception AdminNotFound {}; exception ProxyNotFound {}; struct AdminLimit { CosTrading::PropertyName name; CosTrading::PropertyValue value; }; exception AdminLimitExceeded { AdminLimit admin_property_err; }; interface ConsumerAdmin : CosNotification::QoSAdmin, CosNotifyComm::NotifySubscribe, CosNotifyFilter::FilterAdmin, CosEventChannelAdmin::ConsumerAdmin { readonly attribute AdminID MyID; readonly attribute EventChannel MyChannel; readonly attribute InterFilterGroupOperator MyOperator; attribute CosNotifyFilter::MappingFilter priority_filter; attribute CosNotifyFilter::MappingFilter lifetime_filter; readonly attribute ProxyIDSeq pull_suppliers; readonly attribute ProxyIDSeq push_suppliers; ProxySupplier get_proxy_supplier ( in ProxyID proxy_id ) raises ( ProxyNotFound ); ProxySupplier obtain_notification_pull_supplier ( in ClientType ctype, out ProxyID proxy_id) raises ( AdminLimitExceeded ); ProxySupplier obtain_notification_push_supplier ( in ClientType ctype, out ProxyID proxy_id) raises ( AdminLimitExceeded ); ProxySupplier obtain_txn_notification_pull_supplier ( in ClientType ctype, out ProxyID proxy_id) raises ( AdminLimitExceeded ); void destroy(); }; // ConsumerAdmin interface SupplierAdmin : CosNotification::QoSAdmin, CosNotifyComm::NotifyPublish, CosNotifyFilter::FilterAdmin, CosEventChannelAdmin::SupplierAdmin { readonly attribute AdminID MyID; readonly attribute EventChannel MyChannel; readonly attribute InterFilterGroupOperator MyOperator; readonly attribute ProxyIDSeq pull_consumers; readonly attribute ProxyIDSeq push_consumers; ProxyConsumer get_proxy_consumer ( in ProxyID proxy_id ) raises ( ProxyNotFound ); ProxyConsumer obtain_notification_pull_consumer ( in ClientType ctype, out ProxyID proxy_id) raises ( AdminLimitExceeded ); ProxyConsumer obtain_notification_push_consumer ( in ClientType ctype, out ProxyID proxy_id) raises ( AdminLimitExceeded ); ProxyConsumer obtain_txn_notification_push_consumer ( in ClientType ctype, out ProxyID proxy_id) raises ( AdminLimitExceeded ); void destroy(); }; // SupplierAdmin interface EventChannel : CosNotification::QoSAdmin, CosNotification::AdminPropertiesAdmin, CosEventChannelAdmin::EventChannel { readonly attribute EventChannelFactory MyFactory; readonly attribute ConsumerAdmin default_consumer_admin; readonly attribute SupplierAdmin default_supplier_admin; readonly attribute CosNotifyFilter::FilterFactory default_filter_factory; ConsumerAdmin new_for_consumers( in InterFilterGroupOperator op, out AdminID id ); SupplierAdmin new_for_suppliers( in InterFilterGroupOperator op, out AdminID id ); ConsumerAdmin get_consumeradmin ( in AdminID id ) raises (AdminNotFound); SupplierAdmin get_supplieradmin ( in AdminID id ) raises (AdminNotFound); AdminIDSeq get_all_consumeradmins(); AdminIDSeq get_all_supplieradmins(); }; // EventChannel typedef long ChannelID; typedef sequence ChannelIDSeq; exception ChannelNotFound {}; interface EventChannelFactory { EventChannel create_channel ( in CosNotification::QoSProperties initial_qos, in CosNotification::AdminProperties initial_admin, out ChannelID id) raises (CosNotification::UnsupportedQoS, CosNotification::UnsupportedAdmin ); ChannelIDSeq get_all_channels(); EventChannel get_event_channel ( in ChannelID id ) raises (ChannelNotFound); }; // EventChannelFactory }; // CosNotifyChannelAdmin