Back to index

nordugrid-arc-nox  1.1.0~rc6
WSResourceProperties.h
Go to the documentation of this file.
00001 #ifndef __ARC_WSRP_H__
00002 #define __ARC_WSRP_H__
00003 
00004 #include <vector>
00005 #include <arc/message/SOAPEnvelope.h>
00006 #include "WSRFBaseFault.h"
00007 
00008 namespace Arc {
00009 
00011 
00014 class WSRP: public WSRF {
00015  protected:
00017   void set_namespaces(void);
00018  public:
00020   WSRP(bool fault = false,const std::string& action = "");
00024   WSRP(SOAPEnvelope& soap,const std::string& action = "");
00025   ~WSRP(void) { };
00026 };
00027 
00028 
00029 // ==================== Faults ================================
00030 
00032 class WSRPFault: public WSRFBaseFault {
00033  public:
00035   WSRPFault(SOAPEnvelope& soap);
00037   WSRPFault(const std::string& type);
00038   virtual ~WSRPFault(void);
00039 };
00040 
00041 class WSRPInvalidResourcePropertyQNameFault: public WSRPFault {
00042  public:
00043    WSRPInvalidResourcePropertyQNameFault(SOAPEnvelope& soap):WSRPFault(soap) { };
00044    WSRPInvalidResourcePropertyQNameFault(void):WSRPFault("wsrf-rp:InvalidResourcePropertyQNameFault") { };
00045    virtual ~WSRPInvalidResourcePropertyQNameFault(void) { };
00046 };
00047 
00049 class WSRPResourcePropertyChangeFailure: public WSRPFault {
00050  public:
00052    WSRPResourcePropertyChangeFailure(SOAPEnvelope& soap):WSRPFault(soap) { };
00054    WSRPResourcePropertyChangeFailure(const std::string& type):WSRPFault(type) { };
00055    virtual ~WSRPResourcePropertyChangeFailure(void) { };
00056    XMLNode CurrentProperties(bool create = false);
00057    XMLNode RequestedProperties(bool create = false);
00058 };
00059 
00060 class WSRPUnableToPutResourcePropertyDocumentFault: public WSRPResourcePropertyChangeFailure {
00061  public:
00062    WSRPUnableToPutResourcePropertyDocumentFault(SOAPEnvelope& soap):WSRPResourcePropertyChangeFailure(soap) { };
00063    WSRPUnableToPutResourcePropertyDocumentFault(void):WSRPResourcePropertyChangeFailure("wsrf-rp:UnableToPutResourcePropertyDocumentFault") { };
00064    virtual ~WSRPUnableToPutResourcePropertyDocumentFault(void) { };
00065 };
00066 
00067 class WSRPInvalidModificationFault: public WSRPResourcePropertyChangeFailure {
00068  public:
00069    WSRPInvalidModificationFault(SOAPEnvelope& soap):WSRPResourcePropertyChangeFailure(soap) { };
00070    WSRPInvalidModificationFault(void):WSRPResourcePropertyChangeFailure("wsrf-rp:InvalidModificationFault") { };
00071    virtual ~WSRPInvalidModificationFault(void) { };
00072 };
00073 
00074 class WSRPUnableToModifyResourcePropertyFault: public WSRPResourcePropertyChangeFailure {
00075  public:
00076    WSRPUnableToModifyResourcePropertyFault(SOAPEnvelope& soap):WSRPResourcePropertyChangeFailure(soap) { };
00077    WSRPUnableToModifyResourcePropertyFault(void):WSRPResourcePropertyChangeFailure("wsrf-rp:UnableToModifyResourcePropertyFault") { };
00078    virtual ~WSRPUnableToModifyResourcePropertyFault(void) { };
00079 };
00080 
00081 class WSRPSetResourcePropertyRequestFailedFault: public WSRPResourcePropertyChangeFailure {
00082  public:
00083    WSRPSetResourcePropertyRequestFailedFault(SOAPEnvelope& soap):WSRPResourcePropertyChangeFailure(soap) { };
00084    WSRPSetResourcePropertyRequestFailedFault(void):WSRPResourcePropertyChangeFailure("wsrf-rp:SetResourcePropertyRequestFailedFault") { };
00085    virtual ~WSRPSetResourcePropertyRequestFailedFault(void) { };
00086 };
00087 
00088 class WSRPInsertResourcePropertiesRequestFailedFault: public WSRPResourcePropertyChangeFailure {
00089  public:
00090    WSRPInsertResourcePropertiesRequestFailedFault(SOAPEnvelope& soap):WSRPResourcePropertyChangeFailure(soap) { };
00091    WSRPInsertResourcePropertiesRequestFailedFault(void):WSRPResourcePropertyChangeFailure("wsrf-rp:InsertResourcePropertiesRequestFailedFault") { };
00092    virtual ~WSRPInsertResourcePropertiesRequestFailedFault(void) { };
00093 };
00094 
00095 class WSRPUpdateResourcePropertiesRequestFailedFault: public WSRPResourcePropertyChangeFailure {
00096  public:
00097    WSRPUpdateResourcePropertiesRequestFailedFault(SOAPEnvelope& soap):WSRPResourcePropertyChangeFailure(soap) { };
00098    WSRPUpdateResourcePropertiesRequestFailedFault(void):WSRPResourcePropertyChangeFailure("wsrf-rp:UpdateResourcePropertiesRequestFailedFault") { };
00099    virtual ~WSRPUpdateResourcePropertiesRequestFailedFault(void) { };
00100 };
00101 
00102 class WSRPDeleteResourcePropertiesRequestFailedFault: public WSRPResourcePropertyChangeFailure {
00103  public:
00104    WSRPDeleteResourcePropertiesRequestFailedFault(SOAPEnvelope& soap):WSRPResourcePropertyChangeFailure(soap) { };
00105    WSRPDeleteResourcePropertiesRequestFailedFault(void):WSRPResourcePropertyChangeFailure("wsrf-rp:DeleteResourcePropertiesRequestFailedFault") { };
00106    virtual ~WSRPDeleteResourcePropertiesRequestFailedFault(void) { };
00107 };
00108 
00109 
00110 // ============================================================
00111 class WSRPGetResourcePropertyDocumentRequest: public WSRP {
00112  public:
00113   WSRPGetResourcePropertyDocumentRequest(SOAPEnvelope& soap);
00114   WSRPGetResourcePropertyDocumentRequest(void);
00115   ~WSRPGetResourcePropertyDocumentRequest(void);
00116 };
00117 
00118 class WSRPGetResourcePropertyDocumentResponse: public WSRP {
00119  public:
00120   WSRPGetResourcePropertyDocumentResponse(SOAPEnvelope& soap);
00121   WSRPGetResourcePropertyDocumentResponse(const XMLNode& prop_doc = XMLNode());
00122   ~WSRPGetResourcePropertyDocumentResponse(void);
00123   void Document(const XMLNode& prop_doc);
00124   XMLNode Document(void);
00125 };
00126 
00127 // ============================================================
00128 class WSRPGetResourcePropertyRequest: public WSRP {
00129  public:
00130   WSRPGetResourcePropertyRequest(SOAPEnvelope& soap);
00131   WSRPGetResourcePropertyRequest(const std::string& name);
00132   ~WSRPGetResourcePropertyRequest(void);
00133   std::string Name(void);
00134   void Name(const std::string& name);
00135 };
00136 
00137 class WSRPGetResourcePropertyResponse: public WSRP {
00138  public:
00139   WSRPGetResourcePropertyResponse(SOAPEnvelope& soap);
00140   WSRPGetResourcePropertyResponse(void);
00141   //WSRPGetResourcePropertyResponse(const std::list<XMLNode>& properties);
00142   ~WSRPGetResourcePropertyResponse(void);
00143   int Size(void);
00144   void Property(const XMLNode& prop,int pos = -1);
00145   XMLNode Property(int pos);
00146   XMLNode Properties(void);
00147 };
00148 
00149 
00150 // ============================================================
00151 class WSRPGetMultipleResourcePropertiesRequest: public WSRP {
00152  public:
00153   WSRPGetMultipleResourcePropertiesRequest(SOAPEnvelope& soap);
00154   WSRPGetMultipleResourcePropertiesRequest(void);
00155   WSRPGetMultipleResourcePropertiesRequest(const std::vector<std::string>& names);
00156   ~WSRPGetMultipleResourcePropertiesRequest(void);
00157   std::vector<std::string> Names(void);
00158   void Names(const std::vector<std::string>& names);
00159 };
00160 
00161 class WSRPGetMultipleResourcePropertiesResponse: public WSRP {
00162  public:
00163   WSRPGetMultipleResourcePropertiesResponse(SOAPEnvelope& soap);
00164   WSRPGetMultipleResourcePropertiesResponse(void);
00165   //WSRPGetMultipleResourcePropertiesResponse(const std::list<XMLNode>& properties);
00166   ~WSRPGetMultipleResourcePropertiesResponse(void);
00167   int Size(void);
00168   void Property(const XMLNode& prop,int pos = -1);
00169   XMLNode Property(int pos);
00170   XMLNode Properties(void);
00171 };
00172 
00173 // ============================================================
00174 class WSRPPutResourcePropertyDocumentRequest: public WSRP {
00175  public:
00176   WSRPPutResourcePropertyDocumentRequest(SOAPEnvelope& soap);
00177   WSRPPutResourcePropertyDocumentRequest(const XMLNode& prop_doc = XMLNode());
00178   ~WSRPPutResourcePropertyDocumentRequest(void);
00179   void Document(const XMLNode& prop_doc);
00180   XMLNode Document(void);
00181 };
00182 
00183 class WSRPPutResourcePropertyDocumentResponse: public WSRP {
00184  public:
00185   WSRPPutResourcePropertyDocumentResponse(SOAPEnvelope& soap);
00186   WSRPPutResourcePropertyDocumentResponse(const XMLNode& prop_doc = XMLNode());
00187   ~WSRPPutResourcePropertyDocumentResponse(void);
00188   void Document(const XMLNode& prop_doc);
00189   XMLNode Document(void);
00190 };
00191 
00192 
00193 // ============================================================
00194 
00195 class WSRPModifyResourceProperties {
00196  protected:
00197   XMLNode element_;
00198  public:
00199   // Create new node in XML tree or acquire element from XML tree
00200   WSRPModifyResourceProperties(XMLNode& node,bool create,const std::string& name = "");
00201   WSRPModifyResourceProperties(void) { };
00202   virtual ~WSRPModifyResourceProperties(void);
00203   //operator XMLNode(void) { return element_; };
00204   operator bool(void) { return (bool)element_; };
00205   bool operator!(void) { return !element_; };
00206 };
00207 
00208 class WSRPInsertResourceProperties: public WSRPModifyResourceProperties {
00209  public:
00210   WSRPInsertResourceProperties(XMLNode node,bool create):WSRPModifyResourceProperties(node,create,"wsrf-rp:Insert") { };
00211   WSRPInsertResourceProperties(void) { };
00212   virtual ~WSRPInsertResourceProperties(void);
00213   XMLNode Properties(void) { return element_; };
00214 };
00215 
00216 class WSRPUpdateResourceProperties: public WSRPModifyResourceProperties {
00217  public:
00218   WSRPUpdateResourceProperties(XMLNode node,bool create):WSRPModifyResourceProperties(node,create,"wsrf-rp:Update") { };
00219   WSRPUpdateResourceProperties(void) { };
00220   virtual ~WSRPUpdateResourceProperties(void);
00221   XMLNode Properties(void) { return element_; };
00222 };
00223 
00224 class WSRPDeleteResourceProperties: public WSRPModifyResourceProperties {
00225  public:
00226   WSRPDeleteResourceProperties(XMLNode node,bool create):WSRPModifyResourceProperties(node,create,"wsrf-rp:Delete") { };
00227   WSRPDeleteResourceProperties(void) { };
00228   virtual ~WSRPDeleteResourceProperties(void);
00229   std::string Property(void);  
00230   void Property(const std::string& name); 
00231 };
00232 
00233 // ============================================================
00234 class WSRPSetResourcePropertiesRequest: public WSRP {
00235  public:
00236   WSRPSetResourcePropertiesRequest(SOAPEnvelope& soap);
00237   WSRPSetResourcePropertiesRequest(void);
00238   ~WSRPSetResourcePropertiesRequest(void);
00239   XMLNode Properties(void);
00240 };
00241 
00242 class WSRPSetResourcePropertiesResponse: public WSRP {
00243  public:
00244   WSRPSetResourcePropertiesResponse(SOAPEnvelope& soap);
00245   WSRPSetResourcePropertiesResponse(void);
00246   ~WSRPSetResourcePropertiesResponse(void);
00247 };
00248 
00249 
00250 // ============================================================
00251 class WSRPInsertResourcePropertiesRequest: public WSRP {
00252  public:
00253   WSRPInsertResourcePropertiesRequest(SOAPEnvelope& soap);
00254   WSRPInsertResourcePropertiesRequest(void);
00255   ~WSRPInsertResourcePropertiesRequest(void);
00256   WSRPInsertResourceProperties Property(void);
00257 };
00258 
00259 class WSRPInsertResourcePropertiesResponse: public WSRP {
00260  public:
00261   WSRPInsertResourcePropertiesResponse(SOAPEnvelope& soap);
00262   WSRPInsertResourcePropertiesResponse(void);
00263   ~WSRPInsertResourcePropertiesResponse(void);
00264 };
00265 
00266 // ============================================================
00267 class WSRPUpdateResourcePropertiesRequest: public WSRP {
00268  public:
00269   WSRPUpdateResourcePropertiesRequest(SOAPEnvelope& soap);
00270   WSRPUpdateResourcePropertiesRequest(void);
00271   ~WSRPUpdateResourcePropertiesRequest(void);
00272   WSRPUpdateResourceProperties Property(void);
00273 };
00274 
00275 class WSRPUpdateResourcePropertiesResponse: public WSRP {
00276  public:
00277   WSRPUpdateResourcePropertiesResponse(SOAPEnvelope& soap);
00278   WSRPUpdateResourcePropertiesResponse(void);
00279   ~WSRPUpdateResourcePropertiesResponse(void);
00280 };
00281 
00282 // ============================================================
00283 class WSRPDeleteResourcePropertiesRequest: public WSRP {
00284  public:
00285   WSRPDeleteResourcePropertiesRequest(SOAPEnvelope& soap);
00286   WSRPDeleteResourcePropertiesRequest(const std::string& name);
00287   WSRPDeleteResourcePropertiesRequest(void);
00288   ~WSRPDeleteResourcePropertiesRequest(void);
00289   std::string Name(void);
00290   void Name(const std::string& name);
00291 };
00292 
00293 class WSRPDeleteResourcePropertiesResponse: public WSRP {
00294  public:
00295   WSRPDeleteResourcePropertiesResponse(SOAPEnvelope& soap);
00296   WSRPDeleteResourcePropertiesResponse(void);
00297   ~WSRPDeleteResourcePropertiesResponse(void);
00298 };
00299 
00300 // ============================================================
00301 class WSRPQueryResourcePropertiesRequest: public WSRP {
00302  public:
00303   WSRPQueryResourcePropertiesRequest(SOAPEnvelope& soap);
00304   WSRPQueryResourcePropertiesRequest(const std::string& dialect);
00305   WSRPQueryResourcePropertiesRequest(void);
00306   ~WSRPQueryResourcePropertiesRequest(void);
00307   std::string Dialect(void);
00308   void Dialect(const std::string& dialect);
00309   XMLNode Query(void);
00310 };
00311 
00312 class WSRPQueryResourcePropertiesResponse: public WSRP {
00313  public:
00314   WSRPQueryResourcePropertiesResponse(SOAPEnvelope& soap);
00315   WSRPQueryResourcePropertiesResponse(void);
00316   ~WSRPQueryResourcePropertiesResponse(void);
00317   XMLNode Properties(void);
00318 };
00319 
00320 // UnknownQueryExpressionDialectFaultType
00321 // InvalidQueryExpressionFault
00322 // QueryEvaluationErrorFault
00323 //
00324 
00325 
00326 // ============================================================
00327 
00328 WSRF& CreateWSRP(SOAPEnvelope& soap);
00329 
00330 
00331 } // namespace Arc
00332 
00333 #endif /* _ARC_WSRP_H__ */
00334