Package org.jboss.as.protocol.mgmt
Class ManagementProtocolHeader
- java.lang.Object
-
- org.jboss.as.protocol.mgmt.ManagementProtocolHeader
-
- Direct Known Subclasses:
ManagementByeByeHeader,ManagementPingHeader,ManagementPongHeader,ManagementRequestHeader,ManagementResponseHeader
public abstract class ManagementProtocolHeader extends Object
ManagementProtocol header used to send the required information to establish a request with a remote controller. The primary pieces of the request are the protocol signature and the protocol version being used.- Author:
- John Bailey, Kabir Khan
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedManagementProtocolHeader(int version)Construct an instance with the protocol version for the header.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected <T extends ManagementProtocolHeader>
Tcast(Class<T> expected)abstract bytegetType()The typeintgetVersion()The protocol version for the current communication.static ManagementProtocolHeaderparse(DataInput input)Parses the input stream to read the headerprotected static voidvalidateSignature(DataInput input)Validate the header signature.voidwrite(DataOutput output)Write the header information to the providedDataOutput.
-
-
-
Method Detail
-
write
public void write(DataOutput output) throws IOException
Write the header information to the providedDataOutput.- Parameters:
output- The output to write to- Throws:
IOException- If any problems occur writing to the output
-
getVersion
public int getVersion()
The protocol version for the current communication.- Returns:
- The protocol version
-
getType
public abstract byte getType()
The type- Returns:
- the protocol byte identifying the type
-
validateSignature
protected static void validateSignature(DataInput input) throws IOException
Validate the header signature.- Parameters:
input- The input to read the signature from- Throws:
IOException- If any read problems occur
-
cast
protected <T extends ManagementProtocolHeader> T cast(Class<T> expected)
-
parse
public static ManagementProtocolHeader parse(DataInput input) throws IOException
Parses the input stream to read the header- Parameters:
input- data input to read from- Returns:
- the parsed protocol header
- Throws:
IOException
-
-