Remote access to VirtualFile service that resides in kanziconnect server. More...
#include <virtualfileremoteclient.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. | |
void | registerRegistrationStatusChangeCallback (RegistrationToken token, RegistrationStatusChangeCallback *callback) |
Register registration status change callback. | |
RegistrationStatus | registrationStatus (RegistrationToken token) |
Checks the registration status. | |
void | unregisterPath (RegistrationToken token) |
Unregisters previously registered path. | |
void | unregisterRegistrationStatusChangeCallback (RegistrationToken token) |
Clears previously registered status change callback. | |
![]() | |
virtual string | getIdentifier () const |
Returns the type of the service. | |
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 VirtualFileRemoteClientSharedPtr | create (ClientSharedPtr client) |
Factory method to create object. | |
![]() | |
static string | Type () |
Type of the client. | |
Protected Member Functions | |
void | onConnectionStateChanged (Connection::State state) |
Invoked when ever connection state changes. | |
VirtualFileRemoteClient (ClientSharedPtr client) | |
c++ constructor - initializes the object | |
![]() | |
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 |
Remote access to VirtualFile service that resides in kanziconnect server.
|
protected |
c++ constructor - initializes the object
client |
|
static |
Factory method to create object.
client | pointer to client |
|
virtual |
Retrieve the path associated with the registration.
token | The token that identifies the registration. |
Implements kanzi::connect::VirtualFileClient.
|
protected |
Invoked when ever connection state changes.
state | new state. |
|
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 |
Register registration status change callback.
Registration is meaningful only for remote clients since status does not change for local clients.
token | identification token. |
callback | interface to be invoked when registration status changes. |
Reimplemented from 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.
|
virtual |
Clears previously registered status change callback.
token | path registration token. |
Reimplemented from kanzi::connect::VirtualFileClient.