Class ControlCommand
- java.lang.Object
-
- com.gurock.smartinspect.packets.Packet
-
- com.gurock.smartinspect.packets.controlcommand.ControlCommand
-
public final class ControlCommand extends Packet
Represents the Control Command packet type which is used for administrative tasks like resetting or clearing the Console.A Control Command is used for several administrative Console tasks. Among other things, this packet type allows you to reset the Console.
This class is not guaranteed to be threadsafe. However, instances of this class will normally only be used in the context of a single thread.
-
-
Field Summary
-
Fields inherited from class com.gurock.smartinspect.packets.Packet
PACKET_HEADER
-
-
Constructor Summary
Constructors Constructor Description ControlCommand()Overloaded.ControlCommand(ControlCommandType controlCommandType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ControlCommandTypegetControlCommandType()Returns the type of this Control Command.byte[]getData()Returns the optional data block of the Control Command.PacketTypegetPacketType()Overridden.intgetSize()Overridden.voidsetControlCommandType(ControlCommandType controlCommandType)Sets the type of this Control Command.voidsetData(byte[] data)Sets the optional data block of the Control Command.-
Methods inherited from class com.gurock.smartinspect.packets.Packet
getBytes, getLevel, getStringSize, getThreadId, isThreadSafe, lock, setBytes, setLevel, setThreadSafe, unlock
-
-
-
-
Constructor Detail
-
ControlCommand
public ControlCommand()
Overloaded. Creates and initializes a ControlCommand instance.
-
ControlCommand
public ControlCommand(ControlCommandType controlCommandType)
-
-
Method Detail
-
getSize
public int getSize()
Overridden. Returns the total occupied memory size of this Control Command packet. The total occupied memory size of this Control Command is the size of memory occupied the optional data block and any internal data structures of this Control Command.
-
getPacketType
public PacketType getPacketType()
Overridden. Returns PacketType.ControlCommand.- Specified by:
getPacketTypein classPacket- Returns:
- PacketType.ControlCommand. For a complete list of available packet types, please have a look at the documentation of the PacketType type.
-
getControlCommandType
public ControlCommandType getControlCommandType()
Returns the type of this Control Command.The type of the Control Command describes the way the Console interprets this packet. Please see the ControlCommandType type for more information.
- Returns:
- The type of this Control Command packet.
-
setControlCommandType
public void setControlCommandType(ControlCommandType controlCommandType)
Sets the type of this Control Command.The type of the Control Command describes the way the Console interprets this packet. Please see the ControlCommandType type for more information.
If the controlCommandType argument is a null reference a NullPointerException will be thrown.
- Parameters:
controlCommandType- The new type of this Control Command packet. Not allowed to be null.- Throws:
NullPointerException- if the controlCommandType argument is null.
-
getData
public byte[] getData()
Returns the optional data block of the Control Command.This method can return null if this Control Command does not contain additional data.
Important: Treat the returned array as read-only. This means, modifying this array in any way is not supported.
- Returns:
- The optional data block of the Control Command or null if this Control Command does not contain additional data.
-
setData
public void setData(byte[] data)
Sets the optional data block of the Control Command.Because of the fact that the data block of a Control Command is optional, it is allowed to pass a null reference. Important: Treat the passed array as read-only. This means, modifying this array in any way after passing it to this method is not supported.
- Parameters:
data- The new data block of this Control Command. Can be null.
-
-