Enum Class SCMPVersion

java.lang.Object
java.lang.Enum<SCMPVersion>
org.serviceconnector.scmp.SCMPVersion
All Implemented Interfaces:
Serializable, Comparable<SCMPVersion>, Constable, IReversibleEnum<String,SCMPVersion>

public enum SCMPVersion extends Enum<SCMPVersion> implements IReversibleEnum<String,SCMPVersion>
Provides actual SCMP version and method to check compatibility. The SCMP version schema follows this philosophy
        9.9 (E.g. 2.4)
| |
| +-- version number
+-- release number

Release number designates the major release (design) of the protocol. It starts at 1 and is incremented by 1. New protocol is by definition not compatible with the old one. E.g. if the release number is not the same an error occurs.

Version number designates the minor improvements of the protocol. It starts at 0 and is incremented by 1. New versions may contain additional features and are compatible. E.g. 2.(x+1) is compatible with V2.(x) but not the other way round.

Handling of the SCMP Version in a network hierarchy works according to the following rules and restrictions. The components supporting a SCMP Version have to follow the top down restrictions. This means the requester is able to connect to components supporting equal or higher protocol version. In other words server and SC on level zero have to support equal or higher SCMP Version than connecting clients. Clients and Proxies may connect using older versions.

In the context of a session service request the server has to respond with protocol version given in the request. Protocol version is received from the client and nowhere changes for the whole communication flow. In the context of a publish service the server has to publish messages with protocol version compatible to the clients version (lowest version in field). For example the server supports SCMP Version 1.3 and connected clients version 1.2 the server has to publish with version 1.2. Otherwise clients are not able to receive messages. Fault messages from the SC to the server may have version 1.2 even if SC and Server support 1.3. This happens because supported protocol version number of the server is unknown for the SC. In conclusion components supporting an SCMP Version have to implement the matching rules and version logic properly in any case.
See the SC_0_SCMP_E.PDF for more details.

Author:
JTraber
  • Enum Constant Details

    • CURRENT

      public static final SCMPVersion CURRENT
      1.3, the current version.
    • LOWEST

      public static final SCMPVersion LOWEST
      1.2, old version, correlates to lowest requester version in field.
    • TEST

      public static final SCMPVersion TEST
      3.2, the version to make tests - DO NOT CHANGE !
    • UNDEFINED

      public static final SCMPVersion UNDEFINED
      The UNDEFINED SCMP Version.
  • Method Details

    • values

      public static SCMPVersion[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SCMPVersion valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isSupported

      public void isSupported(byte[] buffer) throws SCMPValidatorException
      Checks if is supported.
      Parameters:
      buffer - the buffer containing the version number
      Throws:
      SCMPValidatorException - the SCMP validation exception
    • getSCMPVersionByByteArray

      public static SCMPVersion getSCMPVersionByByteArray(byte[] versionBuffer)
      Gets the sCMP version by byte array.
      Parameters:
      versionBuffer - the version buffer
      Returns:
      the sCMP version by byte array
    • getVersionNumber

      public byte getVersionNumber()
      Gets the version number.
      Returns:
      the version number
    • getReleaseNumber

      public byte getReleaseNumber()
      Gets the release number.
      Returns:
      the release number
    • getValue

      public String getValue()
      Return the value/code of the enum constant.
      Specified by:
      getValue in interface IReversibleEnum<String,SCMPVersion>
      Returns:
      value
    • reverse

      public SCMPVersion reverse(String buffer)
      Get the Enum constant by looking up the code in the reverse enum map. *
      Specified by:
      reverse in interface IReversibleEnum<String,SCMPVersion>
      Parameters:
      buffer - the code
      Returns:
      V - The enum constant
    • toString

      public String toString()
      Overrides:
      toString in class Enum<SCMPVersion>