org.objectweb.proactive.core.body.http
Class HttpRemoteBodyImpl

java.lang.Object
  extended byorg.objectweb.proactive.core.body.http.HttpRemoteBodyImpl
All Implemented Interfaces:
RemoteBody, SecurityEntity, java.io.Serializable

public class HttpRemoteBodyImpl
extends java.lang.Object
implements RemoteBody

Author:
vlegrand
See Also:
Serialized Form

Field Summary
protected  UniversalBody body
          The encapsulated local body transient to deal with custom serialization of requests.
 
Fields inherited from interface org.objectweb.proactive.core.body.RemoteBody
bodyLogger
 
Constructor Summary
HttpRemoteBodyImpl(UniversalBody body)
           
 
Method Summary
 void addNFEListener(NFEListener listener)
           
 void changeProxiedBody(Body newBody)
          Change the body referenced by this adapter
 void createShortcut(Shortcut shortcut)
           
 void disableAC()
          Disables automatic continuation mechanism for this body
 void enableAC()
          Enables automatic continuation mechanism for this body
 int fireNFE(NonFunctionalException e)
           
 java.security.cert.X509Certificate getCertificate()
          entity certificate
 byte[] getCertificateEncoded()
          Entity's X509Certificate as byte array
 java.util.ArrayList getEntities()
          Retrieves all the entity's ID which contain this entity plus this entity ID.
 UniqueID getID()
          Returns the UniqueID of this body This identifier is unique accross all JVMs
 java.lang.String getJobID()
           
 java.lang.String getNodeURL()
          Returns the url of the node this body is associated to The url of the node can change if the active object migrates
 SecurityContext getPolicy(SecurityContext securityContext)
          Ask the entity to fill the securityContext parameters with its own policy according to the communication details contained in the given securityContext
 java.security.PublicKey getPublicKey()
          entity public key
 byte[][] publicKeyExchange(long sessionID, byte[] my_pub, byte[] my_cert, byte[] sig_code)
          exchange entity certificate and/or public key if certificate are not available
 byte[] randomValue(long sessionID, byte[] cl_rand)
          Exchange random value between client and server entity
 java.lang.Object receiveFTMessage(FTMessage ev)
          STILL NOT IMPLEMENTED
 int receiveReply(Reply reply)
          Receives a reply in response to a former request.
 int receiveRequest(Request request)
          Receives a request for later processing.
 void removeImmediateService(java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 void removeNFEListener(NFEListener listener)
           
 byte[][] secretKeyExchange(long sessionID, byte[] tmp, byte[] tmp1, byte[] tmp2, byte[] tmp3, byte[] tmp4)
          this method sends encoded secret parameters to the target entity
 void setImmediateService(java.lang.String methodName)
          For setting an immediate service for this body.
 void setImmediateService(java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 long startNewSession(Communication policy)
          start an unvalidated empty session
 void terminate()
          Terminate the body.
 void terminateSession(long sessionID)
          terminate a given session
 void updateLocation(UniqueID id, UniversalBody body)
          Signals to this body that the body identified by id is now to a new remote location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

body

protected transient UniversalBody body
The encapsulated local body transient to deal with custom serialization of requests.

Constructor Detail

HttpRemoteBodyImpl

public HttpRemoteBodyImpl(UniversalBody body)
Method Detail

receiveRequest

public int receiveRequest(Request request)
                   throws java.io.IOException,
                          RenegotiateSessionException
Description copied from interface: RemoteBody
Receives a request for later processing. The call to this method is non blocking unless the body cannot temporary receive the request.

Specified by:
receiveRequest in interface RemoteBody
Parameters:
request - the request to process
Returns:
value for fault-tolerance protocol
Throws:
RenegotiateSessionException
java.io.IOException
See Also:
UniversalBody.receiveRequest(org.objectweb.proactive.core.body.request.Request)

receiveReply

public int receiveReply(Reply reply)
                 throws java.io.IOException
Description copied from interface: RemoteBody
Receives a reply in response to a former request.

Specified by:
receiveReply in interface RemoteBody
Parameters:
reply - the reply received
Returns:
value for fault-tolerance protocol
Throws:
java.io.IOException - if the reply cannot be accepted
See Also:
UniversalBody.receiveReply(org.objectweb.proactive.core.body.reply.Reply)

terminate

public void terminate()
               throws java.io.IOException
Description copied from interface: RemoteBody
Terminate the body. After this call the body is no more alive and no more active although the active thread is not interrupted. The body is unuseable after this call.

Specified by:
terminate in interface RemoteBody
Throws:
java.io.IOException - if an exception occured during the remote communication
See Also:
UniversalBody.terminate()

getNodeURL

public java.lang.String getNodeURL()
                            throws HTTPRemoteException
Description copied from interface: RemoteBody
Returns the url of the node this body is associated to The url of the node can change if the active object migrates

Specified by:
getNodeURL in interface RemoteBody
Returns:
the url of the node this body is associated to
Throws:
HTTPRemoteException
See Also:
UniversalBody.getNodeURL()

getID

public UniqueID getID()
Description copied from interface: RemoteBody
Returns the UniqueID of this body This identifier is unique accross all JVMs

Specified by:
getID in interface RemoteBody
Returns:
the UniqueID of this body
See Also:
UniversalBody.getID()

updateLocation

public void updateLocation(UniqueID id,
                           UniversalBody body)
                    throws java.io.IOException
Description copied from interface: RemoteBody
Signals to this body that the body identified by id is now to a new remote location. The body given in parameter is a new stub pointing to this new location. This call is a way for a body to signal to his peer that it has migrated to a new location

Specified by:
updateLocation in interface RemoteBody
Parameters:
id - the id of the body
body - the stub to the new location
Throws:
java.io.IOException - if an exception occured during the remote communication
See Also:
UniversalBody.updateLocation(org.objectweb.proactive.core.UniqueID, org.objectweb.proactive.core.body.UniversalBody)

enableAC

public void enableAC()
              throws java.io.IOException
Description copied from interface: RemoteBody
Enables automatic continuation mechanism for this body

Specified by:
enableAC in interface RemoteBody
Throws:
java.io.IOException - if an exception occured during the remote communication
See Also:
UniversalBody.enableAC()

disableAC

public void disableAC()
               throws java.io.IOException
Description copied from interface: RemoteBody
Disables automatic continuation mechanism for this body

Specified by:
disableAC in interface RemoteBody
Throws:
java.io.IOException - if an exception occured during the remote communication
See Also:
UniversalBody.disableAC()

setImmediateService

public void setImmediateService(java.lang.String methodName)
                         throws java.io.IOException
Description copied from interface: RemoteBody
For setting an immediate service for this body. An immediate service is a method that will bw excecuted by the calling thread.

Specified by:
setImmediateService in interface RemoteBody
Throws:
java.io.IOException - if an exception occured during the remote communication
See Also:
UniversalBody.setImmediateService(java.lang.String)

setImmediateService

public void setImmediateService(java.lang.String methodName,
                                java.lang.Class[] parametersTypes)
                         throws java.io.IOException
Specified by:
setImmediateService in interface RemoteBody
Throws:
java.io.IOException

removeImmediateService

public void removeImmediateService(java.lang.String methodName,
                                   java.lang.Class[] parametersTypes)
                            throws java.io.IOException
Specified by:
removeImmediateService in interface RemoteBody
Throws:
java.io.IOException

terminateSession

public void terminateSession(long sessionID)
                      throws java.io.IOException,
                             SecurityNotAvailableException
Description copied from interface: SecurityEntity
terminate a given session

Specified by:
terminateSession in interface SecurityEntity
Parameters:
sessionID -
Throws:
SecurityNotAvailableException - id security is not available
java.io.IOException
See Also:
SecurityEntity.terminateSession(long)

getCertificate

public java.security.cert.X509Certificate getCertificate()
                                                  throws SecurityNotAvailableException,
                                                         java.io.IOException
Description copied from interface: SecurityEntity
entity certificate

Specified by:
getCertificate in interface SecurityEntity
Returns:
returns entity certificate
Throws:
java.io.IOException - if communication fails
SecurityNotAvailableException - if security is not available
See Also:
SecurityEntity.getCertificate()

startNewSession

public long startNewSession(Communication policy)
                     throws SecurityNotAvailableException,
                            java.io.IOException,
                            RenegotiateSessionException
Description copied from interface: SecurityEntity
start an unvalidated empty session

Specified by:
startNewSession in interface SecurityEntity
Parameters:
policy - policy associated to the session
Returns:
session ID
Throws:
RenegotiateSessionException - if the session immediatly expires
SecurityNotAvailableException - if security is not available
java.io.IOException
See Also:
SecurityEntity.startNewSession(org.objectweb.proactive.ext.security.Communication)

getPublicKey

public java.security.PublicKey getPublicKey()
                                     throws SecurityNotAvailableException,
                                            java.io.IOException
Description copied from interface: SecurityEntity
entity public key

Specified by:
getPublicKey in interface SecurityEntity
Returns:
returns entity public key
Throws:
SecurityNotAvailableException
java.io.IOException
See Also:
SecurityEntity.getPublicKey()

randomValue

public byte[] randomValue(long sessionID,
                          byte[] cl_rand)
                   throws SecurityNotAvailableException,
                          java.io.IOException,
                          RenegotiateSessionException
Description copied from interface: SecurityEntity
Exchange random value between client and server entity

Specified by:
randomValue in interface SecurityEntity
Parameters:
sessionID - the session ID
cl_rand - client random value
Returns:
server random value
Throws:
RenegotiateSessionException - if the session has expired
SecurityNotAvailableException - if the security is not available
java.io.IOException
See Also:
SecurityEntity.randomValue(long, byte[])

publicKeyExchange

public byte[][] publicKeyExchange(long sessionID,
                                  byte[] my_pub,
                                  byte[] my_cert,
                                  byte[] sig_code)
                           throws SecurityNotAvailableException,
                                  java.io.IOException,
                                  KeyExchangeException,
                                  RenegotiateSessionException
Description copied from interface: SecurityEntity
exchange entity certificate and/or public key if certificate are not available

Specified by:
publicKeyExchange in interface SecurityEntity
Parameters:
sessionID - the session ID
my_pub - encoded public key
my_cert - encoded certificate
sig_code - encoded signature of previous paramaters
Returns:
an array containing : - server certificate and/or server public key - encoded signature of these parameters
Throws:
SecurityNotAvailableException - if the security is not available
KeyExchangeException - if a key data/length/algorithm is not supported
RenegotiateSessionException - if the session has expired
java.io.IOException
See Also:
SecurityEntity.publicKeyExchange(long, byte[], byte[], byte[])

secretKeyExchange

public byte[][] secretKeyExchange(long sessionID,
                                  byte[] tmp,
                                  byte[] tmp1,
                                  byte[] tmp2,
                                  byte[] tmp3,
                                  byte[] tmp4)
                           throws SecurityNotAvailableException,
                                  java.io.IOException,
                                  RenegotiateSessionException
Description copied from interface: SecurityEntity
this method sends encoded secret parameters to the target entity

Specified by:
secretKeyExchange in interface SecurityEntity
Parameters:
sessionID - session ID
tmp - the AES key use to exchange secret message
tmp1 - Initilization parameters for the AES key
tmp2 - MAC key for checking signature of future messages
tmp3 - random value to prevent message replays by an external attacker
tmp4 - encoded signature of the previous parameters
Returns:
an array containing : - encoded server AES key - encoded IV parameters - encoded server MAC key - encoded lock data to prevent message replays - encoded signature of previous parameters
Throws:
RenegotiateSessionException
java.io.IOException - if communication fails
SecurityNotAvailableException - if this entity does not support security
See Also:
SecurityEntity.secretKeyExchange(long, byte[], byte[], byte[], byte[], byte[])

getPolicy

public SecurityContext getPolicy(SecurityContext securityContext)
                          throws SecurityNotAvailableException,
                                 java.io.IOException
Description copied from interface: SecurityEntity
Ask the entity to fill the securityContext parameters with its own policy according to the communication details contained in the given securityContext

Specified by:
getPolicy in interface SecurityEntity
Parameters:
securityContext - communication details allowing the entity to look for a matching policy
Returns:
securityContext filled with this entity's policy
Throws:
SecurityNotAvailableException - thrown the entity doest not support the security
java.io.IOException
See Also:
SecurityEntity.getPolicy(org.objectweb.proactive.ext.security.SecurityContext)

getCertificateEncoded

public byte[] getCertificateEncoded()
                             throws SecurityNotAvailableException,
                                    java.io.IOException
Description copied from interface: SecurityEntity
Entity's X509Certificate as byte array

Specified by:
getCertificateEncoded in interface SecurityEntity
Returns:
entity's X509Certificate as byte array
Throws:
SecurityNotAvailableException
java.io.IOException
See Also:
SecurityEntity.getCertificateEncoded()

getEntities

public java.util.ArrayList getEntities()
                                throws SecurityNotAvailableException,
                                       java.io.IOException
Description copied from interface: SecurityEntity
Retrieves all the entity's ID which contain this entity plus this entity ID.

Specified by:
getEntities in interface SecurityEntity
Returns:
returns all the entity's ID which contain this entity plus this entity ID.
Throws:
SecurityNotAvailableException - if the target entity does not support security
java.io.IOException
See Also:
SecurityEntity.getEntities()

getJobID

public java.lang.String getJobID()
Specified by:
getJobID in interface RemoteBody
Returns:
the JobID of the remote body
See Also:
Job.getJobID()

receiveFTMessage

public java.lang.Object receiveFTMessage(FTMessage ev)
                                  throws java.io.IOException
STILL NOT IMPLEMENTED

Specified by:
receiveFTMessage in interface RemoteBody
Parameters:
ev - the message
Returns:
depends on the message meaning
Throws:
java.io.IOException - if an exception occured during the remote communication
See Also:
UniversalBody.receiveFTMessage(FTMessage)

createShortcut

public void createShortcut(Shortcut shortcut)
                    throws java.io.IOException
Throws:
java.io.IOException
See Also:
UniversalBody.createShortcut(org.objectweb.proactive.core.component.request.Shortcut)

addNFEListener

public void addNFEListener(NFEListener listener)
                    throws HTTPRemoteException
Specified by:
addNFEListener in interface RemoteBody
Throws:
HTTPRemoteException

removeNFEListener

public void removeNFEListener(NFEListener listener)
                       throws HTTPRemoteException
Specified by:
removeNFEListener in interface RemoteBody
Throws:
HTTPRemoteException

fireNFE

public int fireNFE(NonFunctionalException e)
            throws HTTPRemoteException
Specified by:
fireNFE in interface RemoteBody
Throws:
HTTPRemoteException

changeProxiedBody

public void changeProxiedBody(Body newBody)
                       throws java.io.IOException
Description copied from interface: RemoteBody
Change the body referenced by this adapter

Specified by:
changeProxiedBody in interface RemoteBody
Parameters:
newBody - the body referenced after the call
Throws:
java.io.IOException - if an exception occured during the remote communication
See Also:
RemoteBody.changeProxiedBody(org.objectweb.proactive.Body)


Copyright 2001-2005 INRIA All Rights Reserved.