Class StandardVersionNegotiator

java.lang.Object
org.apache.nifi.remote.StandardVersionNegotiator
All Implemented Interfaces:
VersionNegotiator

public class StandardVersionNegotiator extends Object implements VersionNegotiator
  • Field Details

    • versions

      private final List<Integer> versions
    • curVersion

      private int curVersion
  • Constructor Details

    • StandardVersionNegotiator

      public StandardVersionNegotiator(int... supportedVersions)
  • Method Details

    • getVersion

      public int getVersion()
      Specified by:
      getVersion in interface VersionNegotiator
      Returns:
      the currently configured Version of this resource
    • setVersion

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

      public int getPreferredVersion()
      Specified by:
      getPreferredVersion in interface VersionNegotiator
      Returns:
      the Version of this resource that is preferred
    • getPreferredVersion

      public Integer getPreferredVersion(int maxVersion)
      Description copied from interface: VersionNegotiator
      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
      Specified by:
      getPreferredVersion in interface VersionNegotiator
      Parameters:
      maxVersion - the maximum version desired
      Returns:
      the preferred version if found; null otherwise
    • isVersionSupported

      public boolean isVersionSupported(int version)
      Description copied from interface: VersionNegotiator
      Indicates whether or not the specified version is supported by this resource
      Specified by:
      isVersionSupported in interface VersionNegotiator
      Parameters:
      version - the version to test
      Returns:
      true if supported; false otherwise
    • getSupportedVersions

      public List<Integer> getSupportedVersions()
      Specified by:
      getSupportedVersions in interface VersionNegotiator