Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,18 @@ FullResponse JoinSps(ISafeguardSessionsConnection spsConnection, String certific
*/
void logOut() throws ObjectDisposedException;

/**
* Returns a character array of the current access token which the caller can pass to other Safeguard
* methods, such as adding cluster members.
*
* @return The current access token.
* @throws ObjectDisposedException Object has already been disposed.
*/
char[] getAccessToken() throws ObjectDisposedException;

/**
* Disposes of the connection.
*
*/
void dispose();

}
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ public ISafeguardEventListener getPersistentEventListener() throws ObjectDispose
return _connection.getPersistentEventListener();
}

@Override
public char[] getAccessToken() throws ObjectDisposedException {
return _connection.getAccessToken();
}

@Override
public void logOut() throws ObjectDisposedException {
_connection.logOut();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -312,4 +312,9 @@ public IStreamingRequest getStreamingRequest() {
return this.streamingRequest;
}

@Override
public char[] getAccessToken() throws ObjectDisposedException {
return authenticationMechanism.getAccessToken();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,9 @@ public void safeguardTestConnection(ISafeguardConnection connection) {
}

try {
char[] token = connection.getAccessToken();
System.out.println(String.format("\tAccess Token: %s", new String(token)));

int remaining = connection.getAccessTokenLifetimeRemaining();
System.out.println(String.format("\tTime remaining: %d", remaining));

Expand Down