Poco::RemotingNG

class ServerTransport

Library: RemotingNG
Package: Transport
Header: Poco/RemotingNG/ServerTransport.h

Description

ServerTransport objects are used as mediators between a Listener, receiving a request, and the ORB, Skeleton and MethodHandlers, processing the request.

The ServerTransport allows the Skeleton to deserialize the request message in order to determine the method name, select an appropriate MethodHandler, based on the method name and pass control to the MethodHandler. The MethodHandler then uses the ServerTransport to send back a response message.

Inheritance

Direct Base Classes: AttributedObject

All Base Classes: AttributedObject

Known Derived Classes: Poco::RemotingNG::TCP::ServerTransport

Member Summary

Member Functions: authenticate, authorize, beginRequest, endRequest, sendReply

Inherited Functions: clearAttributes, countAttributes, enumerateAttributes, getAttribute, hasAttribute, operator =, removeAttribute, setAttribute

Constructors

ServerTransport

ServerTransport();

Creates a ServerTransport.

Destructor

~ServerTransport virtual

virtual ~ServerTransport();

Destroys the ServerTransport.

Member Functions

authenticate virtual

virtual bool authenticate(
    const std::string & method
);

Verify that the request is properly authenticated.

This method is called if the method or its class has the @authenticated attribute set to true, or if it has a @permission attribute set to a non-empty permission.

An implementation should check whether the current request contains valid authentication information. Typically, an implementation will obtain the Credentials object for the request, obtain the Authenticator from the Listener, and call its authenticate() method to check the credentials.

Returns true if the request is properly authenticated, otherwise false.

The default implementation simply returns true.

authorize virtual

virtual bool authorize(
    const std::string & method,
    const std::string & permission
);

Verify that an authenticated user has the given permission, which is required to invoke the given method.

The given permission will be the the one specified with the @permission attribute for the respective remote method. If no @permission attribute has been specified for a remote method, or the permission is an empty string, this method will not be called.

An implementation should obtain the Authorizer object from the Listener, and call the Authorizer's authorize() method to authorize the method call.

Returns true if authorization is successful, otherwise false.

The default implementation simply returns true.

beginRequest virtual

virtual Deserializer & beginRequest() = 0;

Prepare a Deserializer for reading the request message.

Returns a Deserializer that can be used to read the request message.

endRequest virtual

virtual void endRequest() = 0;

Signals the ServerTransport that request processing is finished for this request.

sendReply virtual

virtual Serializer & sendReply(
    SerializerBase::MessageType messageType
) = 0;

Prepares the ServerTransport to send a response message back to the caller.

The given MessageType must be either MESSAGE_REPLY, MESSAGE_EVENT_REPLY or MESSAGE_FAULT.

Returns a Serializer for writing the reply (or fault reply) message.