Class PayloadCoder

java.lang.Object
org.metricshub.ipmi.core.coding.PayloadCoder
Direct Known Subclasses:
IpmiCommandCoder, SolCoder

public abstract class PayloadCoder extends Object
Base class for IpmiPayload coders, used for encoding pyloads inside IpmiMessages.
  • Constructor Details

  • Method Details

    • setIpmiVersion

      public void setIpmiVersion(IpmiVersion ipmiVersion)
    • getIpmiVersion

      public IpmiVersion getIpmiVersion()
    • setAuthenticationType

      public void setAuthenticationType(AuthenticationType authenticationType)
    • getAuthenticationType

      public AuthenticationType getAuthenticationType()
    • setCipherSuite

      public void setCipherSuite(CipherSuite cipherSuite)
    • getCipherSuite

      public CipherSuite getCipherSuite()
    • setSessionParameters

      public void setSessionParameters(IpmiVersion version, CipherSuite cipherSuite, AuthenticationType authenticationType)
      Sets session parameters.
      Parameters:
      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.
    • encodePayload

      public IpmiMessage encodePayload(int messageSequenceNumber, int sessionSequenceNumber, int sessionId) throws NoSuchAlgorithmException, InvalidKeyException
      Prepares an IPMI request message containing class-specific payload.
      Parameters:
      messageSequenceNumber - - A generated sequence number used for matching request and response. For all IPMI messages, messageSequenceNumber is used as a IPMI LAN Message sequence number and as an IPMI payload message tag.
      sessionSequenceNumber - - If IPMI message is sent in a session, it is used as a Session Sequence Number
      sessionId - - ID of the managed system's session message is being sent in. For sessionless commands should b set to 0.
      Returns:
      IPMI message
      Throws:
      NoSuchAlgorithmException - - when authentication, confidentiality or integrity algorithm fails.
      InvalidKeyException - - when creating of the algorithm key fails
    • getSupportedPayloadType

      public abstract PayloadType getSupportedPayloadType()
    • getResponseData

      public abstract ResponseData getResponseData(IpmiMessage message) throws IPMIException, NoSuchAlgorithmException, InvalidKeyException
      Retrieves payload-specific response data from IPMI message
      Parameters:
      message - - IPMI message
      Returns:
      response data
      Throws:
      IllegalArgumentException - when message is not a response for class-specific command or response has invalid length.
      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