Base class for local and remote virtual http file clients. More...
#include <virtualfileclient.hpp>
Classes | |
class | RegistrationStatusChangeCallback |
Callback interface. More... | |
Public Types | |
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 |
Public Member Functions | |
virtual string | getIdentifier () const |
Returns the type of the service. | |
virtual string | getPath (RegistrationToken token) const =0 |
Retrieve the path associated with the registration. | |
virtual RegistrationToken | registerPath (const string &scheme, const string &pathProposal, VirtualFileProvider *provider)=0 |
Registers a path to HTTP Server. | |
virtual void | registerRegistrationStatusChangeCallback (RegistrationToken token, RegistrationStatusChangeCallback *callback) |
Register registration status change callback. | |
virtual RegistrationStatus | registrationStatus (RegistrationToken token)=0 |
Checks the registration status. | |
virtual void | unregisterPath (RegistrationToken token)=0 |
Unregisters previously registered path. | |
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 string | Type () |
Type of the client. | |
Additional Inherited Members | |
![]() | |
enum | SessionState { INITIALIZED = 0 , RUNNING = 1 , STOPPED = 2 } |
![]() | |
virtual AbstractSessionSharedPtr | getSession () |
![]() | |
SessionState | m_sessionState |
Base class for local and remote virtual http file clients.
typedef enum kanzi::connect::VirtualFileClient::RegistrationStatus kanzi::connect::VirtualFileClient::RegistrationStatus |
typedef shared_ptr<void> kanzi::connect::VirtualFileClient::RegistrationToken |
Token used to identify registration.
|
inlinevirtual |
C++ destructor - performs cleanup.
|
inlinevirtual |
Returns the type of the service.
Implements kanzi::connect::AbstractServiceClient.
|
pure virtual |
Retrieve the path associated with the registration.
token | The token that identifies the registration. |
Implemented in kanzi::connect::VirtualFileLocalClient, and kanzi::connect::VirtualFileRemoteClient.
|
pure 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. |
Implemented in kanzi::connect::VirtualFileLocalClient, and kanzi::connect::VirtualFileRemoteClient.
|
inlinevirtual |
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 in kanzi::connect::VirtualFileRemoteClient.
|
pure 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. |
Implemented in kanzi::connect::VirtualFileLocalClient, and kanzi::connect::VirtualFileRemoteClient.
|
static |
Type of the client.
|
pure virtual |
Unregisters previously registered path.
token | opaque handle got using the registerPath |
Implemented in kanzi::connect::VirtualFileLocalClient, and kanzi::connect::VirtualFileRemoteClient.
|
inlinevirtual |
Clears previously registered status change callback.
token | path registration token. |
Reimplemented in kanzi::connect::VirtualFileRemoteClient.