Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Instrument Control
NomadCommandSystem
Commits
45cdc9f3
Commit
45cdc9f3
authored
Jul 15, 2020
by
legoc
Browse files
Client type is passed at login
parent
0dc3988c
Changes
4
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
45cdc9f3
...
...
@@ -61,7 +61,7 @@
<dependency>
<groupId>
fr.ill.ics
</groupId>
<artifactId>
nomadcommandsystem-messages
</artifactId>
<version>
0.0.1
0
</version>
<version>
0.0.1
1
</version>
</dependency>
<dependency>
<groupId>
fr.ill.ics
</groupId>
...
...
src/main/java/fr/ill/ics/bridge/TokenManager.java
View file @
45cdc9f3
...
...
@@ -57,8 +57,8 @@ public class TokenManager {
}
public
void
askForToken
(
String
clientType
)
{
SessionManager
.
getInstance
(
SERVER_ID
).
requestToken
(
clientType
);
public
void
askForToken
()
{
SessionManager
.
getInstance
(
SERVER_ID
).
requestToken
();
}
}
\ No newline at end of file
src/main/java/fr/ill/ics/nscclient/sessionmanagement/ServerSessionManager.java
View file @
45cdc9f3
...
...
@@ -89,7 +89,7 @@ public class ServerSessionManager {
init
();
try
{
SessionManager
.
getInstance
(
serverId
).
login
(
standAlone
,
user
);
SessionManager
.
getInstance
(
serverId
).
login
(
standAlone
,
ConfigManager
.
getInstance
().
getClientType
(),
user
);
}
catch
(
ClientAlreadyLaunchedException
e
)
{
// Only rethrow the exception. The call to logoutAll is made in the main application.
...
...
@@ -125,7 +125,7 @@ public class ServerSessionManager {
ServantManagerAccessor
.
getInstance
(
serverId
).
init
();
try
{
SessionManager
.
getInstance
(
serverId
).
login
(
standAlone
);
SessionManager
.
getInstance
(
serverId
).
login
(
standAlone
,
"tablet"
);
}
catch
(
ClientAlreadyLaunchedException
e
)
{
logoutAll
(
false
);
...
...
src/main/java/fr/ill/ics/nscclient/sessionmanagement/SessionManager.java
View file @
45cdc9f3
...
...
@@ -101,11 +101,11 @@ public class SessionManager {
sessionRequester
.
terminate
();
}
public
void
login
(
boolean
standAlone
)
throws
ClientAlreadyLaunchedException
{
login
(
standAlone
,
null
);
public
void
login
(
boolean
standAlone
,
String
clientType
)
throws
ClientAlreadyLaunchedException
{
login
(
standAlone
,
clientType
,
null
);
}
public
synchronized
void
login
(
boolean
standAlone
,
String
user
)
throws
ClientAlreadyLaunchedException
{
public
synchronized
void
login
(
boolean
standAlone
,
String
clientType
,
String
user
)
throws
ClientAlreadyLaunchedException
{
// Create the message type.
SessionRequests
.
Message
type
=
SessionRequests
.
Message
.
newBuilder
()
...
...
@@ -118,12 +118,14 @@ public class SessionManager {
if
(
user
!=
null
)
{
request
=
SessionRequests
.
LoginRequest
.
newBuilder
()
.
setStandAlone
(
standAlone
)
.
setClientType
(
clientType
)
.
setUser
(
user
)
.
build
();
}
else
{
request
=
SessionRequests
.
LoginRequest
.
newBuilder
()
.
setStandAlone
(
standAlone
)
.
setClientType
(
clientType
)
.
build
();
}
...
...
@@ -170,7 +172,7 @@ public class SessionManager {
}
}
public
synchronized
void
enableRemoteControl
(
String
clientType
)
{
public
synchronized
void
enableRemoteControl
()
{
// Create the message type.
SessionRequests
.
Message
type
=
SessionRequests
.
Message
.
newBuilder
()
...
...
@@ -179,7 +181,6 @@ public class SessionManager {
// Create the request.
SessionRequests
.
RemoteControlRequest
request
=
SessionRequests
.
RemoteControlRequest
.
newBuilder
()
.
setClientType
(
clientType
)
.
setClientID
(
clientId
)
.
setUser
(
getUser
())
.
build
();
...
...
@@ -194,7 +195,7 @@ public class SessionManager {
}
}
public
synchronized
void
disableRemoteControl
(
String
clientType
)
{
public
synchronized
void
disableRemoteControl
()
{
// Create the message type.
SessionRequests
.
Message
type
=
SessionRequests
.
Message
.
newBuilder
()
...
...
@@ -203,7 +204,6 @@ public class SessionManager {
// Create the request.
SessionRequests
.
RemoteControlRequest
request
=
SessionRequests
.
RemoteControlRequest
.
newBuilder
()
.
setClientType
(
clientType
)
.
setClientID
(
clientId
)
.
setUser
(
getUser
())
.
build
();
...
...
@@ -219,7 +219,7 @@ public class SessionManager {
}
public
synchronized
void
requestToken
(
String
clientType
)
{
public
synchronized
void
requestToken
()
{
// Create the message type.
SessionRequests
.
Message
type
=
SessionRequests
.
Message
.
newBuilder
()
...
...
@@ -228,7 +228,6 @@ public class SessionManager {
// Create the request.
SessionRequests
.
GetTokenRequest
request
=
SessionRequests
.
GetTokenRequest
.
newBuilder
()
.
setClientType
(
clientType
)
.
setClientID
(
clientId
)
.
setUser
(
getUser
())
.
build
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment