Remote Call Framework 3.4
RCF::RcfSession Class Reference

Represents a server side session, associated with a client connection. More...

#include <RcfSession.hpp>

Inherits enable_shared_from_this< RcfSession >.

Public Member Functions

RcfServergetRcfServer ()
 Returns a reference to the RcfServer that owns this RcfSession. More...
 
void disconnect ()
 Disconnects this RcfSession. More...
 
Session objects

This section describes functions related to session objects. Session objects are objects created by application code, which are stored as part of the RcfSession. Their scope is limited to that of the RcfSession they are created within. If you need to create server-side objects which outlive individual RCF sessions, use server objects instead (see RcfServer).

template<typename T >
void deleteSessionObject ()
 Deletes a session object. More...
 
template<typename T >
T & createSessionObject ()
 Creates a session object. More...
 
template<typename T >
T & getSessionObject (bool createIfDoesntExist=false)
 Retrieves a session object, and optionally creates it. More...
 
template<typename T >
T * querySessionObject ()
 Queries for the existence of a session object. More...
 
Custom request/response user data

The application data in a remote call is normally carried in the parameters of the remote call itself. RCF also allows you to add untyped custom data to the remote call request and response.

void setRequestUserData (const std::string &userData)
 Sets application-specific data associated with the RCF request. More...
 
std::string getRequestUserData ()
 Gets application-specific data associated with the RCF request. More...
 
void setResponseUserData (const std::string &userData)
 Sets application-specific data associated with the RCF response. More...
 
std::string getResponseUserData ()
 Gets application-specific data associated with the RCF response. More...
 
Connection information

This section describes functions relating to the current client connection.

std::uint32_t getRuntimeVersion ()
 Gets the RCF runtime version that is in use on this RcfSession. More...
 
void setRuntimeVersion (std::uint32_t version)
 Sets the RCF runtime version that is in use on this RcfSession. More...
 
std::uint32_t getArchiveVersion ()
 Gets the archive version that is in use on this RcfSession. More...
 
void setArchiveVersion (std::uint32_t version)
 Sets the archive version that is in use on this RcfSession. More...
 
const RemoteAddressgetClientAddress ()
 Gets a RemoteAddress object indicating the address of the client. More...
 
bool isOneway ()
 Gets a value indicating if the currently executing remote call is a one-way call. More...
 
std::uint32_t getPingBackIntervalMs ()
 Gets the ping-back interval for this RcfSession. More...
 
tstring getClientUserName ()
 Gets the authenticated user name of the client, if authentication has taken place. More...
 
TransportProtocol getTransportProtocol ()
 Gets the transport protocol in use on this RcfSession. More...
 
TransportType getTransportType ()
 Gets the underlying transport type of this RcfSession. More...
 
bool getEnableCompression ()
 Gets a value indicating if transport level compression is enabled for this RcfSession. More...
 
CertificatePtr getClientCertificatePtr ()
 Gets the certificate the client has presented, if any. Only applicable to SSL connections. More...
 
RemoteCallInfo getRemoteCallRequest () const
 Returns information about the currently executing RCF request. More...
 
time_t getConnectedAtTime () const
 Returns the time at which the client connected to this RcfSession. More...
 
std::size_t getConnectionDuration () const
 Gets the connection duration of this RcfSession. More...
 
std::size_t getRemoteCallCount () const
 Gets the total remote call count of this RcfSession. More...
 
std::uint64_t getTotalBytesReceived () const
 Gets the total number of bytes received on this RcfSession. More...
 
std::uint64_t getTotalBytesSent () const
 Gets the total number of bytes sent on this RcfSession. More...
 
void setEnableSfPointerTracking (bool enable)
 Sets a value indicating if SF pointer tracking is enabled for this RcfSession. More...
 
bool getEnableSfPointerTracking () const
 Gets a value indicating if SF pointer tracking is enabled for this RcfSession. More...
 
File transfers

This section describes functions related to file transfers.

std::string configureDownload (const Path &downloadPath, BandwidthQuotaPtr quotaPtr=nullptr)
 Configures a file download from the given download path. Returns a download ID, which should be passed back to the client and used as a parameter in ClientStub::downloadFile(). More...
 
void setAllowUploads (bool allowUploads)
 Sets whether file uploads are allowed for this RcfSession. By default file uploads are disabled. More...
 
bool getAllowUploads () const
 Gets whether file uploads are allowed for this RcfSession. By default file uploads are disabled. More...
 
void setUploadBandwidthQuota (BandwidthQuotaPtr quotaPtr)
 Sets the bandwidth quota associated with uploads on this RcfSession. By default a RcfSession does not have a bandwidth bucket associated with it. More...
 
BandwidthQuotaPtr getUploadBandwidthQuota () const
 Gets the bandwidth quota associated with uploads on this RcfSession. By default a RcfSession does not have a bandwidth bucket associated with it. More...
 
Path getUploadPath (const std::string &uploadId)
 Returns the path on disk, for the given upload. More...
 

Detailed Description

Represents a server side session, associated with a client connection.

Member Function Documentation

◆ deleteSessionObject()

template<typename T >
void RCF::RcfSession::deleteSessionObject ( )

Deletes a session object.

◆ createSessionObject()

template<typename T >
T& RCF::RcfSession::createSessionObject ( )

Creates a session object.

◆ getSessionObject()

template<typename T >
T& RCF::RcfSession::getSessionObject ( bool  createIfDoesntExist = false)

Retrieves a session object, and optionally creates it.

◆ querySessionObject()

template<typename T >
T* RCF::RcfSession::querySessionObject ( )

