|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.net.URLConnection | +--PkgAgentSystem.AMPURLConnection
A connection of type "amp" to another computer, allowing to transfer an agent from the local to the remote host. It is verified in advance, whether the agent will be allowed to move there. If AgentSystem.SECURE_CONNECTION is true, Diffie-Hellman key exchange is used to encrypt the communication. Then also the identity of the remote host is verfied (challenged for knowledge of the private key). This verification is symmetric: We also have to prove our identity. Both hosts must have the same value, else the protocol will be aborted. (AMP = Agent Movement Protocol)
URLConnection
,
AgentData
,
ServingThread
,
AMPStreamHandler
,
AMPStreamHandlerFactory
,
URL
Field Summary | |
protected AgentSystem |
ag_sys
The associated AgentSystem . |
protected MessageDigest |
handOff
The digest object we use for hand-off |
protected ObjectInputStream |
in
The ObjectInputStream of the socket |
protected Certificate |
other_cert
Certificate of the remote host |
protected PublicKey |
other_pub_key
The public key of the remote host |
protected Signature |
other_sign
Signature object of the remote host. |
protected Certificate |
our_cert
Certificate of this AgentSystem |
protected PublicKey |
our_pub_key
Our own public key (of the AgentSystem) |
protected Signature |
our_sign
Signature object of this host. |
protected ObjectOutputStream |
out
The ObjectOutputStream of the socket |
protected static SecureRandom |
rnd
A random number generator to create challenges |
protected javax.crypto.SecretKey |
sessionKey
The session key for encrypting the data. |
protected Socket |
sock
The socket we use to connect to the other host |
Fields inherited from class java.net.URLConnection |
allowUserInteraction, connected, doInput, doOutput, factory, ifModifiedSince, url, useCaches |
Constructor Summary | |
AMPURLConnection(URL url)
Creates a new connection to an URL . |
Method Summary | |
void |
checkAcceptance(AgentData data)
Check whether an agent will be allowed to move to the remote host. |
void |
connect()
Connect to the URL. |
(package private) void |
doHandOff(AgentIdentity agentIdentity)
Perform Hand-Off |
InputStream |
getInputStream()
Returns the InputStream of this connection. |
OutputStream |
getOutputStream()
Returns the OutputStream of this connection. |
Permission |
getPermission()
Get the permission needed for accessing his URL. |
void |
sendAgent(AgentData data)
Send an agent to the remote host. |
void |
setAuthenticationInfo(AgentSystem sys)
Sets the authentication info needed for establishing the connection. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Socket sock
protected ObjectInputStream in
ObjectInputStream
of the socketprotected ObjectOutputStream out
ObjectOutputStream
of the socketprotected javax.crypto.SecretKey sessionKey
protected PublicKey other_pub_key
protected PublicKey our_pub_key
protected Signature other_sign
protected Signature our_sign
protected Certificate our_cert
protected Certificate other_cert
protected MessageDigest handOff
protected AgentSystem ag_sys
AgentSystem
. Needed for access to our public/private key,
certificate and various routines.protected static SecureRandom rnd
Constructor Detail |
public AMPURLConnection(URL url)
URL
.url
- The URL
to connect to.Method Detail |
public Permission getPermission() throws IOException
SocketPermission("connect")
to the
host and port in the url is needed.getPermission
in class URLConnection
SocketPermission
public OutputStream getOutputStream() throws IOException
getOutputStream
in class URLConnection
UnknownServiceException
- public InputStream getInputStream() throws IOException
getInputStream
in class URLConnection
UnknownServiceException
- public void setAuthenticationInfo(AgentSystem sys) throws AuthenticationException
sys
- The agent system establishing this connection. Stored for later use.AuthenticationException
- if an error occurs (Certificate or private key cannot be extracted)public void connect() throws IOException, AuthenticationException
connect
in class URLConnection
IOException
- AuthenticationException
- void doHandOff(AgentIdentity agentIdentity) throws IOException, AuthenticationException
public void sendAgent(AgentData data) throws IOException, ReceiveAgentDeniedException
the
- AgentData
of the agent to transferIOException
- if any problem with the network occursReceiveAgentDeniedException
- if the other hosts denies the agent accesspublic void checkAcceptance(AgentData data) throws IOException, ReceiveAgentDeniedException
ReceiveAgentDeniedException
.the
- AgentData
of the agent to transferIOException
- if any problem with the network occursReceiveAgentDeniedException
- if the other hosts denies the agent accessAgentData
|
Agent System POND 1.2 (28.2.2002) | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |