org.objectweb.proactive.core.body
Class BodyForwarderImpl

java.lang.Object
  extended byorg.objectweb.proactive.core.body.BodyForwarderImpl
All Implemented Interfaces:
UniversalBodyForwarder

public class BodyForwarderImpl
extends java.lang.Object
implements UniversalBodyForwarder

A BodyForwarderImpl is not a Body but a forwarder. It is a singleton, one and only one body forwarder on each forwarder. Each method in UniversalBody as an equivalent in UniversalBody, same name, same return type, same arguments but as first argument an ID is passed. This ID allows to a body forwarder to identify uniquely the body to which forward a call.

Author:
ProActive Team

Field Summary
 
Fields inherited from interface org.objectweb.proactive.core.body.UniversalBodyForwarder
bodyLogger
 
Constructor Summary
BodyForwarderImpl()
           
 
Method Summary
 void add(UniversalBody rBody)
          Add rBody to the collection of known bodies
 void addcreatedBody(UniqueID id)
          Add id to the collection of body created through this forwarder
 void addNFEListener(UniqueID id, NFEListener listener)
           
 void changeProxiedBody(UniqueID id, Body newBody)
           
 void createShortcut(UniqueID id, Shortcut shortcut)
           
 void disableAC(UniqueID id)
           
 void enableAC(UniqueID id)
           
 int fireNFE(UniqueID id, NonFunctionalException e)
           
 java.security.cert.X509Certificate getCertificate(UniqueID id)
           
 byte[] getCertificateEncoded(UniqueID id)
           
 java.util.ArrayList getEntities(UniqueID id)
           
 UniqueID getID(UniqueID id)
           
 java.lang.String getJobID(UniqueID id)
           
 java.lang.String getNodeURL(UniqueID id)
           
 SecurityContext getPolicy(UniqueID id, SecurityContext securityContext)
           
 java.security.PublicKey getPublicKey(UniqueID id)
           
 BodyAdapter getRemoteAdapter(UniqueID id)
           
 UniversalBody lookup(UniqueID id, java.lang.String url)
           
 byte[][] publicKeyExchange(UniqueID id, long sessionID, byte[] my_pub, byte[] my_cert, byte[] sig_code)
           
 byte[] randomValue(UniqueID id, long sessionID, byte[] cl_rand)
           
 java.lang.Object receiveFTMessage(UniqueID id, FTMessage ev)
           
 int receiveReply(UniqueID id, Reply r)
           
 int receiveRequest(UniqueID id, Request request)
           
 void register(UniqueID id, java.lang.String url)
           
 void removeImmediateService(UniqueID id, java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 void removeNFEListener(UniqueID id, NFEListener listener)
           
 byte[][] secretKeyExchange(UniqueID id, long sessionID, byte[] tmp, byte[] tmp1, byte[] tmp2, byte[] tmp3, byte[] tmp4)
           
 void setImmediateService(UniqueID id, java.lang.String methodName)
           
 void setImmediateService(UniqueID id, java.lang.String methodName, java.lang.Class[] parametersTypes)
           
 long startNewSession(UniqueID id, Communication policy)
           
 void terminate(UniqueID id)
           
 void terminateSession(UniqueID id, long sessionID)
           
 void unregister(UniqueID id, java.lang.String url)
           
 void updateLocation(UniqueID id, UniqueID uid, UniversalBody body)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BodyForwarderImpl

public BodyForwarderImpl()
Method Detail

add

public void add(UniversalBody rBody)
Add rBody to the collection of known bodies

Parameters:
rBody - The body to be added

addcreatedBody

public void addcreatedBody(UniqueID id)
Add id to the collection of body created through this forwarder

Parameters:
id - ID of created body

createShortcut

public void createShortcut(UniqueID id,
                           Shortcut shortcut)
                    throws java.io.IOException
Specified by:
createShortcut in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.createShortcut(Shortcut)

disableAC

public void disableAC(UniqueID id)
               throws java.io.IOException
Specified by:
disableAC in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.disableAC()

enableAC

public void enableAC(UniqueID id)
              throws java.io.IOException
Specified by:
enableAC in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.enableAC()

getCertificate

public java.security.cert.X509Certificate getCertificate(UniqueID id)
                                                  throws SecurityNotAvailableException,
                                                         java.io.IOException
Specified by:
getCertificate in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException
See Also:
SecurityEntity.getCertificate()

getCertificateEncoded

public byte[] getCertificateEncoded(UniqueID id)
                             throws SecurityNotAvailableException,
                                    java.io.IOException
Specified by:
getCertificateEncoded in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException
See Also:
SecurityEntity.getCertificate()

getEntities

public java.util.ArrayList getEntities(UniqueID id)
                                throws SecurityNotAvailableException,
                                       java.io.IOException
Specified by:
getEntities in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException
See Also:
SecurityEntity.getEntities()

getID

public UniqueID getID(UniqueID id)
Specified by:
getID in interface UniversalBodyForwarder
See Also:
UniversalBody.getID()

getNodeURL

public java.lang.String getNodeURL(UniqueID id)
Specified by:
getNodeURL in interface UniversalBodyForwarder
See Also:
UniversalBody.getNodeURL()

getPolicy

public SecurityContext getPolicy(UniqueID id,
                                 SecurityContext securityContext)
                          throws SecurityNotAvailableException,
                                 java.io.IOException
Specified by:
getPolicy in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException
See Also:
SecurityEntity.getPolicy(SecurityContext)

getPublicKey

public java.security.PublicKey getPublicKey(UniqueID id)
                                     throws SecurityNotAvailableException,
                                            java.io.IOException
Specified by:
getPublicKey in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException
See Also:
SecurityEntity.getPublicKey()

getRemoteAdapter

public BodyAdapter getRemoteAdapter(UniqueID id)
Specified by:
getRemoteAdapter in interface UniversalBodyForwarder
See Also:
UniversalBody.getRemoteAdapter()

publicKeyExchange

public byte[][] publicKeyExchange(UniqueID id,
                                  long sessionID,
                                  byte[] my_pub,
                                  byte[] my_cert,
                                  byte[] sig_code)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  KeyExchangeException,
                                  java.io.IOException
Specified by:
publicKeyExchange in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
RenegotiateSessionException
KeyExchangeException
java.io.IOException
See Also:
SecurityEntity.publicKeyExchange(long, byte[], byte[], byte[])

receiveFTMessage

public java.lang.Object receiveFTMessage(UniqueID id,
                                         FTMessage ev)
                                  throws java.io.IOException
Specified by:
receiveFTMessage in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.receiveFTMessage(FTMessage)

receiveReply

public int receiveReply(UniqueID id,
                        Reply r)
                 throws java.io.IOException
Specified by:
receiveReply in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.receiveReply(Reply)

receiveRequest

public int receiveRequest(UniqueID id,
                          Request request)
                   throws java.io.IOException,
                          RenegotiateSessionException
Specified by:
receiveRequest in interface UniversalBodyForwarder
Throws:
java.io.IOException
RenegotiateSessionException
See Also:
UniversalBody.receiveRequest(Request)

removeImmediateService

public void removeImmediateService(UniqueID id,
                                   java.lang.String methodName,
                                   java.lang.Class[] parametersTypes)
                            throws java.io.IOException
Specified by:
removeImmediateService in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.removeImmediateService(String, Class[])

secretKeyExchange

public byte[][] secretKeyExchange(UniqueID id,
                                  long sessionID,
                                  byte[] tmp,
                                  byte[] tmp1,
                                  byte[] tmp2,
                                  byte[] tmp3,
                                  byte[] tmp4)
                           throws SecurityNotAvailableException,
                                  RenegotiateSessionException,
                                  java.io.IOException
Specified by:
secretKeyExchange in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
RenegotiateSessionException
java.io.IOException
See Also:
SecurityEntity.secretKeyExchange(long, byte[], byte[], byte[], byte[], byte[])

setImmediateService

public void setImmediateService(UniqueID id,
                                java.lang.String methodName,
                                java.lang.Class[] parametersTypes)
                         throws java.io.IOException
Specified by:
setImmediateService in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.setImmediateService(String, Class[])

setImmediateService

public void setImmediateService(UniqueID id,
                                java.lang.String methodName)
                         throws java.io.IOException
Specified by:
setImmediateService in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.setImmediateService(String)

startNewSession

public long startNewSession(UniqueID id,
                            Communication policy)
                     throws SecurityNotAvailableException,
                            java.io.IOException,
                            RenegotiateSessionException
Specified by:
startNewSession in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
java.io.IOException
RenegotiateSessionException
See Also:
SecurityEntity.startNewSession(Communication)

terminate

public void terminate(UniqueID id)
               throws java.io.IOException
Specified by:
terminate in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.terminate()

terminateSession

public void terminateSession(UniqueID id,
                             long sessionID)
                      throws java.io.IOException,
                             SecurityNotAvailableException
Specified by:
terminateSession in interface UniversalBodyForwarder
Throws:
java.io.IOException
SecurityNotAvailableException
See Also:
SecurityEntity.terminateSession(long)

randomValue

public byte[] randomValue(UniqueID id,
                          long sessionID,
                          byte[] cl_rand)
                   throws SecurityNotAvailableException,
                          RenegotiateSessionException,
                          java.io.IOException
Specified by:
randomValue in interface UniversalBodyForwarder
Throws:
SecurityNotAvailableException
RenegotiateSessionException
java.io.IOException
See Also:
SecurityEntity.randomValue(long, byte[])

updateLocation

public void updateLocation(UniqueID id,
                           UniqueID uid,
                           UniversalBody body)
                    throws java.io.IOException
Specified by:
updateLocation in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
UniversalBody.updateLocation(UniqueID, UniversalBody)

getJobID

public java.lang.String getJobID(UniqueID id)
                          throws java.io.IOException
Specified by:
getJobID in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
Job.getJobID()

addNFEListener

public void addNFEListener(UniqueID id,
                           NFEListener listener)
                    throws java.io.IOException
Specified by:
addNFEListener in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
NFEProducer.addNFEListener(NFEListener)

removeNFEListener

public void removeNFEListener(UniqueID id,
                              NFEListener listener)
                       throws java.io.IOException
Specified by:
removeNFEListener in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
NFEProducer.removeNFEListener(NFEListener)

changeProxiedBody

public void changeProxiedBody(UniqueID id,
                              Body newBody)
                       throws java.io.IOException
Specified by:
changeProxiedBody in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
BodyAdapter.changeProxiedBody(Body)

fireNFE

public int fireNFE(UniqueID id,
                   NonFunctionalException e)
            throws java.io.IOException
Specified by:
fireNFE in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
NFEProducer.fireNFE(NonFunctionalException)

lookup

public UniversalBody lookup(UniqueID id,
                            java.lang.String url)
                     throws java.io.IOException
Specified by:
lookup in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
BodyAdapter.lookup(String)

register

public void register(UniqueID id,
                     java.lang.String url)
              throws java.io.IOException
Specified by:
register in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
BodyAdapter.register(String)

unregister

public void unregister(UniqueID id,
                       java.lang.String url)
                throws java.io.IOException
Specified by:
unregister in interface UniversalBodyForwarder
Throws:
java.io.IOException
See Also:
BodyAdapter.unregister(String)


Copyright 2001-2005 INRIA All Rights Reserved.