Package velox.api.layer1
Interface Layer1ApiAdminAdapter
- All Superinterfaces:
Layer1ApiAdminListener
- All Known Subinterfaces:
Layer1ApiAdapter
Provides default empty implementations.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonConnectionLost(DisconnectionReason reason, String message) Connection to server lost.default voidConnection to server restored.default voidonLoginFailed(LoginFailedReason reason, String message) Failed to log in with specified credentialsdefault voidSuccessful login.default voidonSystemTextMessage(String message, SystemTextMessageType messageType) Passes the message into Bookmap and shows it as a popup.default voidonUserMessage(Object data) Send an upstream event.
-
Method Details
-
onLoginFailed
Description copied from interface:Layer1ApiAdminListenerFailed to log in with specified credentials- Specified by:
onLoginFailedin interfaceLayer1ApiAdminListener- Parameters:
reason- Reason codemessage- test message associated with login fail
-
onLoginSuccessful
default void onLoginSuccessful()Description copied from interface:Layer1ApiAdminListenerSuccessful login.- Specified by:
onLoginSuccessfulin interfaceLayer1ApiAdminListener
-
onConnectionLost
Description copied from interface:Layer1ApiAdminListenerConnection to server lost. Provider can call this method multiple times in sequence if the reason was changed (i.e. fromDisconnectionReason.NO_INTERNETtoDisconnectionReason.FATAL)- Specified by:
onConnectionLostin interfaceLayer1ApiAdminListener- Parameters:
reason- Reason codemessage- text message associated with login disconnection
-
onConnectionRestored
default void onConnectionRestored()Description copied from interface:Layer1ApiAdminListenerConnection to server restored. A provider should call it only if it previously invokedLayer1ApiAdminListener.onConnectionLost(DisconnectionReason, String)- Specified by:
onConnectionRestoredin interfaceLayer1ApiAdminListener
-
onSystemTextMessage
Description copied from interface:Layer1ApiAdminListenerPasses the message into Bookmap and shows it as a popup. It is suitable for 1-time notifications, but for the general case take a look at the notifications API -Layer1ApiSoundAlertMessage- Specified by:
onSystemTextMessagein interfaceLayer1ApiAdminListener- Parameters:
message- message itselfmessageType- message type- See Also:
-
onUserMessage
Description copied from interface:Layer1ApiAdminListenerSend an upstream event. Allows incorporating arbitrary functionality into protocol.This is the extension point of the upstream direction: any layer or the provider may emit an arbitrary object, and it travels towards the GUI through every layer above the origin. The counterpart for the downstream direction is
Layer1ApiAdminProvider.sendUserMessage(Object).Contract for layers: inspect the message by type, act on the ones you understand and pass every other message on unchanged. Swallowing an unknown message breaks layers above you.
Messages emitted by Bookmap use classes from
velox.api.layer1.messages. Some of them are sent in response to a downstream request and arrive asynchronously, after the correspondingsendUserMessagecall has already returned.- Specified by:
onUserMessagein interfaceLayer1ApiAdminListener- Parameters:
data- Message content, never null
-