Merge pull request #1551 from DOCGroup/plm_jira_333
[ACE_TAO.git] / TAO / orbsvcs / FT_ReplicationManager / FT_FaultEventDescriptor.cpp
blob16a91f67f15163a8f8802a5364db7c5e41af8b27
1 /* -*- C++ -*- */
2 //=============================================================================
3 /**
4 * @file FT_FaultEventDescriptor.cpp
6 * This file is part of TAO's implementation of Fault Tolerant CORBA.
7 * This file provides the implementation of the
8 * TAO::FT_FaultEventDescriptor structure. The
9 * TAO::FT_FaultEventDescriptor is a helper type used during
10 * analysis of fault events.
12 * @author Steve Totten <totten_s@ociweb.com>
14 //=============================================================================
16 #include "orbsvcs/Log_Macros.h"
17 #include "FT_FaultEventDescriptor.h"
19 #include "ace/SString.h"
21 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
23 // Default constructor.
24 TAO::FT_FaultEventDescriptor::FT_FaultEventDescriptor ()
25 : all_at_location_failed (0)
26 , all_of_type_at_location_failed (0)
27 , object_at_location_failed (0)
28 , object_is_primary (0)
29 , type_id (CORBA::string_dup (""))
30 , object_group_id (PortableGroup::ObjectGroupId (0))
34 // Debugging support.
35 void TAO::FT_FaultEventDescriptor::dump ()
37 // Get the location as a string.
38 ACE_CString loc_as_string;
39 for (CORBA::ULong li = 0; li < this->location->length(); ++li)
41 if (li > 0) loc_as_string += "/";
42 // Assume only the "id" field of the CosNaming::Name is used.
43 loc_as_string += CORBA::string_dup (this->location[li].id);
46 if (this->all_at_location_failed == 1)
48 ORBSVCS_DEBUG ((LM_DEBUG,
49 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
50 ACE_TEXT ("All objects at location <%s> failed.\n"),
51 loc_as_string.c_str()
52 ));
55 if (this->all_of_type_at_location_failed == 1)
57 ORBSVCS_DEBUG ((LM_DEBUG,
58 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
59 ACE_TEXT ("All objects of type <%s> at location <%s> failed.\n"),
60 this->type_id.in(),
61 loc_as_string.c_str()
62 ));
65 if (this->object_at_location_failed == 1)
67 ORBSVCS_DEBUG ((LM_DEBUG,
68 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
69 ACE_TEXT ("Replica of type <%s> with ObjectGroupId <%Q> ")
70 ACE_TEXT ("at location <%s> failed.\n"),
71 this->type_id.in(),
72 this->object_group_id,
73 loc_as_string.c_str()
74 ));
77 if (this->object_is_primary == 1)
79 ORBSVCS_DEBUG ((LM_DEBUG,
80 ACE_TEXT ("TAO::FT_FaultEventDescriptor::dump: ")
81 ACE_TEXT ("Primary replica of ObjectGroupId <%Q> failed.\n"),
82 this->object_group_id
83 ));
87 TAO_END_VERSIONED_NAMESPACE_DECL