it_bus/fault_exception.h

00001 #ifndef _IT_BUS_FAULT_EXCEPTION_H_
00002 #define _IT_BUS_FAULT_EXCEPTION_H_
00003 
00004 // @Copyright 2004 IONA Technologies, Plc. All Rights Reserved.
00005 //
00006 #include <it_bus/any.h>
00007 #include <it_bus/types.h>
00008 #include <it_bus/qname.h>
00009 #include <it_bus/sequence_complex_type.h>
00010 #include <it_bus/any_simple_type.h>
00011 
00012 namespace IT_WSDL
00013 {
00014     class WSDLPortType;
00015     class AnySimpleTypeReader;
00016 }
00017 
00018 namespace IT_Bus
00019 {
00020     class ComplexTypeReader;
00021     class ComplexTypeWriter;
00022 
00028     class IT_BUS_API FaultCategory : public AnySimpleType
00029     {
00030       public:
00034         enum Category
00035         {
00036             NO_PERMISSION,
00037             CONNECTION_FAILURE,
00038             MARSHAL_ERROR,
00039             NOT_EXIST,
00040             TRANSIENT,
00041             UNKNOWN,
00042             TIMEOUT,
00043             VERSION_ERROR,
00044             NOT_UNDERSTOOD,
00045             MEMORY,
00046             BAD_OPERATION,
00047             INTERNAL,
00048             INVALID_REFERENCE,
00049             NOT_IMPLEMENTED,
00050             LICENSE
00051         };
00052 
00053       private:
00054         static const QName m_type;
00055         Category m_val;
00056 
00057       public:
00058         FaultCategory();
00059 
00060         FaultCategory(const Category value);
00061 
00062         FaultCategory(const FaultCategory & value);
00063 
00064         virtual void
00065         write_value(
00066             AnySimpleTypeWriter & writer
00067         ) const throw((SerializationException));
00068 
00069         virtual void
00070         read_value(
00071             AnySimpleTypeReader & reader
00072         ) throw((DeserializationException));
00073 
00074         virtual const QName &
00075         get_type() const;
00076 
00077         FaultCategory &
00078         operator=(
00079             const FaultCategory & rhs
00080         )
00081         {
00082             (AnyType & ) (*this).copy(rhs);
00083             return * this;
00084         }
00085 
00086         virtual AnyType& copy (
00087             const AnyType& assign
00088         );
00089 
00090         Boolean operator== (
00091             const FaultCategory& copy
00092         );
00093 
00099         void set_value(const Category value);
00100 
00106         Category get_value() const;
00107 
00108         String
00109         to_string() const;
00110 
00111         void
00112         set_value(
00113             const String & data
00114         );
00115     };
00116 
00117 
00123     class IT_BUS_API FaultSource : public AnySimpleType
00124     {
00125       public:
00126         enum Source
00127         {
00128             CLIENT,
00129             SERVER,
00130             UNKNOWN
00131         };
00132 
00133       private:
00134         static const QName m_type;
00135         Source m_val;
00136 
00137       public:
00138         FaultSource();
00139 
00140         FaultSource(const Source value);
00141 
00142         FaultSource(const FaultSource & value);
00143 
00144         virtual void
00145         write_value(
00146             AnySimpleTypeWriter & writer
00147         ) const throw((SerializationException));
00148 
00149         virtual void
00150         read_value(
00151             AnySimpleTypeReader & reader
00152         ) throw((DeserializationException));
00153 
00154         virtual const QName &
00155         get_type() const;
00156 
00157         FaultSource &
00158         operator=(
00159             const FaultSource & rhs
00160         )
00161         {
00162             (AnyType & ) (*this).copy(rhs);
00163             return * this;
00164         }
00165 
00166         virtual AnyType& copy (
00167             const AnyType& assign
00168         );
00169 
00170         Boolean operator== (
00171             const FaultSource& copy
00172         );
00173 
00179         void set_value(const Source value);
00180 
00186         Source get_value() const;
00187 
00188         String
00189         to_string() const;
00190 
00191         void
00192         set_value(
00193             const String & data
00194         );
00195     };
00196 
00197 
00206     class IT_BUS_API FaultCompletionStatus : public AnySimpleType
00207     {
00208       public:
00209         enum CompletionStatus
00210         {
00211             YES,
00212             NO,
00213             MAYBE
00214         };
00215 
00216       private:
00217         static const QName m_type;
00218         CompletionStatus m_val;
00219 
00220       public:
00221         FaultCompletionStatus();
00222 
00223         FaultCompletionStatus(const CompletionStatus value);
00224 
00225         FaultCompletionStatus(const FaultCompletionStatus & value);
00226 
00227         virtual void
00228         write_value(
00229             AnySimpleTypeWriter & writer
00230         ) const throw((SerializationException));
00231 
00232         virtual void
00233         read_value(
00234             AnySimpleTypeReader & reader
00235         ) throw((DeserializationException));
00236 
00237         virtual const QName &
00238         get_type() const;
00239 
00240         FaultCompletionStatus &
00241         operator=(
00242             const FaultCompletionStatus & rhs
00243         )
00244         {
00245             (AnyType & ) (*this).copy(rhs);
00246             return * this;
00247         }
00248 
00249         virtual AnyType& copy (
00250             const AnyType& assign
00251         );
00252 
00253         Boolean operator== (
00254             const FaultCompletionStatus& copy
00255         );
00256 
00262         void set_value(const CompletionStatus value);
00263 
00269         CompletionStatus get_value() const;
00270 
00271         String
00272         to_string() const;
00273 
00274         void
00275         set_value(
00276             const String & data
00277         );
00278     };
00279 
00280 
00281     class IT_BUS_API FaultDetail : public IT_Bus::SequenceComplexType
00282     {
00283 
00284       public:
00285 
00286         static const IT_Bus::QName&
00287         get_static_type();
00288         
00289         FaultDetail();
00290         FaultDetail(const FaultDetail & copy);
00291         virtual ~FaultDetail();
00292 
00293         IT_Bus::AnyType &
00294         copy(const IT_Bus::AnyType & rhs);
00295 
00296         FaultDetail &
00297         operator=(const FaultDetail & rhs);
00298 
00299         virtual const IT_Bus::QName &
00300         get_type() const;
00301 
00302         virtual void
00303         write_contents(
00304             IT_Bus::ComplexTypeWriter & writer
00305         ) const throw((IT_Bus::SerializationException));
00306 
00307         virtual void
00308         read_contents(
00309             IT_Bus::ComplexTypeReader & reader
00310         ) throw((IT_Bus::DeserializationException));
00311 
00312         IT_Bus::AnyList &
00313         get_detail_entries();
00314 
00315         const IT_Bus::AnyList &
00316         get_detail_entries() const;
00317 
00318         void 
00319         set_detail_entries(const IT_Vector<IT_Bus::Any> & val);
00320 
00321       private:
00322         static const QName m_type;
00323         IT_Bus::AnyList *var_any;        
00324     };
00325 
00337     class IT_BUS_API FaultException :
00338         public SequenceComplexType,
00339         public Exception
00340     {
00341       private:
00342         static const QName m_qname;
00343 
00344         static const QName m_category_qname;
00345 
00346         static const QName m_namespace_uri_qname;
00347 
00348         static const QName m_code_qname;
00349 
00350         static const QName m_detail_qname;
00351 
00352         static const QName m_source_qname;
00353 
00354         static const QName m_completion_status_qname;
00355 
00356         static const QName m_description_qname;
00357 
00358         static const QName m_server_id_qname;
00359 
00360       public:
00361 
00362         FaultException(
00363             const FaultCategory::Category category,
00364             const String & namespace_uri,
00365             const String & code
00366         );
00367 
00371         FaultException();
00372 
00376         FaultException(const FaultException& copy);
00377 
00381         virtual ~FaultException();
00382 
00386         virtual Exception*
00387         clone() const;
00388     
00392         virtual void
00393         rethrow() const;
00394 
00395         virtual void
00396         read_contents(
00397             ComplexTypeReader & reader
00398         ) throw((DeserializationException));
00399 
00400         virtual void
00401         write_contents(
00402             ComplexTypeWriter & writer
00403         ) const throw((SerializationException));
00404 
00405         virtual const QName &
00406         get_type() const;
00407 
00408         FaultException &
00409         operator=(
00410             const FaultException & rhs
00411         )
00412         {
00413             (AnyType & ) (*this).copy(rhs);
00414             return * this;
00415         }
00416 
00417         virtual AnyType& copy (
00418             const AnyType& assign
00419         );
00420 
00426         const FaultCategory &
00427         get_category() const;
00428 
00434         FaultCategory &
00435         get_category();
00436 
00442         void
00443         set_category(const FaultCategory & val);
00444 
00451         const String &
00452         get_namespace_uri() const;
00453 
00460         String &
00461         get_namespace_uri();
00462 
00469         void
00470         set_namespace_uri(const String & val);
00471 
00472         const String &
00473         get_code() const;
00474 
00475         String &
00476         get_code();
00477 
00478         void
00479         set_code(const String & val);
00480 
00481         const String &
00482         get_detail() const;
00483 
00484         String &
00485         get_detail();
00486 
00487         void
00488         set_detail(const String & val);
00489 
00490         const FaultDetail &
00491         get_any_detail() const;
00492 
00493         FaultDetail &
00494         get_any_detail();
00495 
00496         void
00497         set_any_detail(const FaultDetail & val);
00498 
00505         const FaultSource &
00506         get_source() const;
00507 
00514         FaultSource &
00515         get_source();
00516 
00523         void
00524         set_source(const FaultSource & val);
00525 
00532         const FaultCompletionStatus &
00533         get_completion_status() const;
00534 
00541         FaultCompletionStatus &
00542         get_completion_status();
00543 
00550         void
00551         set_completion_status(const FaultCompletionStatus & val);
00552 
00558         const String &
00559         get_description() const;
00560 
00566         String &
00567         get_description();
00568 
00574         void
00575         set_description(const String & val);
00576 
00577         const String &
00578         get_server_id() const;
00579 
00580         String &
00581         get_server_id();
00582 
00583         void
00584         set_server_id(const String & val);
00585 
00586         static bool
00587         has_fault_exception_fault_message(
00588             const IT_WSDL::WSDLPortType & port_type,
00589             const String & operation_name
00590         );
00591 
00592         const bool
00593         is_detail_set() const;
00594 
00595         bool
00596         is_detail_set();
00597 
00598 
00599     private:
00600 
00601         FaultCategory m_category;
00602 
00603         String m_namespace_uri;
00604 
00605         String m_code;
00606 
00607         String m_detail;
00608 
00609         FaultDetail m_any_detail;
00610 
00611         FaultSource m_source;
00612 
00613         FaultCompletionStatus m_completion_status;
00614 
00615         String m_description;
00616 
00617         String m_server_id;
00618 
00619         bool m_is_detail_set;
00620     };
00621 }
00622 
00623 #endif  

Generated on Tue Mar 20 15:27:41 2007 for Artix by  doxygen 1.5.1-p1