Commit 8b709571 authored by Vít Kabele's avatar Vít Kabele

Removed unnecessary public modifiers. Added getters and setters where needed.

parent 1830d6a1
Pipeline #3510 passed with stages
in 3 minutes and 8 seconds
......@@ -111,8 +111,8 @@ final class ConnectionHandler implements Runnable {
off += delivery.getSizes (i);
credentials.instrumentationJars.add (bytes);
}
credentials.processor = RequestProcessor.newInstance (credentials.instrumentationJars);
credentials.state = SessionCredentials.SessionState.READY;
credentials.setProcessor (RequestProcessor.newInstance (credentials.instrumentationJars));
credentials.setState (SessionCredentials.SessionState.READY);
response = ServerMessage
.newBuilder ()
......@@ -136,7 +136,7 @@ final class ConnectionHandler implements Runnable {
response = ServerMessage
.newBuilder ()
.setInstrumentClassResponse (
credentials.processor.process (request.getInstrumentClassRequest ())
credentials.getProcessor ().process (request.getInstrumentClassRequest ())
).build ();
timer.mark (DiSLServer.ElapsedTime.PROCESS);
......@@ -153,8 +153,8 @@ final class ConnectionHandler implements Runnable {
int session_id = request.getSessionId ();
credentials = __server.getSession (session_id);
if(credentials == null) throw new DiSLServerException ("Invalid session id received");
credentials.processor.terminate ();
credentials.state = SessionCredentials.SessionState.CLOSED;
credentials.getProcessor ().terminate ();
credentials.setState(SessionCredentials.SessionState.CLOSED);
case REQUEST_NOT_SET:
default:
break REQUEST_LOOP;
......
......@@ -13,17 +13,17 @@ import java.util.List;
/**
* Pack the values related to one session.
*/
public class SessionCredentials {
class SessionCredentials {
/**
* Session identifier
*/
public final int sessionId;
final int sessionId;
/**
* Available states of the session.
*/
public enum SessionState {
enum SessionState {
/**
* Default
*/
......@@ -46,17 +46,21 @@ public class SessionCredentials {
/**
* State of the session.
*/
public SessionState state = SessionState.INITIALIZED;
private SessionState state = SessionState.INITIALIZED;
void setState(SessionState state){ this.state = state; }
SessionState getState(){ return state; }
/**
* Byte arrays representing files with instrumentation.
*/
List<byte[]> instrumentationJars = new ArrayList<>();
final List<byte[]> instrumentationJars = new ArrayList<>();
/**
* A request processor to handle the instrumentation requests.
*/
RequestProcessor processor;
private RequestProcessor processor;
void setProcessor(RequestProcessor processor){ this.processor = processor; }
RequestProcessor getProcessor(){ return processor; }
/**
* Construct the class
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment