org/objectweb/proactive/core/body/UniversalBodyForwarder.java

00001 /* 
00002  * ################################################################
00003  * 
00004  * ProActive: The Java(TM) library for Parallel, Distributed, 
00005  *            Concurrent computing with Security and Mobility
00006  * 
00007  * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
00008  * Contact: proactive@objectweb.org
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or any later version.
00014  *  
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00023  * USA
00024  *  
00025  *  Initial developer(s):               The ProActive Team
00026  *                        http://www.inria.fr/oasis/ProActive/contacts.html
00027  *  Contributor(s): 
00028  * 
00029  * ################################################################
00030  */ 
00031 package org.objectweb.proactive.core.body;
00032 
00033 import java.io.IOException;
00034 import java.security.PublicKey;
00035 import java.security.cert.X509Certificate;
00036 import java.util.ArrayList;
00037 
00038 import org.apache.log4j.Logger;
00039 import org.objectweb.proactive.Body;
00040 import org.objectweb.proactive.core.UniqueID;
00041 import org.objectweb.proactive.core.body.ft.internalmsg.FTMessage;
00042 import org.objectweb.proactive.core.body.reply.Reply;
00043 import org.objectweb.proactive.core.body.request.Request;
00044 import org.objectweb.proactive.core.component.request.Shortcut;
00045 import org.objectweb.proactive.core.exceptions.NonFunctionalException;
00046 import org.objectweb.proactive.core.exceptions.manager.NFEListener;
00047 import org.objectweb.proactive.core.util.log.Loggers;
00048 import org.objectweb.proactive.core.util.log.ProActiveLogger;
00049 import org.objectweb.proactive.ext.security.Communication;
00050 import org.objectweb.proactive.ext.security.SecurityContext;
00051 import org.objectweb.proactive.ext.security.crypto.KeyExchangeException;
00052 import org.objectweb.proactive.ext.security.exceptions.RenegotiateSessionException;
00053 import org.objectweb.proactive.ext.security.exceptions.SecurityNotAvailableException;
00054 
00055 
00061 public interface UniversalBodyForwarder {
00062     public static Logger bodyLogger = ProActiveLogger.getLogger(Loggers.BODY);
00063 
00064     public int receiveRequest(UniqueID id, Request request)
00065         throws java.io.IOException, RenegotiateSessionException;
00066 
00067     public int receiveReply(UniqueID id, Reply r) throws java.io.IOException;
00068 
00069     public String getNodeURL(UniqueID id);
00070 
00071     public UniqueID getID(UniqueID id);
00072 
00073     public void updateLocation(UniqueID id, UniqueID uid, UniversalBody body)
00074         throws java.io.IOException;
00075 
00076     public void createShortcut(UniqueID id, Shortcut shortcut)
00077         throws java.io.IOException;
00078 
00079     public BodyAdapter getRemoteAdapter(UniqueID id);
00080 
00081     public void terminate(UniqueID id) throws java.io.IOException;
00082 
00083     public void enableAC(UniqueID id) throws java.io.IOException;
00084 
00085     public void disableAC(UniqueID id) throws java.io.IOException;
00086 
00087     public void setImmediateService(UniqueID id, String methodName)
00088         throws IOException;
00089 
00090     public void setImmediateService(UniqueID id, String methodName,
00091         Class[] parametersTypes) throws IOException;
00092 
00093     public void removeImmediateService(UniqueID id, String methodName,
00094         Class[] parametersTypes) throws IOException;
00095 
00096     // 
00097     // -- SECURITY
00098     //
00099     public X509Certificate getCertificate(UniqueID id)
00100         throws SecurityNotAvailableException, IOException;
00101 
00102     public long startNewSession(UniqueID id, Communication policy)
00103         throws SecurityNotAvailableException, RenegotiateSessionException, 
00104             IOException;
00105 
00106     public PublicKey getPublicKey(UniqueID id)
00107         throws SecurityNotAvailableException, IOException;
00108 
00109     public byte[] randomValue(UniqueID id, long sessionID,
00110         byte[] clientRandomValue)
00111         throws SecurityNotAvailableException, RenegotiateSessionException, 
00112             IOException;
00113 
00114     public byte[][] publicKeyExchange(UniqueID id, long sessionID,
00115         byte[] myPublicKey, byte[] myCertificate, byte[] signature)
00116         throws SecurityNotAvailableException, RenegotiateSessionException, 
00117             KeyExchangeException, IOException;
00118 
00119     public byte[][] secretKeyExchange(UniqueID id, long sessionID,
00120         byte[] encodedAESKey, byte[] encodedIVParameters,
00121         byte[] encodedClientMacKey, byte[] encodedLockData,
00122         byte[] parametersSignature)
00123         throws SecurityNotAvailableException, RenegotiateSessionException, 
00124             IOException;
00125 
00126     public SecurityContext getPolicy(UniqueID id,
00127         SecurityContext securityContext)
00128         throws SecurityNotAvailableException, IOException;
00129 
00130     public byte[] getCertificateEncoded(UniqueID id)
00131         throws SecurityNotAvailableException, IOException;
00132 
00133     public ArrayList getEntities(UniqueID id)
00134         throws SecurityNotAvailableException, IOException;
00135 
00136     public void terminateSession(UniqueID id, long sessionID)
00137         throws SecurityNotAvailableException, IOException;
00138 
00139     // FAULT TOLERANCE
00140     public Object receiveFTMessage(UniqueID id, FTMessage ev)
00141         throws IOException;
00142 
00143     public String getJobID(UniqueID id) throws IOException;
00144 
00145     // Following methods are not in UniversalBody but are needed
00146     public void addNFEListener(UniqueID id, NFEListener listener)
00147         throws java.io.IOException;
00148 
00149     public void removeNFEListener(UniqueID id, NFEListener listener)
00150         throws java.io.IOException;
00151 
00152     public int fireNFE(UniqueID id, NonFunctionalException e)
00153         throws java.io.IOException;
00154 
00155     // These four ones are needed because call is tramsited to the 
00156     // original body *adapter* on the forwarder    
00157     public void changeProxiedBody(UniqueID id, Body newBody)
00158         throws IOException;
00159 
00160     public abstract UniversalBody lookup(UniqueID id, String url)
00161         throws java.io.IOException;
00162 
00163     public abstract void register(UniqueID id, String url)
00164         throws java.io.IOException;
00165 
00166     public abstract void unregister(UniqueID id, String url)
00167         throws java.io.IOException;
00168 }

Generated on Mon Jan 22 15:16:06 2007 for ProActive by  doxygen 1.5.1