Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Refunding the restart mechanism.
[hpcvm.git] / src / and / hpcvm / ConnectedClient.java
1 package and.hpcvm;
2
3 import java.io.Serializable;
4 import java.rmi.RemoteException;
5
6 public class ConnectedClient implements Serializable
7 {
8         private static final long serialVersionUID = 1L;
9         private ServicesClient stub ;
10         private int timeout ;
11         private Status state ;
12         private String ip ;
13         private String name ;
14         private ComputingClient cl ;
15
16         ConnectedClient( ServicesClient _stub )
17         {
18                 stub = _stub ;
19                 timeout = 0 ;
20                 state = new Status() ;
21                 state.setStatus( "connected" ) ;
22                 try {
23                         ip = stub.getIPHost() ;
24                         name = stub.getName() ;
25                 } catch (RemoteException e) {
26                         e.printStackTrace();
27                 }
28                 cl = null ;
29         }
30
31         protected ServicesClient getStub() { return stub ; }
32
33         protected void setStub( ServicesClient _stub ) { stub = _stub ; }
34
35         protected int getTimeout() { return timeout ; }
36
37         protected void incTimeout() { timeout++ ; }
38
39         protected void resetTimeout() { timeout = 0 ; }
40
41         protected String getStatus() { return state.getStatus() ; }
42
43         protected void setStatus( String _state ) { state.setStatus( _state ) ; }
44
45         protected String getIP() { return ip ; }
46
47         protected String getName() { return name ; } ;
48
49         protected void setComputingClient( ComputingClient _cl ) { cl = _cl ; }
50
51         protected ComputingClient getComputingClient() { return cl ; } 
52 }