Interface VersionNegotiator

All Known Implementing Classes:
StandardVersionNegotiator

public interface VersionNegotiator
  • Method Details

    • getVersion

      int getVersion()
      Returns:
      the currently configured Version of this resource
    • setVersion

      void setVersion(int version) throws IllegalArgumentException
      Sets the version of this resource to the specified version. Only the lower byte of the version is relevant.
      Parameters:
      version - the version to set
      Throws:
      IllegalArgumentException - if the given Version is not supported by this resource, as is indicated by the isVersionSupported(int) method
    • getPreferredVersion

      int getPreferredVersion()
      Returns:
      the Version of this resource that is preferred
    • getPreferredVersion

      Integer getPreferredVersion(int maxVersion)
      Gets the preferred version of this resource that is no greater than the given maxVersion. If no acceptable version exists that is less than maxVersion, then null is returned
      Parameters:
      maxVersion - the maximum version desired
      Returns:
      the preferred version if found; null otherwise
    • isVersionSupported

      boolean isVersionSupported(int version)
      Indicates whether or not the specified version is supported by this resource
      Parameters:
      version - the version to test
      Returns:
      true if supported; false otherwise
    • getSupportedVersions

      List<Integer> getSupportedVersions()