org.sr.server
Interface ICallerContextInfo<E>

Type Parameters:
E - Original protocol specific caller context class.
All Known Implementing Classes:
HttpCallerContext

public interface ICallerContextInfo<E>

  Protocols that we carry our messages on to it, resolves incoming messages and generates an object which contains information about the originated caller and protocol details. Messages passed by the protocol to targeted objects usually in dedicated threads where we can access that information about the caller and protocol. This dedicated thread and information object concept named as Caller Context.
   This interface is designed to access caller context of carrier protocol in protocol independent manner. End point implementations need to wrap their caller contexts within an implementation of this interface and send incoming messages to targeted Java object by using ICaller implementations.

Author:
Serhat Dirik
See Also:
ICaller, IClientSessionInfo

Method Summary
 java.lang.String getProtocol()
          Returns protocol name
 java.lang.String getRemoteAddr()
          Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.
 java.lang.String getRemoteHost()
          Returns the fully qualified name of the client or the last proxy that sent the request.
 int getRemotePort()
          Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.
 java.lang.String getRemoteUser()
          Gives authenticated client user information
 IClientSessionInfo<?> getSession()
          Gives client session information if there is any
 E getWrappedRequest()
          Gives the protocol specific request information
 java.lang.Class<E> getWrappedType()
          Type information of wrapped session
 boolean isProtocolSecure()
          Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS
 boolean isUserInRole(java.lang.String role)
          Checks if the authenticated client has the given role
 

Method Detail

getRemoteUser

java.lang.String getRemoteUser()
Gives authenticated client user information

Returns:
user name or null there is no authentication

getSession

IClientSessionInfo<?> getSession()
Gives client session information if there is any

Returns:
Client Session Information

isUserInRole

boolean isUserInRole(java.lang.String role)
Checks if the authenticated client has the given role

Parameters:
role - role name
Returns:
true if user belongs to given role

getWrappedRequest

E getWrappedRequest()
Gives the protocol specific request information

Returns:
protocol specific request information

getWrappedType

java.lang.Class<E> getWrappedType()
Type information of wrapped session

Returns:
class of the wrapped session object

getProtocol

java.lang.String getProtocol()
Returns protocol name

Returns:
protocol name

getRemoteAddr

java.lang.String getRemoteAddr()
Returns the Internet Protocol (IP) address of the client or last proxy that sent the request.

Returns:
Internet Protocol (IP) address of the client

getRemoteHost

java.lang.String getRemoteHost()
Returns the fully qualified name of the client or the last proxy that sent the request.

Returns:
name of the client

getRemotePort

int getRemotePort()
Returns the Internet Protocol (IP) source port of the client or last proxy that sent the request.

Returns:
Internet Protocol (IP) source port of the client

isProtocolSecure

boolean isProtocolSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS

Returns:
true if the protocol is secure