Package org.openmuc.jeebus.ship.message
Class ShipMessageFactory
- java.lang.Object
-
- org.openmuc.jeebus.ship.message.ShipMessageFactory
-
public class ShipMessageFactory extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]amiMsg(byte[] amiValue)static byte[]cdeMsg(byte[] cdeValue)static byte[]cmiMsg(byte cmiHead, byte[] cmiRemainder)static byte[]connectionCloseMsg(byte[] connCloseMsg)static byte[]constructShipMsg(int messageType, byte[] messageValue)static byte[]parseAmiBody(java.lang.String id, AccessMethodsMsg.DnsSd_mDns dnsSd_mDns, AccessMethodsMsg.Dns dns)static byte[]parseAmiBody(AccessMethodsMsg amiMsg)static byte[]parseAmiBody(AccessMethodsRequestMsg amiReqMsg)static byte[]parseAmiReqBody()static byte[]parseCdeBody(java.lang.String header, java.lang.String payload, CDEMsg.ExtensionType extType)static byte[]parseCdeBody(CDEMsg cdeMsg)static byte[]parseConnectionCloseBody(CloseMsg closeMsg)static byte[]parseConnectionCloseBody(ConnectionClosePhaseType phase, java.lang.Integer maxTime, ConnectionCloseReasonType reason)static byte[]parseSmeHelloBody(ConnectionHelloPhaseType phaseType, java.lang.Integer waitForReady, java.lang.Boolean prolongationReq)constructs and returns a SME_HELLO message with the given parameters.static byte[]parseSmeHelloBody(HelloMsg s)same as the other parseSmeHelloBody but with SmeHello as parameterstatic byte[]parseSmePinBody(java.lang.String pin)static byte[]parseSmePinBody(PinMsg pinMsg)static byte[]parseSmePinBody(PinStateType pinState, PinInputPermissionType inputPermission)static byte[]parseSmeProtHBody(ProtocolHandshakeMsg ph)same as the other parseSmeProtHBody method but with ProtocolHandshake Object as parameter for ease of usestatic 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 parametersstatic byte[]parseSmeProtHErrorBody(ProtHError error)static byte[]smeHelloMsg(byte[] smeHelloValue)static byte[]smePinMsg(byte[] smePinValue)static byte[]smeProtMsg(byte[] smeProtHandshakeValue)
-
-
-
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 grantedprolongationReq- 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 partminor- 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)
-
parseSmePinBody
public static byte[] parseSmePinBody(PinStateType pinState, @Nullable PinInputPermissionType inputPermission)
-
parseCdeBody
public static byte[] parseCdeBody(CDEMsg cdeMsg)
-
parseCdeBody
public static byte[] parseCdeBody(java.lang.String header, java.lang.String payload, @Nullable CDEMsg.ExtensionType extType)
-
parseAmiBody
public static byte[] parseAmiBody(AccessMethodsRequestMsg amiReqMsg)
-
parseAmiReqBody
public static byte[] parseAmiReqBody()
-
parseAmiBody
public static byte[] parseAmiBody(AccessMethodsMsg amiMsg)
-
parseAmiBody
public static byte[] parseAmiBody(java.lang.String id, @Nullable AccessMethodsMsg.DnsSd_mDns dnsSd_mDns, @Nullable AccessMethodsMsg.Dns dns)
-
parseConnectionCloseBody
public static byte[] parseConnectionCloseBody(CloseMsg closeMsg)
-
parseConnectionCloseBody
public static byte[] parseConnectionCloseBody(ConnectionClosePhaseType phase, @Nullable java.lang.Integer maxTime, @Nullable ConnectionCloseReasonType reason)
-
-