00001
00002
00003
00004
00005
00006
00007
00008 #include "FailoverListener.h"
00009 #include "dds/DCPS/Service_Participant.h"
00010 #include "dds/DCPS/debug.h"
00011
00012 namespace OpenDDS {
00013 namespace DCPS {
00014
00015 FailoverListener::FailoverListener(Discovery::RepoKey key)
00016 : key_(key)
00017 {
00018 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00019 ACE_DEBUG((LM_DEBUG,
00020 ACE_TEXT("(%P|%t) FailoverListener::FailoverListener( key==%C)\n"),
00021 key.c_str()));
00022 }
00023 }
00024
00025 FailoverListener::~FailoverListener()
00026 {
00027 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00028 ACE_DEBUG((LM_DEBUG,
00029 ACE_TEXT("(%P|%t) FailoverListener::~FailoverListener\n")));
00030 }
00031 }
00032
00033 void
00034 FailoverListener::on_data_available(
00035 DDS::DataReader_ptr )
00036 {
00037 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00038 ACE_DEBUG((LM_DEBUG,
00039 ACE_TEXT("(%P|%t) FailoverListener::on_data_available\n")));
00040 }
00041 }
00042
00043 void
00044 FailoverListener::on_requested_deadline_missed(
00045 DDS::DataReader_ptr ,
00046 const DDS::RequestedDeadlineMissedStatus & )
00047 {
00048 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00049 ACE_DEBUG((LM_DEBUG,
00050 ACE_TEXT("(%P|%t) ")
00051 ACE_TEXT("Federatorer::on_requested_deadline_missed\n")));
00052 }
00053 }
00054
00055 void
00056 FailoverListener::on_requested_incompatible_qos(
00057 DDS::DataReader_ptr ,
00058 const DDS::RequestedIncompatibleQosStatus & )
00059 {
00060 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00061 ACE_DEBUG((LM_DEBUG,
00062 ACE_TEXT("(%P|%t) FailoverListener::")
00063 ACE_TEXT("on_requested_incompatible_qos\n")));
00064 }
00065 }
00066
00067 void
00068 FailoverListener::on_liveliness_changed(
00069 DDS::DataReader_ptr ,
00070 const DDS::LivelinessChangedStatus & )
00071 {
00072 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00073 ACE_DEBUG((LM_DEBUG,
00074 ACE_TEXT("(%P|%t) FailoverListener::on_liveliness_changed\n")));
00075 }
00076 }
00077
00078 void
00079 FailoverListener::on_subscription_matched(
00080 DDS::DataReader_ptr ,
00081 const DDS::SubscriptionMatchedStatus & )
00082 {
00083 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00084 ACE_DEBUG((LM_DEBUG,
00085 ACE_TEXT("(%P|%t) FailoverListener::on_subscription_matched\n")));
00086 }
00087 }
00088
00089 void
00090 FailoverListener::on_sample_rejected(
00091 DDS::DataReader_ptr ,
00092 const DDS::SampleRejectedStatus& )
00093 {
00094 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00095 ACE_DEBUG((LM_DEBUG,
00096 ACE_TEXT("(%P|%t) FailoverListener::on_sample_rejected\n")));
00097 }
00098 }
00099
00100 void
00101 FailoverListener::on_sample_lost(
00102 DDS::DataReader_ptr ,
00103 const DDS::SampleLostStatus& )
00104 {
00105 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00106 ACE_DEBUG((LM_DEBUG,
00107 ACE_TEXT("(%P|%t) FailoverListener::on_sample_lost\n")));
00108 }
00109 }
00110
00111 void
00112 FailoverListener::on_subscription_disconnected(
00113 DDS::DataReader_ptr ,
00114 const OpenDDS::DCPS::SubscriptionDisconnectedStatus& )
00115 {
00116 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00117 ACE_DEBUG((LM_DEBUG,
00118 ACE_TEXT("(%P|%t) FailoverListener::on_subscription_disconnected\n")));
00119 }
00120 TheServiceParticipant->repository_lost(this->key_);
00121 }
00122
00123 void
00124 FailoverListener::on_subscription_reconnected(
00125 DDS::DataReader_ptr ,
00126 const OpenDDS::DCPS::SubscriptionReconnectedStatus& )
00127 {
00128 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00129 ACE_DEBUG((LM_DEBUG,
00130 ACE_TEXT("(%P|%t) FailoverListener::on_subscription_reconnected\n")));
00131 }
00132 }
00133
00134 void
00135 FailoverListener::on_subscription_lost(
00136 DDS::DataReader_ptr ,
00137 const OpenDDS::DCPS::SubscriptionLostStatus& )
00138 {
00139 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00140 ACE_DEBUG((LM_DEBUG,
00141 ACE_TEXT("(%P|%t) FailoverListener::on_subscription_lost: ")
00142 ACE_TEXT("initiating failover sequencing.\n")));
00143 }
00144
00145 TheServiceParticipant->repository_lost(this->key_);
00146 }
00147
00148 void
00149 FailoverListener::on_connection_deleted(
00150 DDS::DataReader_ptr )
00151 {
00152 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00153 ACE_DEBUG((LM_DEBUG,
00154 ACE_TEXT("(%P|%t) FailoverListener::on_connection_deleted\n")));
00155 }
00156 }
00157
00158 void
00159 FailoverListener::on_budget_exceeded(
00160 DDS::DataReader_ptr ,
00161 const OpenDDS::DCPS::BudgetExceededStatus& )
00162 {
00163 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
00164 ACE_DEBUG((LM_DEBUG,
00165 ACE_TEXT("(%P|%t) FailoverListener::on_budget_exceeded\n")));
00166 }
00167 }
00168
00169 }
00170 }