Class ShipMessageFactory


  • public class ShipMessageFactory
    extends java.lang.Object
    • Method Detail

      • constructShipMsg

        public static byte[] constructShipMsg​(int messageType,
                                              byte[] messageValue)
      • cmiMsg

        public static byte[] cmiMsg​(byte cmiHead,
                                    byte[] cmiRemainder)
      • smeHelloMsg

        public static byte[] smeHelloMsg​(byte[] smeHelloValue)
      • smeProtMsg

        public static byte[] smeProtMsg​(byte[] smeProtHandshakeValue)
      • smePinMsg

        public static byte[] smePinMsg​(byte[] smePinValue)
      • amiMsg

        public static byte[] amiMsg​(byte[] amiValue)
      • cdeMsg

        public static byte[] cdeMsg​(byte[] cdeValue)
      • connectionCloseMsg

        public static byte[] connectionCloseMsg​(byte[] connCloseMsg)
      • parseSmeHelloBody

        public static byte[] parseSmeHelloBody​(ConnectionHelloPhaseType phaseType,
                                               java.lang.Integer waitForReady,
                                               java.lang.Boolean prolongationReq)
        constructs and returns a SME_HELLO message with the given parameters.
        Parameters:
        phaseType - The sender's phase during the "hello" process (enumeration: pending, ready, aborted)
        waitForReady - remaining wait times granted
        prolongationReq - Request to prolong the remaining wait time
        Returns:
        the complete SME_HELLO message as a byte array
      • parseSmeHelloBody

        public static byte[] parseSmeHelloBody​(HelloMsg s)
        same as the other parseSmeHelloBody but with SmeHello as parameter
        Parameters:
        s - Hello message
        Returns:
        the complete SME_HELLO message as a byte array
      • parseSmeProtHBody

        public static byte[] parseSmeProtHBody​(ProtocolHandshakeTypeType handshakeType,
                                               int major,
                                               int minor,
                                               java.util.List<java.lang.String> formats)
        constructs and returns a SME_PROT_H message with the given parameters
        Parameters:
        handshakeType - The kind of the handshake information (enumeration: announceMax, select).
        major - Version information: Major version part
        minor - Version information: Minor version part.
        formats - Protocol format(s)
        Returns:
        the complete SME_PROT_H message as a byte array
      • parseSmeProtHBody

        public static byte[] parseSmeProtHBody​(ProtocolHandshakeMsg ph)
        same as the other parseSmeProtHBody method but with ProtocolHandshake Object as parameter for ease of use
        Parameters:
        ph - the object to parse
        Returns:
        the complete SME_PROT_H message as a byte array
      • parseSmeProtHErrorBody

        public static byte[] parseSmeProtHErrorBody​(ProtHError error)
      • parseSmePinBody

        public static byte[] parseSmePinBody​(PinMsg pinMsg)
      • parseSmePinBody

        public static byte[] parseSmePinBody​(java.lang.String pin)
      • parseCdeBody

        public static byte[] parseCdeBody​(CDEMsg cdeMsg)
      • parseCdeBody

        public static byte[] parseCdeBody​(java.lang.String header,
                                          java.lang.String payload,
                                          @Nullable
                                          CDEMsg.ExtensionType extType)
      • parseAmiReqBody

        public static byte[] parseAmiReqBody()
      • parseConnectionCloseBody

        public static byte[] parseConnectionCloseBody​(CloseMsg closeMsg)