Package gda.jython
Interface IBatonStateProvider
- All Known Implementing Classes:
BatonStateProviderBean,JythonServerFacade,MockJythonServerFacade
public interface IBatonStateProvider
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBatonChangedObserver(gda.observable.IObserver anObserver) booleanChecks if the caller is the holder of the batonvoidassignBaton(int receiverIndex, int currentBatonHolderIndex) voidchangeVisitID(String visitID) Switches the visit this client will collect data as when it holds the baton.voiddeleteBatonChangedObserver(gda.observable.IObserver anObserver) Returns the baton holder from the list of known clients connected, even if the baton holder is this client.Returns previous messages sent during this visit.Returns the current ClientDetails for this client.booleanThis checks if the baton is held, at all, by any client.booleanvoidvoidReverts to the original user this client was initially logged in as.voidsendMessage(String message) Broadcast a message to other users on this beamline.booleanswitchUser(String username, String password) void
-
Method Details
-
isBatonHeld
boolean isBatonHeld()This checks if the baton is held, at all, by any client. It does not check it the caller is the baton holder.- Returns:
trueif the baton is held by any client,falseotherwise- See Also:
-
addBatonChangedObserver
void addBatonChangedObserver(gda.observable.IObserver anObserver) - Parameters:
anObserver-
-
deleteBatonChangedObserver
void deleteBatonChangedObserver(gda.observable.IObserver anObserver) - Parameters:
anObserver-
-
amIBatonHolder
boolean amIBatonHolder()Checks if the caller is the holder of the baton- Returns:
trueif the caller holds the batonfalseotherwise- See Also:
-
getBatonHolder
ClientDetails getBatonHolder()Returns the baton holder from the list of known clients connected, even if the baton holder is this client.- Returns:
- ClientDetails
-
returnBaton
void returnBaton()- See Also:
-
requestBaton
boolean requestBaton()- Returns:
- boolean
- See Also:
-
assignBaton
void assignBaton(int receiverIndex, int currentBatonHolderIndex) - Parameters:
receiverIndex-currentBatonHolderIndex-- See Also:
-
getOtherClientInformation
ClientDetails[] getOtherClientInformation()- Returns:
- ClientDetails[]
- See Also:
-
getMyDetails
ClientDetails getMyDetails()Returns the current ClientDetails for this client. What is returned will change depending on the baton status and if the user has been switched using the switchUser method.The authorisationLevel returned takes into account any alternate user, but not whether the baton is held. For this, call getAuthorisationLevel().
- Returns:
- ClientDetails
-
update
- Parameters:
dataSource-data-
-
revertToOriginalUser
void revertToOriginalUser()Reverts to the original user this client was initially logged in as.- See Also:
-
changeVisitID
Switches the visit this client will collect data as when it holds the baton.- Parameters:
visitID-
-
sendMessage
Broadcast a message to other users on this beamline. Such messages will be displayed in a special viewer.- Parameters:
message-
-
getMessageHistory
List<UserMessage> getMessageHistory()Returns previous messages sent during this visit. -
switchUser
- Parameters:
username-password-- Returns:
- true if switch successful
- See Also:
-