diff --git a/include/INxModelService.h b/include/INxModelService.h index 726b49002e135e99c5827643bfc265e18bc77eb5..b78201f9892b88a946dff667c1e0d61dfdd025d7 100644 --- a/include/INxModelService.h +++ b/include/INxModelService.h @@ -22,21 +22,21 @@ namespace NJGIS { OFFLINE = 0, ONLINE = 1 - } NjServiceStatus; + } NjModelServiceStatus; //! type of limitation typedef enum { PRIVATE = 0, PUBLIC = 1 - } NjServiceLimitation; + } NjModelServiceLimitation; //! type of permission typedef enum { OPEN = 0, PERMISSION = 1 - } NjServicePermission; + } NjModelServicePermission; //! model service class INjModelService: public virtual INjService @@ -49,49 +49,55 @@ namespace NJGIS virtual const char* getServiceName() = 0; //! get type - virtual const char* getServiceType(std::string& type) = 0; + virtual const char* getServiceType() = 0; - //! get etail URL - virtual const char* getServiceDetailURL(std::string& url) = 0; + //! get detail URL + virtual const char* getServiceDetailURL() = 0; //! get pid - virtual const char* getServicePid(std::string& pid) = 0; + virtual const char* getServicePid() = 0; //! get mid - virtual int getServiceMid(std::string& mid) = 0; + virtual const char* getServiceMid() = 0; - //! get register state + //! get register status virtual bool getServiceRegister() = 0; //! get description - virtual const char* getServiceDescription(std::string& description) = 0; + virtual const char* getServiceDescription() = 0; //! get version - virtual const char* getServiceVersion(std::string& version) = 0; + virtual const char* getServiceVersion() = 0; //! get platform virtual const NJGIS::SERVICE::NjPlatform getServicePlatform() = 0; //! get deployment time - virtual const NJGIS::SERVICE::NjPlatform int getDeploymentTime() = 0; + virtual const char* getDeploymentTime() = 0; //! get image url - virtual const char getImage() = 0; + virtual const char* getImage() = 0; - //! get deployor information - virtual int getServiceDeployorInfo() = 0; + //! get deployor name + virtual const char* getServiceDeployorName() = 0; + + //! get deployor email + virtual const char* getServiceDeployorEmail() = 0; //! get status (Dynamic) - virtual NJGIS::SERVICE::NjServiceStatus getServiceStatus() = 0; + virtual NJGIS::SERVICE::NjModelServiceStatus getServiceStatus() = 0; //! get limitaion (Dynamic) - virtual NJGIS::SERVICE::NjServiceLimitation getServiceLimitation() = 0; + virtual NJGIS::SERVICE::NjModelServiceLimitation getServiceLimitation() = 0; //! get permission - virtual const NJGIS::SERVICE::NjServicePermission getServicePermission() = 0; + virtual const NJGIS::SERVICE::NjModelServicePermission getServicePermission() = 0; //! invoke service virtual int invoke(const INjDataConfiguration* config, std::string& recordid) = 0; + + //! get laster information + virtual int refresh() = 0; }; } } diff --git a/src/NxModelService.cpp b/src/NxModelService.cpp index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..62b460345a11f9119d877ff6a74c9028f38348b2 100644 --- a/src/NxModelService.cpp +++ b/src/NxModelService.cpp @@ -0,0 +1,96 @@ +#include "NxModelService.h" + +const char* NJGIS::SERVICE::NjModelService::getServiceOID() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceName() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceType() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceDetailURL() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServicePid() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceMid() +{ + throw std::exception("The method or operation is not implemented."); +} + +bool NJGIS::SERVICE::NjModelService::getServiceRegister() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceDescription() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceVersion() +{ + throw std::exception("The method or operation is not implemented."); +} + +const NJGIS::SERVICE::NjPlatform NJGIS::SERVICE::NjModelService::getServicePlatform() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getDeploymentTime() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getImage() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceDeployorName() +{ + throw std::exception("The method or operation is not implemented."); +} + +const char* NJGIS::SERVICE::NjModelService::getServiceDeployorEmail() +{ + throw std::exception("The method or operation is not implemented."); +} + +NJGIS::SERVICE::NjModelServiceStatus NJGIS::SERVICE::NjModelService::getServiceStatus() +{ + throw std::exception("The method or operation is not implemented."); +} + +NJGIS::SERVICE::NjModelServiceLimitation NJGIS::SERVICE::NjModelService::getServiceLimitation() +{ + throw std::exception("The method or operation is not implemented."); +} + +const NJGIS::SERVICE::NjModelServicePermission NJGIS::SERVICE::NjModelService::getServicePermission() +{ + throw std::exception("The method or operation is not implemented."); +} + +int NJGIS::SERVICE::NjModelService::invoke( const INjDataConfiguration* config, std::string& recordid ) +{ + throw std::exception("The method or operation is not implemented."); +} + +int NJGIS::SERVICE::NjModelService::refresh() +{ + throw std::exception("The method or operation is not implemented."); +} diff --git a/src/NxModelService.h b/src/NxModelService.h index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c22fb7d7c17da9813069ec16740d4225316389cd 100644 --- a/src/NxModelService.h +++ b/src/NxModelService.h @@ -0,0 +1,100 @@ +#ifndef __NJGIS_NJMODELSERVICE_H__ +#define __NJGIS_NJMODELSERVICE_H__ + +#include "../include/INxModelService.h" +#include "NxService.h" + +namespace NJGIS +{ + namespace SERVICE + { + class NjModelService : public virtual INjModelService, public virtual NjService + { + public: + NjModelService(){}; + + NjModelService(const char* oid):_oid(oid){}; + + NjModelService(const char* oid, const char* name, const char* type, const char* url, + const char* pid, const char* mid, bool registered, const char* description, const char* version, + NJGIS::SERVICE::NjPlatform platform, const char* deploytime, const char* img, const char* deployorname, + const char* deployemail, NJGIS::SERVICE::NjModelServiceStatus status, NJGIS::SERVICE::NjModelServiceLimitation limit, + NJGIS::SERVICE::NjModelServicePermission permission ){} + + virtual const char* getServiceOID(); + + virtual const char* getServiceName(); + + virtual const char* getServiceType(); + + virtual const char* getServiceDetailURL(); + + virtual const char* getServicePid(); + + virtual const char* getServiceMid(); + + virtual bool getServiceRegister(); + + virtual const char* getServiceDescription(); + + virtual const char* getServiceVersion(); + + virtual const NJGIS::SERVICE::NjPlatform getServicePlatform(); + + virtual const char* getDeploymentTime(); + + virtual const char* getImage(); + + virtual const char* getServiceDeployorName(); + + virtual const char* getServiceDeployorEmail(); + + virtual NJGIS::SERVICE::NjModelServiceStatus getServiceStatus(); + + virtual NJGIS::SERVICE::NjModelServiceLimitation getServiceLimitation(); + + virtual const NJGIS::SERVICE::NjModelServicePermission getServicePermission(); + + virtual int invoke( const INjDataConfiguration* config, std::string& recordid ); + + virtual int refresh(); + + private: + std::string _oid; + + std::string _name; + + std::string _type; + + std::string _detailurl; + + std::string _pid; + + std::string _mid; + + bool _registered; + + std::string _description; + + std::string _version; + + NJGIS::SERVICE::NjPlatform _platform; + + std::string _deploymentTime; + + std::string _img; + + std::string _deployor; + + std::string _deployorEmail; + + NJGIS::SERVICE::NjModelServiceStatus _status; + + NJGIS::SERVICE::NjModelServiceLimitation _limit; + + NJGIS::SERVICE::NjModelServicePermission _permission; + }; + } +} + +#endif \ No newline at end of file diff --git a/src/NxServer.h b/src/NxServer.h index 56199d84572a41f4665fc48d81e28c7dab2194c5..42d9d4215cdc2a6362e48875f685f233af50b110 100644 --- a/src/NxServer.h +++ b/src/NxServer.h @@ -8,7 +8,7 @@ namespace NJGIS { namespace SERVICE { - class NjServer : public virtual INjServer, public NjService + class NjServer : public virtual INjServer, public virtual NjService { public: NjServer(){}; diff --git a/src/NxServiceAccess.h b/src/NxServiceAccess.h index fe0ca88aa5aad2ef373c62adda21998049d664d2..406893266870686fd94bd9474d30b418f97b4d6f 100644 --- a/src/NxServiceAccess.h +++ b/src/NxServiceAccess.h @@ -9,7 +9,7 @@ namespace NJGIS { namespace SERVICE { - class NjServiceAccess : public virtual INjServiceAccess, public NjService + class NjServiceAccess : public virtual INjServiceAccess, public virtual NjService { public: NjServiceAccess(const char* ip, int port):NjService(ip, port){};