X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/hpcvm.git/blobdiff_plain/d83793da6e881ebab006a50a47fbba914e65f9cf..f74ee61df3fbc8cf8371347069a715270a3e8a72:/src/and/hpcvm/ConnectedClient.java diff --git a/src/and/hpcvm/ConnectedClient.java b/src/and/hpcvm/ConnectedClient.java new file mode 100644 index 0000000..a3263dd --- /dev/null +++ b/src/and/hpcvm/ConnectedClient.java @@ -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 ; } +}