KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > body > ibis > IbisRemoteBody


1 /*
2 * ################################################################
3 *
4 * ProActive: The Java(TM) library for Parallel, Distributed,
5 * Concurrent computing with Security and Mobility
6 *
7 * Copyright (C) 1997-2002 INRIA/University of Nice-Sophia Antipolis
8 * Contact: proactive-support@inria.fr
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
24 *
25 * Initial developer(s): The ProActive Team
26 * http://www.inria.fr/oasis/ProActive/contacts.html
27 * Contributor(s):
28 *
29 * ################################################################
30 */

31 package org.objectweb.proactive.core.body.ibis;
32
33 import java.io.IOException JavaDoc;
34 import java.security.PublicKey JavaDoc;
35 import java.security.cert.X509Certificate JavaDoc;
36 import java.util.ArrayList JavaDoc;
37
38 import org.objectweb.proactive.core.UniqueID;
39 import org.objectweb.proactive.core.body.UniversalBody;
40 import org.objectweb.proactive.core.body.reply.Reply;
41 import org.objectweb.proactive.core.body.request.Request;
42 import org.objectweb.proactive.ext.security.Communication;
43 import org.objectweb.proactive.ext.security.CommunicationForbiddenException;
44 import org.objectweb.proactive.ext.security.Policy;
45 import org.objectweb.proactive.ext.security.ProActiveSecurityManager;
46 import org.objectweb.proactive.ext.security.RenegotiateSessionException;
47 import org.objectweb.proactive.ext.security.SecurityContext;
48 import org.objectweb.proactive.ext.security.SecurityNotAvailableException;
49 import org.objectweb.proactive.ext.security.crypto.AuthenticationException;
50 import org.objectweb.proactive.ext.security.crypto.ConfidentialityTicket;
51 import org.objectweb.proactive.ext.security.crypto.KeyExchangeException;
52
53
54 /**
55  * An object implementing this interface provides the minimum service a body offers
56  * remotely. This interface is the glue with the RMI Remote interface that allow the
57  * body to be accessed remotely.
58  *
59  * @author ProActive Team
60  * @version 1.0, 2001/10/23
61  * @since ProActive 0.9
62  * @see ibis.rmi.Remote
63  * @see org.objectweb.proactive.core.body.UniversalBody
64  */

65 public interface IbisRemoteBody extends ibis.rmi.Remote {
66
67     /**
68      * Receives a request for later processing. The call to this method is non blocking
69      * unless the body cannot temporary receive the request.
70      * @param request the request to process
71      * @exception java.io.IOException if the request cannot be accepted
72      */

73     public void receiveRequest(Request r) throws java.io.IOException JavaDoc,RenegotiateSessionException;
74
75     /**
76      * Receives a reply in response to a former request.
77      * @param reply the reply received
78      * @exception java.io.IOException if the reply cannot be accepted
79      */

80     public void receiveReply(Reply r) throws java.io.IOException JavaDoc;
81
82     /**
83      * Returns the url of the node this body is associated to
84      * The url of the node can change if the active object migrates
85      * @exception ibi.rmi.RemoteException if an exception occured during the remote communication
86      * @return the url of the node this body is associated to
87      */

88     public String JavaDoc getNodeURL() throws ibis.rmi.RemoteException;
89
90     /**
91      * Returns the UniqueID of this body
92      * This identifier is unique accross all JVMs
93      * @return the UniqueID of this body
94      * @exception ibi.rmi.RemoteException if an exception occured during the remote communication
95      */

96     public UniqueID getID() throws ibis.rmi.RemoteException;
97
98     /**
99      * Signals to this body that the body identified by id is now to a new
100      * remote location. The body given in parameter is a new stub pointing
101      * to this new location. This call is a way for a body to signal to his
102      * peer that it has migrated to a new location
103      * @param id the id of the body
104      * @param body the stub to the new location
105      * @exception java.io.IOException if an exception occured during the remote communication
106      */

107     public void updateLocation(UniqueID id, UniversalBody body)
108         throws java.io.IOException JavaDoc;
109
110     /**
111      * Enables automatic continuation mechanism for this body
112      */

113     public void enableAC() throws java.io.IOException JavaDoc;
114
115     /**
116      * Disables automatic continuation mechanism for this body
117      */

118     public void disableAC() throws java.io.IOException JavaDoc;
119
120     /**
121      * For setting an immediate service for this body.
122      * An immediate service is a method that will bw excecuted by the calling thread.
123      */

124     public void setImmediateService(String JavaDoc methodName)
125         throws java.io.IOException JavaDoc;
126
127     // SECURITY
128
public void initiateSession(int type,UniversalBody body)
129            throws java.io.IOException JavaDoc, CommunicationForbiddenException,
130                AuthenticationException, RenegotiateSessionException,
131                SecurityNotAvailableException;
132
133        public void terminateSession(long sessionID)
134            throws java.io.IOException JavaDoc, SecurityNotAvailableException;
135
136        public X509Certificate JavaDoc getCertificate()
137            throws java.io.IOException JavaDoc, SecurityNotAvailableException;
138
139        public ProActiveSecurityManager getProActiveSecurityManager()
140            throws java.io.IOException JavaDoc, SecurityNotAvailableException;
141
142        public Policy getPolicyFrom(X509Certificate JavaDoc certificate)
143            throws java.io.IOException JavaDoc, SecurityNotAvailableException;
144
145        public long startNewSession(Communication policy)
146            throws java.io.IOException JavaDoc, RenegotiateSessionException,
147                SecurityNotAvailableException;
148
149        public ConfidentialityTicket negociateKeyReceiverSide(
150            ConfidentialityTicket confidentialityTicket, long sessionID)
151            throws java.io.IOException JavaDoc, KeyExchangeException,
152                SecurityNotAvailableException;
153
154        public PublicKey JavaDoc getPublicKey()
155            throws IOException JavaDoc, SecurityNotAvailableException;
156
157        public byte[] randomValue(long sessionID, byte[] cl_rand)
158            throws Exception JavaDoc, SecurityNotAvailableException;
159
160        public byte[][] publicKeyExchange(long sessionID,
161            UniversalBody distantBody, byte[] my_pub, byte[] my_cert,
162            byte[] sig_code) throws Exception JavaDoc, SecurityNotAvailableException;
163
164        public byte[][] secretKeyExchange(long sessionID, byte[] tmp, byte[] tmp1,
165            byte[] tmp2, byte[] tmp3, byte[] tmp4)
166            throws Exception JavaDoc, SecurityNotAvailableException;
167
168        public Communication getPolicyTo(String JavaDoc type, String JavaDoc from, String JavaDoc to)
169            throws java.io.IOException JavaDoc, SecurityNotAvailableException;
170
171        public SecurityContext getPolicy(SecurityContext securityContext)
172            throws IOException JavaDoc, SecurityNotAvailableException;
173
174
175
176        /**
177         * @return virtual node name where the object has been created
178         */

179        public String JavaDoc getVNName()
180            throws java.io.IOException JavaDoc, SecurityNotAvailableException;
181
182        /**
183         * @return object certificate as byte array
184         */

185        public byte[] getCertificateEncoded()
186            throws java.io.IOException JavaDoc, SecurityNotAvailableException;
187            
188     public ArrayList JavaDoc getEntities() throws SecurityNotAvailableException, IOException JavaDoc ;
189
190 }
191
Popular Tags