Mercurial > hg > orthanc-stone
comparison Framework/Deprecated/Toolbox/OrthancApiClient.cpp @ 1060:e146743f6cdc broker
removing file MessageBroker.h
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 11 Oct 2019 17:20:41 +0200 |
parents | 861c080ef47b |
children | b537002f83a9 |
comparison
equal
deleted
inserted
replaced
1059:e713f1a99861 | 1060:e146743f6cdc |
---|---|
71 std::auto_ptr< OrthancStone::MessageHandler<EmptyResponseReadyMessage> > emptyHandler_; | 71 std::auto_ptr< OrthancStone::MessageHandler<EmptyResponseReadyMessage> > emptyHandler_; |
72 std::auto_ptr< OrthancStone::MessageHandler<JsonResponseReadyMessage> > jsonHandler_; | 72 std::auto_ptr< OrthancStone::MessageHandler<JsonResponseReadyMessage> > jsonHandler_; |
73 std::auto_ptr< OrthancStone::MessageHandler<BinaryResponseReadyMessage> > binaryHandler_; | 73 std::auto_ptr< OrthancStone::MessageHandler<BinaryResponseReadyMessage> > binaryHandler_; |
74 std::auto_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > failureHandler_; | 74 std::auto_ptr< OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage> > failureHandler_; |
75 std::auto_ptr< Orthanc::IDynamicObject > userPayload_; | 75 std::auto_ptr< Orthanc::IDynamicObject > userPayload_; |
76 OrthancStone::MessageBroker& broker_; | |
77 void NotifyConversionError(const IWebService::HttpRequestSuccessMessage& message) const | 76 void NotifyConversionError(const IWebService::HttpRequestSuccessMessage& message) const |
78 { | 77 { |
79 if (failureHandler_.get() != NULL) | 78 if (failureHandler_.get() != NULL) |
80 { | 79 { |
81 failureHandler_->Apply(IWebService::HttpRequestErrorMessage | 80 failureHandler_->Apply(IWebService::HttpRequestErrorMessage |
82 (message.GetUri(), Orthanc::HttpStatus_None, userPayload_.get())); | 81 (message.GetUri(), Orthanc::HttpStatus_None, userPayload_.get())); |
83 } | 82 } |
84 } | 83 } |
85 | 84 |
86 public: | 85 public: |
87 WebServicePayload(OrthancStone::MessageBroker& broker, | 86 WebServicePayload(OrthancStone::MessageHandler<EmptyResponseReadyMessage>* handler, |
88 OrthancStone::MessageHandler<EmptyResponseReadyMessage>* handler, | |
89 OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, | 87 OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, |
90 Orthanc::IDynamicObject* userPayload) : | 88 Orthanc::IDynamicObject* userPayload) : |
91 emptyHandler_(handler), | 89 emptyHandler_(handler), |
92 failureHandler_(failureHandler), | 90 failureHandler_(failureHandler), |
93 userPayload_(userPayload), | 91 userPayload_(userPayload) |
94 broker_(broker) | |
95 | 92 |
96 { | 93 { |
97 if (handler == NULL) | 94 if (handler == NULL) |
98 { | 95 { |
99 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); | 96 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
100 } | 97 } |
101 } | 98 } |
102 | 99 |
103 WebServicePayload(OrthancStone::MessageBroker& broker, | 100 WebServicePayload(OrthancStone::MessageHandler<BinaryResponseReadyMessage>* handler, |
104 OrthancStone::MessageHandler<BinaryResponseReadyMessage>* handler, | |
105 OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, | 101 OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, |
106 Orthanc::IDynamicObject* userPayload) : | 102 Orthanc::IDynamicObject* userPayload) : |
107 binaryHandler_(handler), | 103 binaryHandler_(handler), |
108 failureHandler_(failureHandler), | 104 failureHandler_(failureHandler), |
109 userPayload_(userPayload), | 105 userPayload_(userPayload) |
110 broker_(broker) | |
111 { | 106 { |
112 if (handler == NULL) | 107 if (handler == NULL) |
113 { | 108 { |
114 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); | 109 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
115 } | 110 } |
116 } | 111 } |
117 | 112 |
118 WebServicePayload(OrthancStone::MessageBroker& broker, | 113 WebServicePayload(OrthancStone::MessageHandler<JsonResponseReadyMessage>* handler, |
119 OrthancStone::MessageHandler<JsonResponseReadyMessage>* handler, | |
120 OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, | 114 OrthancStone::MessageHandler<IWebService::HttpRequestErrorMessage>* failureHandler, |
121 Orthanc::IDynamicObject* userPayload) : | 115 Orthanc::IDynamicObject* userPayload) : |
122 jsonHandler_(handler), | 116 jsonHandler_(handler), |
123 failureHandler_(failureHandler), | 117 failureHandler_(failureHandler), |
124 userPayload_(userPayload), | 118 userPayload_(userPayload) |
125 broker_(broker) | |
126 { | 119 { |
127 if (handler == NULL) | 120 if (handler == NULL) |
128 { | 121 { |
129 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); | 122 throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); |
130 } | 123 } |