Class IpmiCommandCoder<R extends ResponseData>
java.lang.Object
org.metricshub.ipmi.core.coding.PayloadCoder
org.metricshub.ipmi.core.coding.commands.IpmiCommandCoder<R>
- Type Parameters:
R- the type of the response data of the command
- Direct Known Subclasses:
ActivatePayload,ChassisControl,ChassisIdentify,CloseSession,DeactivatePayload,GetChannelAuthenticationCapabilities,GetChannelCipherSuites,GetChannelPayloadSupport,GetChassisStatus,GetDeviceId,GetDeviceSdrInfo,GetFruInventoryAreaInfo,GetPayloadActivationStatus,GetPayloadInstanceInfo,GetSdr,GetSdrRepositoryInfo,GetSelEntry,GetSelInfo,GetSelTimeUtcOffset,GetSensorReading,GetSensorReadingFactors,GetSessionInfo,OpenSession,Rakp1,Rakp3,ReadFruData,ReserveSdrRepository,ReserveSel,SendMessage,SetSessionPrivilegeLevel
A wrapper for an IPMI command: encodes its request and decodes its response, of type
R. The session the
command is sent in sets its IPMI version, cipher suite and authentication type
(PayloadCoder.setSessionParameters(IpmiVersion, CipherSuite, AuthenticationType)) when it encodes the request.-
Method Summary
Modifier and TypeMethodDescriptionbooleananswers(IpmiLanMessage reply) Tells whether a reply received under the tag of this request answers it: the same command code, under the response network function of the request (the request one plus one, IPMI 2.0 section 5.1).abstract byteRetrieves command code specific for command represented by this classabstract NetworkFunctionRetrieves network function specific for command represented by this class.intReturns the network function code of the request (6 bits, IPMI 2.0 table 5-1): the code ofgetNetworkFunction()by default.abstract RgetResponseData(IpmiMessage message) Retrieves payload-specific response data from IPMI messagebooleanisCommandResponse(IpmiMessage message) Checks if given message contains response command specific for this class.Methods inherited from class org.metricshub.ipmi.core.coding.PayloadCoder
encodePayload, getAuthenticationType, getCipherSuite, getIpmiVersion, setAuthenticationType, setCipherSuite, setIpmiVersion, setSessionParameters
-
Method Details
-
getSupportedPayloadType
- Specified by:
getSupportedPayloadTypein classPayloadCoder
-
getResponseData
public abstract R getResponseData(IpmiMessage message) throws IPMIException, NoSuchAlgorithmException, InvalidKeyException Description copied from class:PayloadCoderRetrieves payload-specific response data from IPMI message- Specified by:
getResponseDatain classPayloadCoder- Parameters:
message- - IPMI message- Returns:
- response data
- Throws:
IPMIException- when response completion code isn't OK.NoSuchAlgorithmException- when authentication, confidentiality or integrity algorithm fails.InvalidKeyException- when creating of the authentication algorithm key fails
-
isCommandResponse
Checks if given message contains response command specific for this class.- Parameters:
message-IpmiMessagewrapping the IPMI message- Returns:
- True if message contains response command specific for this class, false otherwise.
-
answers
Tells whether a reply received under the tag of this request answers it: the same command code, under the response network function of the request (the request one plus one, IPMI 2.0 section 5.1). The codes are compared as numbers, so that the reply to a request of a network functionNetworkFunctiondoes not list (Transport 0Ch, Group Extension 2Ch, OEM 30h-3Eh) is matched like any other. A reply that does not answer the request (the late reply of an older request that had the same tag) is ignored, and the request keeps waiting.- Parameters:
reply- the IPMI message received under the tag of this request- Returns:
- whether the reply answers this request
-
getCommandCode
public abstract byte getCommandCode()Retrieves command code specific for command represented by this class- Returns:
- command code
-
getNetworkFunction
Retrieves network function specific for command represented by this class.- Returns:
- network function, or null for a command of a network function
NetworkFunctiondoes not list, which overridesgetNetworkFunctionCode()instead - See Also:
-
getNetworkFunctionCode
public int getNetworkFunctionCode()Returns the network function code of the request (6 bits, IPMI 2.0 table 5-1): the code ofgetNetworkFunction()by default. A command of a network functionNetworkFunctiondoes not list (Transport 0Ch, Group Extension 2Ch such as DCMI, OEM/Group 2Eh, controller-specific OEM 30h-3Eh) overrides it and builds its request withIpmiLanRequest(int, byte, byte[], byte): its reply is the one under this code plus one.- Returns:
- the network function code of the request, an even number from 00h to 3Eh
-