Queries for the existence of a session object.

◆ getRcfServer()

RcfServer& RCF::RcfSession::getRcfServer ( )

Returns a reference to the RcfServer that owns this RcfSession.

◆ disconnect()

void RCF::RcfSession::disconnect ( )

Disconnects this RcfSession.

◆ setRequestUserData()

void RCF::RcfSession::setRequestUserData ( const std::string &  userData)

Sets application-specific data associated with the RCF request.

◆ getRequestUserData()

std::string RCF::RcfSession::getRequestUserData ( )

Gets application-specific data associated with the RCF request.

◆ setResponseUserData()

void RCF::RcfSession::setResponseUserData ( const std::string &  userData)

Sets application-specific data associated with the RCF response.

◆ getResponseUserData()

std::string RCF::RcfSession::getResponseUserData ( )

Gets application-specific data associated with the RCF response.

◆ getRuntimeVersion()

std::uint32_t RCF::RcfSession::getRuntimeVersion ( )

Gets the RCF runtime version that is in use on this RcfSession.

◆ setRuntimeVersion()

void RCF::RcfSession::setRuntimeVersion ( std::uint32_t  version)

Sets the RCF runtime version that is in use on this RcfSession.

◆ getArchiveVersion()

std::uint32_t RCF::RcfSession::getArchiveVersion ( )

Gets the archive version that is in use on this RcfSession.

◆ setArchiveVersion()

void RCF::RcfSession::setArchiveVersion ( std::uint32_t  version)

Sets the archive version that is in use on this RcfSession.

◆ getClientAddress()

const RemoteAddress& RCF::RcfSession::getClientAddress ( )

Gets a RemoteAddress object indicating the address of the client.

◆ isOneway()

bool RCF::RcfSession::isOneway ( )

Gets a value indicating if the currently executing remote call is a one-way call.

◆ getPingBackIntervalMs()

std::uint32_t RCF::RcfSession::getPingBackIntervalMs ( )

Gets the ping-back interval for this RcfSession.

◆ getClientUserName()

tstring RCF::RcfSession::getClientUserName ( )

Gets the authenticated user name of the client, if authentication has taken place.

◆ getTransportProtocol()

TransportProtocol RCF::RcfSession::getTransportProtocol ( )

Gets the transport protocol in use on this RcfSession.

◆ getTransportType()

TransportType RCF::RcfSession::getTransportType ( )

Gets the underlying transport type of this RcfSession.

◆ getEnableCompression()

bool RCF::RcfSession::getEnableCompression ( )

Gets a value indicating if transport level compression is enabled for this RcfSession.

◆ getClientCertificatePtr()

CertificatePtr RCF::RcfSession::getClientCertificatePtr ( )

Gets the certificate the client has presented, if any. Only applicable to SSL connections.

◆ getRemoteCallRequest()

RemoteCallInfo RCF::RcfSession::getRemoteCallRequest ( ) const

Returns information about the currently executing RCF request.

◆ getConnectedAtTime()

time_t RCF::RcfSession::getConnectedAtTime ( ) const

Returns the time at which the client connected to this RcfSession.

◆ getConnectionDuration()

std::size_t RCF::RcfSession::getConnectionDuration ( ) const

Gets the connection duration of this RcfSession.

◆ getRemoteCallCount()

std::size_t RCF::RcfSession::getRemoteCallCount ( ) const

Gets the total remote call count of this RcfSession.

◆ getTotalBytesReceived()

std::uint64_t RCF::RcfSession::getTotalBytesReceived ( ) const

Gets the total number of bytes received on this RcfSession.

◆ getTotalBytesSent()

std::uint64_t RCF::RcfSession::getTotalBytesSent ( ) const

Gets the total number of bytes sent on this RcfSession.

◆ setEnableSfPointerTracking()

void RCF::RcfSession::setEnableSfPointerTracking ( bool  enable)

Sets a value indicating if SF pointer tracking is enabled for this RcfSession.

◆ getEnableSfPointerTracking()

bool RCF::RcfSession::getEnableSfPointerTracking ( ) const

Gets a value indicating if SF pointer tracking is enabled for this RcfSession.

◆ configureDownload()

std::string RCF::RcfSession::configureDownload ( const Path downloadPath,
BandwidthQuotaPtr  quotaPtr = nullptr 
)

Configures a file download from the given download path. Returns a download ID, which should be passed back to the client and used as a parameter in ClientStub::downloadFile().

◆ setAllowUploads()

void RCF::RcfSession::setAllowUploads ( bool  allowUploads)

Sets whether file uploads are allowed for this RcfSession. By default file uploads are disabled.

◆ getAllowUploads()

bool RCF::RcfSession::getAllowUploads ( ) const

Gets whether file uploads are allowed for this RcfSession. By default file uploads are disabled.

◆ setUploadBandwidthQuota()

void RCF::RcfSession::setUploadBandwidthQuota ( BandwidthQuotaPtr  quotaPtr)

Sets the bandwidth quota associated with uploads on this RcfSession. By default a RcfSession does not have a bandwidth bucket associated with it.

◆ getUploadBandwidthQuota()

BandwidthQuotaPtr RCF::RcfSession::getUploadBandwidthQuota ( ) const

Gets the bandwidth quota associated with uploads on this RcfSession. By default a RcfSession does not have a bandwidth bucket associated with it.

◆ getUploadPath()

Path RCF::RcfSession::getUploadPath ( const std::string &  uploadId)

Returns the path on disk, for the given upload.


The documentation for this class was generated from the following file: