Commit d68fd701 authored by helene ortiz's avatar helene ortiz
Browse files

rename sender => user. remove user parameter in calls to SessionManager

methods as it is stored in it
parent 22319fc7
......@@ -22,7 +22,6 @@ import fr.ill.ics.bridge.command.CommandZoneWrapper;
import fr.ill.ics.bridge.events.TokenEvent;
import fr.ill.ics.bridge.events.TokenEvent.TokenServerState;
import fr.ill.ics.nscclient.sessionmanagement.SessionManager;
import fr.ill.ics.util.ConfigManager;
/**
*
......@@ -54,12 +53,12 @@ public class TokenManager {
public void freeToken() {
SessionManager.getInstance(SERVER_ID).releaseToken(SessionManager.getInstance(SERVER_ID).getSender());
SessionManager.getInstance(SERVER_ID).releaseToken();
}
public void askForToken(String clientType) {
SessionManager.getInstance(SERVER_ID).requestToken(clientType, SessionManager.getInstance(SERVER_ID).getSender());
SessionManager.getInstance(SERVER_ID).requestToken(clientType);
}
}
\ No newline at end of file
......@@ -39,12 +39,12 @@ public class SessionManager {
private int clientId = 0;
// If remote access
private String userName;
private String remoteUserName;
private String password;
private String instrumentName;
private String sender = null;
private String user = null;
private static Map<String, SessionManager> instances = new HashMap<String, SessionManager>();
......@@ -169,7 +169,7 @@ public class SessionManager {
}
}
public void enableRemoteControl(String clientType, String user) {
public void enableRemoteControl(String clientType) {
// Create the message type.
SessionRequests.Message type = SessionRequests.Message.newBuilder()
......@@ -193,7 +193,7 @@ public class SessionManager {
}
}
public void disableRemoteControl(String clientType, String user) {
public void disableRemoteControl(String clientType) {
// Create the message type.
SessionRequests.Message type = SessionRequests.Message.newBuilder()
......@@ -218,7 +218,7 @@ public class SessionManager {
}
public void requestToken(String clientType, String user) {
public void requestToken(String clientType) {
// Create the message type.
SessionRequests.Message type = SessionRequests.Message.newBuilder()
......@@ -242,7 +242,7 @@ public class SessionManager {
}
}
public void releaseToken(String user) {
public void releaseToken() {
// Create the message type.
SessionRequests.Message type = SessionRequests.Message.newBuilder()
......@@ -319,7 +319,7 @@ public class SessionManager {
}
public void setSessionInformation(String userName, String password, String instrumentName) {
this.userName = userName;
this.remoteUserName = userName;
this.password = password;
this.instrumentName = instrumentName;
}
......@@ -331,19 +331,19 @@ public class SessionManager {
public String getUserName() {
return userName;
return remoteUserName;
}
public String getSender() {
if (sender == null) {
public String getUser() {
if (user == null) {
if (ConfigManager.getInstance().isRemoteClient()) {
sender = getUserName();
user = getUserName();
} else {
sender = getInstrumentName();
user = getInstrumentName();
}
}
return sender;
return user;
}
}
\ No newline at end of file
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