Class ServerCommand
java.lang.Object
ch.autumo.beetroot.server.message.AbstractMessage
ch.autumo.beetroot.server.message.ServerCommand
- Direct Known Subclasses:
DeleteRequest,DownloadRequest,UploadRequest
Secure server command.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDispatcher ID for internal server-commandsprotected static Stringprotected static intFields inherited from class ch.autumo.beetroot.server.message.AbstractMessage
domain, ENCRYPT, entity, fileId, id, INTERNAL_MSG_PART_SEPARATOR, INTERNAL_MSG_PART_SEPARATOR_REGEXP, LOG, message, MSG_PART_SEPARATOR, MSG_PART_SEPARATOR_REGEXP, object -
Constructor Summary
ConstructorsConstructorDescriptionServerCommand(String dispatcherId, String command) Constructor.ServerCommand(String dispatcherId, String command, String fileId) Constructor.ServerCommand(String dispatcherId, String command, String entity, long id) Constructor.ServerCommand(String dispatcherId, String command, String entity, long id, String domain) Constructor.ServerCommand(String dispatcherId, String command, String fileId, String domain) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidForce message over sockets; so web tunneling will be ignore.Get command.Get dispatcher idDispatcher.getHost()Server host; set by message itself.Get JSON representation; this includes all set information including the additional object if set.getMode()'sockets|web' - 'web' for tunneling, 'web' is not working for internal server commands.intgetPort()Server port; set by message itself.Server name; set by message itself.intTimeout for sending a server command client-side.Get transfer string; this includes all set information including the additional object is set.booleanIs message forced over sockets?static ServerCommandCreate a new server command out of transfer string.static ServerCommandCreate a new server command out of JSON transfer string.protected static voidreInit()Initialize configuration.Methods inherited from class ch.autumo.beetroot.server.message.AbstractMessage
contains, deserializeObject, getData, getDataLength, getDomain, getEntity, getFileId, getId, getJSONObject, getMessageIntValue, getMessageValue, getObject, serializeObject, setEntity, setObject
-
Field Details
-
DISPATCHER_ID_INTERNAL
Dispatcher ID for internal server-commands- See Also:
-
host
-
port
protected static int port
-
-
Constructor Details
-
ServerCommand
Constructor.- Parameters:
dispatcherId- dispatcher IDDispatchercommand- server command
-
ServerCommand
Constructor.- Parameters:
dispatcherId- dispatcher IDDispatchercommand- server commandfileId- unique file ID
-
ServerCommand
Constructor.- Parameters:
dispatcherId- dispatcher IDDispatchercommand- server commandfileId- unique file IDdomain- domain
-
ServerCommand
Constructor.- Parameters:
dispatcherId- dispatcher IDDispatchercommand- server commandentity- entity nameid- unique id
-
ServerCommand
Constructor.- Parameters:
dispatcherId- dispatcher IDDispatchercommand- server commandentity- entity nameid- unique iddomain- domain name
-
-
Method Details
-
reInit
protected static void reInit()Initialize configuration. -
getDispatcherId
Get dispatcher idDispatcher.- Returns:
- dispatcher id
-
getTimeout
public int getTimeout()Timeout for sending a server command client-side.- Returns:
- timeout
-
getMode
'sockets|web' - 'web' for tunneling, 'web' is not working for internal server commands.- Returns:
- mode
-
getHost
Server host; set by message itself.- Returns:
- server host
-
getPort
public int getPort()Server port; set by message itself.- Returns:
- server port
-
getServerName
Server name; set by message itself.- Returns:
- server name
-
getCommand
Get command.- Returns:
- command
-
forceSockets
public void forceSockets()Force message over sockets; so web tunneling will be ignore. -
isForceSockets
public boolean isForceSockets()Is message forced over sockets?- Returns:
- true, if message is forced over sockets
-
getTransferString
Description copied from class:AbstractMessageGet transfer string; this includes all set information including the additional object is set.- Specified by:
getTransferStringin classAbstractMessage- Returns:
- transfer string
- Throws:
IOException- IO exception
-
parse
Create a new server command out of transfer string.- Parameters:
transferString- transfer string- Returns:
- parsed server command
- Throws:
IOException- IO exception
-
getJsonTransferString
Description copied from class:AbstractMessageGet JSON representation; this includes all set information including the additional object if set.- Specified by:
getJsonTransferStringin classAbstractMessage- Returns:
- transfer JSON string
- Throws:
IOException- IO exception
-
parseJson
Create a new server command out of JSON transfer string.- Parameters:
transferString- JSON transferString transfer string- Returns:
- parsed server command
- Throws:
IOException- IO exception
-