00001 #ifndef _COS_BRIDGE_ADMIN_ 00002 #define _COS_BRIDGE_ADMIN_ 00003 00004 #include <orbdefs.idl> 00005 00006 #include <CosNotifyComm.idl> 00007 #include <CosNotifyChannelAdmin.idl> 00008 00009 #pragma prefix "omg.org" 00010 00011 module CosBridgeAdmin 00012 { 00013 enum ExternalEndpointRole 00014 { 00015 SOURCE, 00016 SINK 00017 }; 00018 00019 enum JMSDestinationType 00020 { 00021 QUEUE, 00022 TOPIC 00023 }; 00024 00025 enum MessageType 00026 { 00027 JMS_MESSAGE, 00028 STRUCTURED_EVENT, 00029 SEQUENCE_EVENT 00030 }; 00031 00032 enum FlowStyle 00033 { 00034 PUSH, 00035 PULL 00036 }; 00037 00038 struct JMSDestination 00039 { 00040 JMSDestinationType destination_type; 00041 string destination_name; 00042 string factory_name; 00043 }; 00044 00045 union ExternalEndpointConnector switch (MessageType) 00046 { 00047 case JMS_MESSAGE: JMSDestination destination; 00048 default: CosNotifyChannelAdmin::ChannelID channel_id; 00049 }; 00050 00051 struct ExternalEndpoint 00052 { 00053 ExternalEndpointRole role; 00054 ExternalEndpointConnector connector; 00055 FlowStyle style; 00056 MessageType type; 00057 }; 00058 00059 enum ExternalEndpointErrorCode 00060 { 00061 INVALID_CHANNELID, 00062 INVALID_JMSDESTINATION, 00063 MISMATCH_ENDPOINTROLE_NOTIFSTYLE 00064 }; 00065 00066 struct ExternalEndpointError 00067 { 00068 ExternalEndpointRole role; 00069 ExternalEndpointErrorCode code; 00070 }; 00071 00072 typedef sequence<ExternalEndpointError> ExternalEndpointErrorSeq; 00073 00074 exception InvalidExternalEndPoints 00075 { 00076 ExternalEndpointErrorSeq error; 00077 }; 00078 00079 typedef long BridgeID; 00080 typedef sequence<BridgeID> BridgeIDSeq; 00081 00082 exception BridgeAlreadyStarted {}; 00083 exception BridgeInactive {}; 00084 exception BridgeNotFound {}; 00085 00086 enum status 00087 { 00088 stopped, 00089 started 00090 }; 00091 00092 interface BridgeFactory; 00093 00094 interface Bridge 00095 { 00096 readonly attribute ExternalEndpoint end_point_receiver; 00097 readonly attribute ExternalEndpoint end_point_sender; 00098 00099 void start_bridge () raises (BridgeAlreadyStarted); 00100 void stop_bridge () raises (BridgeInactive); 00101 status get_status(); 00102 void destroy (); 00103 }; 00104 00105 interface BridgeFactory 00106 { 00107 Bridge create_bridge (in ExternalEndpoint source, in ExternalEndpoint sink, out BridgeID id) 00108 raises (InvalidExternalEndPoints); 00109 Bridge get_bridge_with_id (in BridgeID id) 00110 raises (BridgeNotFound); 00111 BridgeIDSeq get_all_bridges(); 00112 }; 00113 }; 00114 00115 #endif