|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.epfl.lsr.apex.connection.APEXConnection ch.epfl.lsr.apex.connection.APEXEdgeConnection
An APEXEdgeConnection
handles the connection between two
nodes on the APEX edge (endpoint-relay and vice versa) and adds manager
specific policies for the connection.
Field Summary |
Fields inherited from class ch.epfl.lsr.apex.connection.APEXConnection |
authenticatedAs, CHANNEL_ESTABLISHED, channelID, CONNECTION_INITIATION, connectionEstablished, connectionThread, currentConnections, entity, internalIDs, knownChannels, manager, messageFile, pollingIntervall, profile, running, task, transID, trialNb |
Method Summary | |
void |
addAttachedAs(APEXEndpointAddress aea)
Updates the authenticatedAs table if the manager is
successfully attached as the specified endpoint address. |
void |
attach(APEXEndpointAddress aea,
APEXStatus s)
Attaches as the endpoint address on this connection, say at the entity, and adds the status listener to the attach message. |
protected void |
channelEstablished()
Is called by the connection thread if an APEX channel is successfully established - allows to update the status of the connection. |
protected void |
disconnected()
Is called if a disconnection is noticed and initiates appropriate solutions (policies for relay and endpoint). |
static APEXEdgeConnection |
getAPEXEdgeConnection(APEXManager manager,
String entity,
Channel c,
Object receivingChannelID)
APEXEdgeConnection FACTORY
Returns either a new APEXEdgeConnection or an existing,
stored in the connection table.
|
static APEXEdgeConnection |
getAPEXEdgeConnection(APEXManager manager,
String entity,
int edgePort)
APEXEdgeConnection FACTORY
Returns either a new APEXEdgeConnection or an existing
stored in the connection table.
|
static APEXEdgeConnection |
getAPEXEdgeConnection(String entity)
APEXEdgeConnection FACTORY
Returns either an existing APEXEdgeConnection stored in
the connection table or null .
|
(package private) static APEXEdgeConnection |
getConnectionForChannel(Channel c)
Returns a APEXEdgeConnection or null for a
given org.beepcore.beep.core.Channel . |
protected void |
handleReply(Message replyMessage,
APEXMessage message)
Handles a received reply message to a correspondent (sent) APEX message (attach, bind, terminate, or data). |
protected boolean |
isAuthenticated(APEXDataMessage m)
Returns a boolean which depends if the message is authentcated to be sent or not to the hop (either attached or bound). |
protected void |
messageNotSent(APEXMessage message)
Is called by the connection thread if the session is down an the message has not been sent. |
protected void |
noConnectionEstablished()
Is called by the connection thread if no connection is established and initiates correspondent actions (according the connection type and the underlying manager). |
void |
removeAttachedAs(APEXEndpointAddress aea)
Updates the authenticatedAs table if an the manager is
not attached (any more) as the specified endpoint address. |
static void |
removeEdgeConnection(String entity)
Removes the edge connection entry in the connection table for the specified entity name. |
protected void |
requestedChannelNotStarted()
Is called by the connection thread if no APEX channel is established and initiates correspondent actions (according the connection type and the underlying manager). |
void |
run()
|
boolean |
sendMessage(APEXDataMessage m,
APEXStatus s)
Sends a message on this connection. |
void |
terminate(APEXEndpointAddress aea,
int code,
String content,
String xmlLang,
APEXStatus s)
Terminates the endpoint address attachment on this connection, say at the (endpoint) / this (relay) entity, adds the status listener to the terminate message, and removes the endpoint address of the authenticatedAs
table. |
void |
terminate(int transID,
int code,
String content,
String xmlLang,
APEXStatus s)
Terminates a transaction on this connection, say at the entity, and adds the status listener to the terminate message. |
Methods inherited from class ch.epfl.lsr.apex.connection.APEXConnection |
addFirstMessage, addMessage, clearMessageFile, getChannelID, getMessage, getUniqueTransID, newAttachmentOrBinding, updateTransID |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static APEXEdgeConnection getAPEXEdgeConnection(APEXManager manager, String entity, Channel c, Object receivingChannelID)
APEXEdgeConnection
FACTORY
Returns either a new APEXEdgeConnection
or an existing,
stored in the connection table.
manager
- The managerentity
- The entity namec
- The existing channelreceivingChannelID
- The receiver's channel identifier
public static APEXEdgeConnection getAPEXEdgeConnection(String entity)
APEXEdgeConnection
FACTORY
Returns either an existing APEXEdgeConnection
stored in
the connection table or null
.
entity
- The entity name
null
public static APEXEdgeConnection getAPEXEdgeConnection(APEXManager manager, String entity, int edgePort)
APEXEdgeConnection
FACTORY
Returns either a new APEXEdgeConnection
or an existing
stored in the connection table.
manager
- The manager (endpoint)entity
- The entity name to connect toedgePort
- The edge port
static APEXEdgeConnection getConnectionForChannel(Channel c)
APEXEdgeConnection
or null
for a
given org.beepcore.beep.core.Channel
.
c
- The channel
APEXEdgeConnection
or null
public static void removeEdgeConnection(String entity)
entity
- The entity nameprotected boolean isAuthenticated(APEXDataMessage m)
APEXConnection
isAuthenticated
in class APEXConnection
public void addAttachedAs(APEXEndpointAddress aea)
authenticatedAs
table if the manager is
successfully attached as the specified endpoint address.
aea
- The attached endpoint addresspublic void removeAttachedAs(APEXEndpointAddress aea)
authenticatedAs
table if an the manager is
not attached (any more) as the specified endpoint address.
aea
- The not attached endpoint addresspublic void attach(APEXEndpointAddress aea, APEXStatus s)
aea
- The endpoint address to be attacheds
- The status listener or null
for nonepublic void terminate(APEXEndpointAddress aea, int code, String content, String xmlLang, APEXStatus s)
authenticatedAs
table.
aea
- The endpoint address to be terminatedcode
- An optional (applicational) code or 0content
- The content or null
for nonexmlLang
- The xml:lang or null
for nones
- The status listener or null
for nonepublic void terminate(int transID, int code, String content, String xmlLang, APEXStatus s)
transID
- code
- An optional (applicational) code or 0content
- The content or null
for nonexmlLang
- The xml:lang or null
for nones
- The status listener or null
for noneprotected void handleReply(Message replyMessage, APEXMessage message)
APEXConnection
handleReply
in class APEXConnection
replyMessage
- The received reply messagemessage
- The sent APEX messageprotected void messageNotSent(APEXMessage message)
APEXConnection
Is called by the connection thread if the session is down an the message has not been sent.
Dependent on the underlying manager and the connection type (edge or
mesh), this method either tries to reconnect or calls the discardMessage
method of its manager.
messageNotSent
in class APEXConnection
message
- The unsent messageprotected void noConnectionEstablished()
APEXConnection
noConnectionEstablished
in class APEXConnection
protected void disconnected()
protected void requestedChannelNotStarted()
APEXConnection
requestedChannelNotStarted
in class APEXConnection
protected void channelEstablished()
APEXConnection
channelEstablished
in class APEXConnection
public boolean sendMessage(APEXDataMessage m, APEXStatus s)
m
- The message to be sents
- The status listener or null
false
if the originator is unknownpublic void run()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |