public class Session extends Object implements MessageSender, MessageReceiver, OperationChainManager
Modifier and Type | Class and Description |
---|---|
class |
Session.SessionStatusEvent |
Constructor and Description |
---|
Session(Configuration config,
ProxyPool proxyPool) |
Session(Configuration config,
ProxyPool proxyPool,
ServerSocketCommunicationHandler com) |
Modifier and Type | Method and Description |
---|---|
boolean |
addSessionEventListener(SessionEventListener listener)
Add a listener even it has not been already added
|
boolean |
getCacheBeforeConnect()
Get the configuration that states that the gateway should cache messages
before actual connection.
|
SocketCipher |
getCipher() |
Configuration |
getConfiguration() |
ParameterCheckOpertaionChain |
getExportOperationChain()
The security checks that a
BusMember has to pass in order to be
allowed to be exported. |
ParameterCheckOpertaionChain |
getImportOperationChain()
The security checks that a
ImportRequest has to
pass in order to be allowed to create a proxy for it. |
MessageOperationChain |
getIncomingMessageOperationChain()
The security checks that an incoming
WrappedBusMessage has to
pass in order to be allowed to interpreted by the proxy. |
MessageOperationChain |
getOutgoingMessageOperationChain()
The security checks that an outgoing
WrappedBusMessage has to
pass in order to be allowed to transmitted to peer. |
String |
getScope() |
SessionEvent.SessionStatus |
getStatus() |
long |
getTimeout()
Gets timeout configuration for session.
|
void |
handleMessage(Message msg)
Receives the Message from the communication layer, delivering it to the
appropriate subcomponent.
|
boolean |
isActive() |
void |
removeImports()
To be called when the session is to be closed.
|
boolean |
removeSessionEventListener(SessionEventListener listener)
Remove a listener from the listeners if and only if the listener has
already been added
|
void |
send(Message message)
Send Asynchronously a
Message independent of which level it is,
to a remote ASG. |
Message |
sendRequest(Message message)
Send a request Synchronously to which a response is expected.
|
void |
setScope(String scope) |
void |
setStatus(SessionEvent.SessionStatus status) |
void |
stop() |
public static final Logger log
public Session(Configuration config, ProxyPool proxyPool, ServerSocketCommunicationHandler com)
public Session(Configuration config, ProxyPool proxyPool)
public void setScope(String scope)
scope
- the String
representing the scope of this Session. At
the moment the Scope is represented by the SpaceId of the
Space that we are connected topublic String getScope()
String
representing the scope of this Session. At the
moment the Scope is represented by the SpaceId of the Space that
we are connected topublic Configuration getConfiguration()
public void send(Message message)
MessageSender
Message
independent of which level it is,
to a remote ASG. send
in interface MessageSender
public Message sendRequest(Message message) throws TimeoutException
MessageSender
sendRequest
in interface MessageSender
message
- to send, typically a request messageTimeoutException
public ParameterCheckOpertaionChain getImportOperationChain()
OperationChainManager
ImportRequest
has to
pass in order to be allowed to create a proxy for it.getImportOperationChain
in interface OperationChainManager
public ParameterCheckOpertaionChain getExportOperationChain()
OperationChainManager
BusMember
has to pass in order to be
allowed to be exported.getExportOperationChain
in interface OperationChainManager
public MessageOperationChain getIncomingMessageOperationChain()
OperationChainManager
WrappedBusMessage
has to
pass in order to be allowed to interpreted by the proxy.getIncomingMessageOperationChain
in interface OperationChainManager
public MessageOperationChain getOutgoingMessageOperationChain()
OperationChainManager
WrappedBusMessage
has to
pass in order to be allowed to transmitted to peer.getOutgoingMessageOperationChain
in interface OperationChainManager
public void handleMessage(Message msg)
handleMessage
in interface MessageReceiver
public SocketCipher getCipher()
public void stop()
public boolean addSessionEventListener(SessionEventListener listener)
listener
- the listener to addpublic boolean removeSessionEventListener(SessionEventListener listener)
listener
- the listener to removepublic void setStatus(SessionEvent.SessionStatus status)
public SessionEvent.SessionStatus getStatus()
public boolean isActive()
public void removeImports()
session
- public long getTimeout()
public boolean getCacheBeforeConnect()
Copyright © 2018 universAAL Consortium. All rights reserved.