Package org.apache.nifi.remote
Class StandardVersionNegotiator
java.lang.Object
org.apache.nifi.remote.StandardVersionNegotiator
- All Implemented Interfaces:
VersionNegotiator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPreferredVersion(int maxVersion) Gets the preferred version of this resource that is no greater than the given maxVersion.intbooleanisVersionSupported(int version) Indicates whether or not the specified version is supported by this resourcevoidsetVersion(int version) Sets the version of this resource to the specified version.
-
Field Details
-
versions
-
curVersion
private int curVersion
-
-
Constructor Details
-
StandardVersionNegotiator
public StandardVersionNegotiator(int... supportedVersions)
-
-
Method Details
-
getVersion
public int getVersion()- Specified by:
getVersionin interfaceVersionNegotiator- Returns:
- the currently configured Version of this resource
-
setVersion
Description copied from interface:VersionNegotiatorSets the version of this resource to the specified version. Only the lower byte of the version is relevant.- Specified by:
setVersionin interfaceVersionNegotiator- Parameters:
version- the version to set- Throws:
IllegalArgumentException- if the given Version is not supported by this resource, as is indicated by theVersionNegotiator.isVersionSupported(int)method
-
getPreferredVersion
public int getPreferredVersion()- Specified by:
getPreferredVersionin interfaceVersionNegotiator- Returns:
- the Version of this resource that is preferred
-
getPreferredVersion
Description copied from interface:VersionNegotiatorGets the preferred version of this resource that is no greater than the given maxVersion. If no acceptable version exists that is less thanmaxVersion, thennullis returned- Specified by:
getPreferredVersionin interfaceVersionNegotiator- Parameters:
maxVersion- the maximum version desired- Returns:
- the preferred version if found; null otherwise
-
isVersionSupported
public boolean isVersionSupported(int version) Description copied from interface:VersionNegotiatorIndicates whether or not the specified version is supported by this resource- Specified by:
isVersionSupportedin interfaceVersionNegotiator- Parameters:
version- the version to test- Returns:
- true if supported; false otherwise
-
getSupportedVersions
- Specified by:
getSupportedVersionsin interfaceVersionNegotiator
-