Back to index

nordugrid-arc-nox  1.1.0~rc6
InformationInterface.h
Go to the documentation of this file.
00001 #ifndef __ARC_INFORMATIONINTERFACE_H__
00002 #define __ARC_INFORMATIONINTERFACE_H__
00003 
00004 #include <string>
00005 #include <list>
00006 #include <arc/Thread.h>
00007 #include <arc/XMLNode.h>
00008 #include <arc/message/SOAPEnvelope.h>
00009 #include <arc/wsrf/WSResourceProperties.h>
00010 #include <arc/infosys/InfoFilter.h>
00011 
00012 namespace Arc {
00013 
00015 
00018 class InformationInterface {
00019  protected:
00021   Glib::Mutex lock_;
00022   bool to_lock_;
00028   virtual void Get(const std::list<std::string>& path,XMLNodeContainer& result);
00029   virtual void Get(XMLNode xpath,XMLNodeContainer& result);
00030  public:
00032   InformationInterface(bool safe = true);
00033   virtual ~InformationInterface(void);
00034   /* This method is called by service which wants to process WSRF request.
00035     It parses 'in' message, calls appropriate 'Get' method and returns
00036     response SOAP message.
00037     In case of error it either returns NULL or corresponding SOAP fault. */
00038   SOAPEnvelope* Process(SOAPEnvelope& in);
00039   /* This method adds possibility to filter produced document.
00040     Document is filtered according to embedded and provided policies. 
00041     User identity and filtering algorithm are defined by
00042      specified */
00043   SOAPEnvelope* Process(SOAPEnvelope& in,const InfoFilter& filter,const InfoFilterPolicies& policies = InfoFilterPolicies(),const NS& ns = NS());
00044 };
00045 
00047 
00049 class InformationContainer: public InformationInterface {
00050  protected:
00052   XMLNode doc_;
00053   virtual void Get(const std::list<std::string>& path,XMLNodeContainer& result);
00054   virtual void Get(XMLNode xpath,XMLNodeContainer& result);
00055  public:
00056   InformationContainer(void);
00059   InformationContainer(XMLNode doc,bool copy = false);
00060   virtual ~InformationContainer(void);
00064   XMLNode Acquire(void);
00065   void Release(void);
00068   void Assign(XMLNode doc,bool copy = false);
00069 };
00070 
00072 
00074 class InformationRequest {
00075  private:
00076   WSRP* wsrp_;
00077  public:
00079   InformationRequest(void);
00082   InformationRequest(const std::list<std::string>& path);
00085   InformationRequest(const std::list<std::list<std::string> >& paths);
00087   InformationRequest(XMLNode query);
00088   ~InformationRequest(void);
00089   operator bool(void) { return (wsrp_ != NULL); };
00090   bool operator!(void) { return (wsrp_ == NULL); };
00092   SOAPEnvelope* SOAP(void);
00093 };
00094 
00096 
00098 class InformationResponse {
00099  private:
00100   WSRF* wsrp_;
00101  public:
00104   InformationResponse(SOAPEnvelope& soap);
00105   ~InformationResponse(void);
00106   operator bool(void) { return (wsrp_ != NULL); };
00107   bool operator!(void) { return (wsrp_ == NULL); };
00109   std::list<XMLNode> Result(void);
00110 };
00111 
00112 } // namespace Arc
00113 
00114 #endif /* __ARC_INFORMATIONINTERFACE_H__ */