105 lines
3.0 KiB
C
105 lines
3.0 KiB
C
|
|
// Copyright (c) 2014, IOnU Security Inc.
|
||
|
|
#ifndef CONCRETE_NETWORK_SVCS
|
||
|
|
#define CONCRETE_NETWORK_SVCS
|
||
|
|
|
||
|
|
#include "../client/websvcs.h"
|
||
|
|
|
||
|
|
class ConcreteNetworkSvcs : public sequencelogic::WebSvcs
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
/**
|
||
|
|
* Request a list of PubSub messages from the client.
|
||
|
|
*
|
||
|
|
* @return Client should return a JSON array, as a string.
|
||
|
|
*/
|
||
|
|
virtual std::string getPubSubMessages();
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Publish a PubSub message.
|
||
|
|
*
|
||
|
|
* @param pMsg A JSON object as a const char *.
|
||
|
|
* @return The result of the publish, as a JSON string.
|
||
|
|
*/
|
||
|
|
virtual std::string sendPubSubMessage(const std::string &msg);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Remove a PubSub message from the server.
|
||
|
|
*
|
||
|
|
* @param pMsg A JSON object as a const char *.
|
||
|
|
*/
|
||
|
|
virtual void disposePubSubMessage(const std::string &msg);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* STORAGE GUARD SERVICES
|
||
|
|
* Get the named mount
|
||
|
|
*
|
||
|
|
* @param nMount One of the mount types listed.
|
||
|
|
*/
|
||
|
|
virtual std::string getMount (MOUNT_TYPE nMount);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* OFFICE SERVICE
|
||
|
|
* Synchronize the office
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
virtual int synchronizeOffice();
|
||
|
|
|
||
|
|
/**
|
||
|
|
* CLOUDGUARD SERVICE
|
||
|
|
* Get the authenticated URN.
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
virtual std::string getAuthenticatedURN();
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Process a message. Currently used to process PubSubMessage::Action::FLUSH
|
||
|
|
*
|
||
|
|
* @param msg Message to process, a JSON string.
|
||
|
|
*/
|
||
|
|
virtual void processMessage(const std::string &msg);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* CLOUDGUARD SERVICE
|
||
|
|
* Get an office from CG.
|
||
|
|
*
|
||
|
|
* @param urn of the office to get.
|
||
|
|
* @returns A JSON string of the office.
|
||
|
|
*/
|
||
|
|
virtual std::string getOffice(const std::string &urn);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* STORAGE GUARD SERVICES
|
||
|
|
* Create a node, based on a SHARE message.
|
||
|
|
*
|
||
|
|
* @param JSON string representing the action data from the message.
|
||
|
|
* @returns The node, as a JSON string
|
||
|
|
*/
|
||
|
|
virtual std::string createNode (const std::string &actData);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* STORAGE GUARD SERVICES
|
||
|
|
* Synchronize a file in response to a SHARE message
|
||
|
|
*
|
||
|
|
* @param JSON string representing the node to sync.
|
||
|
|
* @returns The number of files synchronized, -1 on error.
|
||
|
|
*/
|
||
|
|
virtual int syncNode(const std::string &node);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* STORAGE GUARD SERVICES
|
||
|
|
* Given a generic node, as JSON, get the absolute path to it on this device.
|
||
|
|
*
|
||
|
|
* @param node The JSON string representation of the node.
|
||
|
|
*/
|
||
|
|
virtual std::string getNodeAbsolutePath(const std::string &node);
|
||
|
|
|
||
|
|
/**
|
||
|
|
* SYNC SERVICE
|
||
|
|
* Get the mtime of the last sync for the given mount.
|
||
|
|
*
|
||
|
|
*/
|
||
|
|
virtual std::string getLastSyncTime(MOUNT_TYPE mType);
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|