public abstract class IpmiCommandCoder
extends java.lang.Object
Constructor and Description |
---|
IpmiCommandCoder() |
IpmiCommandCoder(IpmiVersion version,
CipherSuite cipherSuite,
AuthenticationType authenticationType) |
Modifier and Type | Method and Description |
---|---|
IpmiMessage |
encodeCommand(int sequenceNumber,
int sessionId)
Prepares an IPMI request message containing class-specific command
|
AuthenticationType |
getAuthenticationType() |
CipherSuite |
getCipherSuite() |
abstract byte |
getCommandCode()
Retrieves command code specific for command represented by this class
|
IpmiVersion |
getIpmiVersion() |
abstract NetworkFunction |
getNetworkFunction()
Retrieves network function specific for command represented by this
class.
|
abstract ResponseData |
getResponseData(IpmiMessage message)
Retrieves command-specific response data from IPMI message
|
boolean |
isCommandResponse(IpmiMessage message)
Checks if given message contains response command specific for this
class.
|
void |
setAuthenticationType(AuthenticationType authenticationType) |
void |
setCipherSuite(CipherSuite cipherSuite) |
void |
setIpmiVersion(IpmiVersion ipmiVersion) |
void |
setSessionParameters(IpmiVersion version,
CipherSuite cipherSuite,
AuthenticationType authenticationType)
Sets session parameters.
|
public IpmiCommandCoder()
public IpmiCommandCoder(IpmiVersion version, CipherSuite cipherSuite, AuthenticationType authenticationType)
public void setIpmiVersion(IpmiVersion ipmiVersion)
public IpmiVersion getIpmiVersion()
public void setAuthenticationType(AuthenticationType authenticationType)
public AuthenticationType getAuthenticationType()
public void setCipherSuite(CipherSuite cipherSuite)
public CipherSuite getCipherSuite()
public void setSessionParameters(IpmiVersion version, CipherSuite cipherSuite, AuthenticationType authenticationType)
version
- - IPMI version of the command.cipherSuite
- - CipherSuite
containing authentication,
confidentiality and integrity algorithms for this session.authenticationType
- - Type of authentication used. Must be RMCPPlus for IPMI v2.0.public IpmiMessage encodeCommand(int sequenceNumber, int sessionId) throws java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
sequenceNumber
- - A generated sequence number used for matching request and
response. If IPMI message is sent in a session, it is used as
a Session Sequence Number. For all IPMI messages,
sequenceNumber % 256 is used as a IPMI LAN Message sequence
number and as an IPMI payload message tag.sessionId
- - ID of the managed system's session message is being sent in.
For sessionless commands should b set to 0.java.security.NoSuchAlgorithmException
- - when authentication, confidentiality or integrity algorithm
fails.java.security.InvalidKeyException
- - when creating of the algorithm key failspublic boolean isCommandResponse(IpmiMessage message)
message
- public abstract byte getCommandCode()
public abstract NetworkFunction getNetworkFunction()
NetworkFunction
public abstract ResponseData getResponseData(IpmiMessage message) throws java.lang.IllegalArgumentException, IPMIException, java.security.NoSuchAlgorithmException, java.security.InvalidKeyException
message
- - IPMI messagejava.lang.IllegalArgumentException
- when message is not a response for class-specific command or
response has invalid length.IPMIException
- when response completion code isn't OK.java.security.NoSuchAlgorithmException
- when authentication, confidentiality or integrity algorithm
fails.java.security.InvalidKeyException
- when creating of the authentication algorithm key fails