Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Refunding the restart mechanism.
[hpcvm.git] / src / and / hpcvm / ConnectedClient.java
diff --git a/src/and/hpcvm/ConnectedClient.java b/src/and/hpcvm/ConnectedClient.java
new file mode 100644 (file)
index 0000000..a3263dd
--- /dev/null
@@ -0,0 +1,52 @@
+package and.hpcvm;
+
+import java.io.Serializable;
+import java.rmi.RemoteException;
+
+public class ConnectedClient implements Serializable
+{
+       private static final long serialVersionUID = 1L;
+       private ServicesClient stub ;
+       private int timeout ;
+       private Status state ;
+       private String ip ;
+       private String name ;
+       private ComputingClient cl ;
+
+       ConnectedClient( ServicesClient _stub )
+       {
+               stub = _stub ;
+               timeout = 0 ;
+               state = new Status() ;
+               state.setStatus( "connected" ) ;
+               try {
+                       ip = stub.getIPHost() ;
+                       name = stub.getName() ;
+               } catch (RemoteException e) {
+                       e.printStackTrace();
+               }
+               cl = null ;
+       }
+
+       protected ServicesClient getStub() { return stub ; }
+
+       protected void setStub( ServicesClient _stub ) { stub = _stub ; }
+
+       protected int getTimeout() { return timeout ; }
+
+       protected void incTimeout() { timeout++ ; }
+
+       protected void resetTimeout() { timeout = 0 ; }
+
+       protected String getStatus() { return state.getStatus() ; }
+
+       protected void setStatus( String _state ) { state.setStatus( _state ) ; }
+
+       protected String getIP() { return ip ; }
+
+       protected String getName() { return name ; } ;
+
+       protected void setComputingClient( ComputingClient _cl ) { cl = _cl ; }
+
+       protected ComputingClient getComputingClient() { return cl ; } 
+}