Local interface to access HTTP Virtual file interface in server. More...
#include <virtualfilelocalclient.hpp>
Public Member Functions | |
string | getPath (RegistrationToken token) const |
Retrieve the path associated with the registration. | |
RegistrationToken | registerPath (const string &scheme, const string &path, VirtualFileProvider *provider) |
Registers a path to HTTP Server. | |
RegistrationStatus | registrationStatus (RegistrationToken token) |
Checks the registration status. | |
void | unregisterPath (RegistrationToken token) |
Unregisters previously registered path. | |
![]() | |
virtual string | getIdentifier () const |
Returns the type of the service. | |
virtual void | registerRegistrationStatusChangeCallback (RegistrationToken token, RegistrationStatusChangeCallback *callback) |
Register registration status change callback. | |
virtual void | unregisterRegistrationStatusChangeCallback (RegistrationToken token) |
Clears previously registered status change callback. | |
virtual | ~VirtualFileClient () |
C++ destructor - performs cleanup. | |
![]() | |
AbstractServiceClient () | |
Constructor. | |
AbstractSession::MessageSubscriptionToken | addMessageSubscription (const string &messageType, AbstractSession::MessageReceivedFunction function) |
SessionRunningSubscriptionToken | addSessionRunningSubscription (SessionRunningFunction function) |
SessionRunningSubscriptionToken | addSessionStoppedSubscription (SessionStoppedFunction function) |
optional< int > | getActiveSessionIdentifier () |
optional< const AbstractSession::ServiceAttributes > | getServiceAttributes () |
virtual void | onSessionRunning () |
virtual void | onSessionStopped () |
void | removeMessageSubscription (const string &messageType, AbstractSession::MessageSubscriptionToken token) |
void | removeSessionRunningSubscription (SessionRunningSubscriptionToken token) |
void | removeSessionStoppedSubscription (SessionRunningSubscriptionToken token) |
void | setEnabledState (bool newEnabledState) |
Enable/disable the service by allowing or blocking traffic between client and server. | |
bool | transmit (const MessagePackage &message) |
virtual void | work () |
Carry out asynchronous work bound to Kanzi Connect client main thread. | |
virtual | ~AbstractServiceClient () |
Destructor. | |
Static Public Member Functions | |
static VirtualFileLocalClientSharedPtr | create (VirtualFileManagerSharedPtr manager) |
Factory function to create instance of a class. | |
![]() | |
static string | Type () |
Type of the client. | |
Protected Member Functions | |
VirtualFileLocalClient (VirtualFileManagerSharedPtr manager) | |
C++ constructor. | |
![]() | |
virtual AbstractSessionSharedPtr | getSession () |
Additional Inherited Members | |
![]() | |
enum | RegistrationStatus { NotRegistered , RegistrationInProgress , RegistrationFailed , Registered } |
typedef enum kanzi::connect::VirtualFileClient::RegistrationStatus | RegistrationStatus |
typedef shared_ptr< void > | RegistrationToken |
Token used to identify registration. | |
![]() | |
typedef function< void(void)> | SessionRunningFunction |
typedef shared_ptr< void > | SessionRunningSubscriptionToken |
typedef function< void(void)> | SessionStoppedFunction |
![]() | |
enum | SessionState { INITIALIZED = 0 , RUNNING = 1 , STOPPED = 2 } |
![]() | |
SessionState | m_sessionState |
Local interface to access HTTP Virtual file interface in server.
|
protected |
C++ constructor.
manager | service manager. |
|
static |
Factory function to create instance of a class.
manager | service manager. |
|
virtual |
Retrieve the path associated with the registration.
token | The token that identifies the registration. |
Implements kanzi::connect::VirtualFileClient.
|
virtual |
Registers a path to HTTP Server.
Registration is an asynchronous operation for remote clients.
scheme | Requested protocol. Either HTTP or HTTPS expected. If you do not set a value, uses HTTP. |
pathProposal | clients proposal of the path where the serving is to be done. |
provider | pointer to callback interface that is, if successfully registered, invoked for every file request made under the registered path. Caller must guarantee that the provided callback interface remains valid until corresponding unregisterPath call is made. |
Implements kanzi::connect::VirtualFileClient.
|
virtual |
Checks the registration status.
For remote operations registration is asynchronous and thus it is not complete until this method returns either Registered or RegistrationFailed. Also, if for example connection is lost, then the registration status changes even if it has been completed earlier.
token | The token that identifies the registration. |
Implements kanzi::connect::VirtualFileClient.
|
virtual |
Unregisters previously registered path.
token | opaque handle got using the registerPath |
Implements kanzi::connect::VirtualFileClient.