All Packages Class Hierarchy This Package Previous Next Index
Class ProtocolLayer.IPRouterRecvThread
Abstract.Connection
|
+----Abstract.ReceiverThread
|
+----BaseLayer.BRecvThread
|
+----KQMLLayer.KQMLRecvThread
|
+----RouterLayer.Router.RouterRecvThread
|
+----ProtocolLayer.IPRouterRecvThread
- public class IPRouterRecvThread
- extends RouterRecvThread
Extended from RouterRecvThread, this class handles SMTP and FTP proxy. This class
is only for router. IPRouterClientAction will not use this class.
-
INTERNALSOCKETERROR
- Error codes : Proxy server socket can not be created
-
MESSAGECONTENTERROR
- Error codes : The content of KQML message is wrong
-
NOTSUPPORTEDPROTOCOL
- Error codes : The protocol is not supported
-
PROTOCOLNOTSPECIFIED
- Error codes : The protocol is not specified
-
SERVERADDRESSMISSING
- Error codes : Server address(SMTP or FTP server) is not found
-
SERVICECLOSED
- Error codes : The internet service is closed
-
IPRouterRecvThread()
- Default Constructor.
-
IPRouterRecvThread(Address, Address, ConnectionTable, String, Security, OffLineAgentTable)
- Router receiver thread to send off-line agent's messages back to the senders with error.
-
IPRouterRecvThread(Address, int, Address, ConnectionTable, MessageBuffer, Security, String, Hashtable, OffLineAgentTable, Vector, ThreadGroup)
- This constructor is called when an agent want to initialize a connection
to the other agents, using Address
-
IPRouterRecvThread(Socket, int, Address, ConnectionTable, MessageBuffer, Security, String, Hashtable, OffLineAgentTable, Vector)
- Constructor, to be called from the serverthread after accepting
a connection.
-
IPRouterRecvThread(String)
- Constructor with the Agent name.
-
getEmailAddress(Address)
- Get email address from Address object
-
processDefaultProtocol(KQMLmessage)
- Processing default protocols : disconnect-agent, reserve-message, list-agent, request-address,
and unregister-agent.
-
sendProtocolErrorMessage(int, KQMLmessage)
- Send protocol error message occurs dusing transaction
SERVERADDRESSMISSING
INTERNALSOCKETERROR
MESSAGECONTENTERROR
SERVICECLOSED
PROTOCOLNOTSPECIFIED
SERVERADDRESSMISSING
protected static final int SERVERADDRESSMISSING
- Error codes : Server address(SMTP or FTP server) is not found
INTERNALSOCKETERROR
protected static final int INTERNALSOCKETERROR
- Error codes : Proxy server socket can not be created
NOTSUPPORTEDPROTOCOL
protected static final int NOTSUPPORTEDPROTOCOL
- Error codes : The protocol is not supported
MESSAGECONTENTERROR
protected static final int MESSAGECONTENTERROR
- Error codes : The content of KQML message is wrong
SERVICECLOSED
protected static final int SERVICECLOSED
- Error codes : The internet service is closed
PROTOCOLNOTSPECIFIED
protected static final int PROTOCOLNOTSPECIFIED
- Error codes : The protocol is not specified
IPRouterRecvThread
public IPRouterRecvThread()
- Default Constructor.
IPRouterRecvThread
public IPRouterRecvThread(String name)
- Constructor with the Agent name. If you use this constructor, you should
use set methods to set data members
- Parameters:
- name - Agent name
IPRouterRecvThread
public IPRouterRecvThread(Socket client_socket,
int priority,
Address myaddress,
ConnectionTable connections,
MessageBuffer queue,
Security security,
String messageboxpath,
Hashtable reservedBook,
OffLineAgentTable offlinelist,
Vector disconnectlist) throws ConnectionException
- Constructor, to be called from the serverthread after accepting
a connection.
- Parameters:
- client_scoket - The socket for the remote client;
- priority - The priority of the thread.
- myaddress - My address to be sent to the Router to check security
- connections - The connection table is passed as an argument.
- queue - The Message Queue. Normally null. It will be created by this if null
- security - The RouterSecurity
- messageboxpath - The Message incoming box directory
- reservedBook - The reservation table, passed from the RouterAction
- offlinelist - The off line agent name list.
- disconnectlist - The disconnected agent name list.
IPRouterRecvThread
public IPRouterRecvThread(Address serveraddress,
int priority,
Address myaddress,
ConnectionTable connections,
MessageBuffer queue,
Security security,
String messageboxpath,
Hashtable reservedBook,
OffLineAgentTable offlinelist,
Vector disconnectlist,
ThreadGroup tg) throws ConnectionException
- This constructor is called when an agent want to initialize a connection
to the other agents, using Address
- Parameters:
- serveraddress - The Router address
- priority - The priority of the thread.
- myaddress - My address to be sent to the Router to check security
- connections - The connection table is passed as an argument.
- queue - The Message Queue. Normally null. It will be created by this if null
- security - The RouterSecurity
- messageboxpath - The Message incoming box directory
- reservedBook - The reservation table, passed from the RouterAction
- offlinelist - The off line agent name list.
- disconnectlist - The disconnected agent name list.
- tg - The thread group to which this receiver thread will be owned to
IPRouterRecvThread
public IPRouterRecvThread(Address serveraddress,
Address myaddress,
ConnectionTable connections,
String messageboxpath,
Security security,
OffLineAgentTable offlinelist)
- Router receiver thread to send off-line agent's messages back to the senders with error.
- Parameters:
- serveraddress - Router address
- myaddress - Router address to be sent to the Router to check security
- connections - The connection table is passed as an argument.
- security - The RouterSecurity
- messageboxpath - The Message incoming box directory
- offlinelist - The off line agent name list.
processDefaultProtocol
protected synchronized void processDefaultProtocol(KQMLmessage kqml)
- Processing default protocols : disconnect-agent, reserve-message, list-agent, request-address,
and unregister-agent. You need to extend this method if your router has extended capability
other than message routing(e.g. to support another internet protocol such as SMTP, FTP,etc.)
- Parameters:
- kqml - Received KQML message
- Overrides:
- processDefaultProtocol in class RouterRecvThread
getEmailAddress
public String getEmailAddress(Address addr)
- Get email address from Address object
- Parameters:
- addr - Address
- Returns:
- null String("") if no email is specified. Email address(e.g. jhc@cdr.stanford.edu)
if addr contains email address information.
sendProtocolErrorMessage
public void sendProtocolErrorMessage(int code,
KQMLmessage kqml)
- Send protocol error message occurs dusing transaction
SERVERADDRESSMISSING
INTERNALSOCKETERROR
MESSAGECONTENTERROR
SERVICECLOSED
PROTOCOLNOTSPECIFIED
- Parameters:
- code - Code described above
- kqml - KQML message modified to 'error' protocol
All Packages Class Hierarchy This Package Previous Next Index