|
||||||||||
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.APEXMeshConnection
An APEXMeshConnection
handles the connection between two
nodes in the APEX Mesh (relay-relay) and adds manager
specific (actually only relay) policies for the connection.
Field Summary | |
static int |
BOUND
|
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 |
addBoundAs(String administrativeDomain)
Updates the authenticatedAs table if the manager is
successfully bound as the specified administrative domain. |
void |
bind(String administrativeDomain,
APEXStatus s)
Binds as the administrative domain on this connection, say at the entity, and adds the status listener to the attach message. |
void |
bindRelay(String domain,
int transID)
Adds the newly bound relay to the internal id file. |
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). |
static APEXMeshConnection |
getAPEXMeshConnection(APEXManager manager,
APEXRoutingPoint arp)
APEXEdgeConnection FACTORY
Returns either a new APEXEdgeConnection or an existing
stored in the connection table.
|
static APEXMeshConnection |
getAPEXMeshConnection(APEXManager manager,
String entity,
Channel c,
Object receivingChannelID)
APEXMeshConnection FACTORY
Returns either a new APEXMeshConnection or an existing,
stored in the connection table.
|
static APEXMeshConnection |
getAPEXMeshConnection(String entity)
APEXMeshConnection FACTORY
Returns either an existing APEXMeshConnection stored in
the connection table or null .
|
(package private) static APEXMeshConnection |
getConnectionForChannel(Channel c)
Returns a APEXMeshConnection 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 |
removeBoundAs(String administrativeDomain)
Updates the authenticatedAs table if an the manager is
not bound (any more) as the specified administrative domain. |
static void |
removeMeshConnection(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(APEXMessage m)
Sends a message on this connection. |
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. |
void |
terminate(String relay,
int code,
String content,
String xmlLang,
APEXStatus s)
Terminates the relay binding on this connection, say at this / this entity, adds the status listener to the terminate message, and removes the endpoint address of the authenticatedAs
table. |
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 |
Field Detail |
public static final int BOUND
Method Detail |
public static APEXMeshConnection getAPEXMeshConnection(APEXManager manager, String entity, Channel c, Object receivingChannelID)
APEXMeshConnection
FACTORY
Returns either a new APEXMeshConnection
or an existing,
stored in the connection table.
manager
- The managerentity
- The entity namec
- The existing channelreceivingChannelID
- The receiver's channel identifier
public static APEXMeshConnection getAPEXMeshConnection(String entity)
APEXMeshConnection
FACTORY
Returns either an existing APEXMeshConnection
stored in
the connection table or null
.
entity
- The entity name
null
public static APEXMeshConnection getAPEXMeshConnection(APEXManager manager, APEXRoutingPoint arp)
APEXEdgeConnection
FACTORY
Returns either a new APEXEdgeConnection
or an existing
stored in the connection table.
manager
- The manager (endpoint)arp
- A routing point element
public static void removeMeshConnection(String entity)
entity
- The entity namestatic APEXMeshConnection getConnectionForChannel(Channel c)
APEXMeshConnection
or null
for a
given org.beepcore.beep.core.Channel
.
c
- The channel
APEXMeshConnection
or null
protected boolean isAuthenticated(APEXDataMessage m)
APEXConnection
isAuthenticated
in class APEXConnection
public void addBoundAs(String administrativeDomain)
authenticatedAs
table if the manager is
successfully bound as the specified administrative domain.
administrativeDomain
- The bound administrative domainpublic void removeBoundAs(String administrativeDomain)
authenticatedAs
table if an the manager is
not bound (any more) as the specified administrative domain.
administrativeDomain
- The not bound administrative domainpublic void bind(String administrativeDomain, APEXStatus s)
administrativeDomain
- The administrative domain to be bounds
- The status listener or null
for nonepublic void bindRelay(String domain, int transID)
domain
- The entity's domaintransID
- The transaction identifierpublic void terminate(String relay, int code, String content, String xmlLang, APEXStatus s)
authenticatedAs
table.
relay
- The relay 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(APEXMessage m)
m
- The message to be sent
public void run()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |