KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > proactive > core > body > rmi > RemoteBody


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

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

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

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

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

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

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

116     public void enableAC() throws java.io.IOException JavaDoc;
117
118     /**
119      * Disables automatic continuation mechanism for this body
120      */

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

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

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

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