Package velox.api.layer1.messages.plugin
Record Class AvailablePluginsRequest
java.lang.Object
java.lang.Record
velox.api.layer1.messages.plugin.AvailablePluginsRequest
- Record Components:
pluginLayer- plugin layer to querycallback- callback that receives matchingqualifiersor an issuecacheMode- mode used to retrieve plugin catalog informationtargetGroup- group of plugins to include
- All Implemented Interfaces:
BmDownMessage<AvailablePluginsRequest,Awaitable>
@DefaultQualifier(org.checkerframework.checker.nullness.qual.NonNull.class)
public record AvailablePluginsRequest(PluginLayer pluginLayer, AvailablePluginsRequest.Callback callback, AvailablePluginsRequest.CacheMode cacheMode, AvailablePluginsRequest.TargetGroup targetGroup)
extends Record
implements BmDownMessage<AvailablePluginsRequest,Awaitable>
Request to get plugin
qualifiers for the specified PluginLayer
and AvailablePluginsRequest.TargetGroup. They are returned asynchronously through AvailablePluginsRequest.Callback.
The returned Awaitable can be used to wait until the request has been processed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDetermines how plugin catalog information is retrieved.static interfaceReceives the asynchronous result of anAvailablePluginsRequest.static interfaceDescribes why anAvailablePluginsRequestcould not be processed.static enumDefines which plugins are included in the result. -
Constructor Summary
ConstructorsConstructorDescriptionAvailablePluginsRequest(PluginLayer pluginLayer, AvailablePluginsRequest.Callback callback, AvailablePluginsRequest.CacheMode cacheMode, AvailablePluginsRequest.TargetGroup targetGroup) Creates an instance of aAvailablePluginsRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecacheModerecord component.callback()Returns the value of thecallbackrecord component.final booleanIndicates whether some other object is "equal to" this one.static AvailablePluginsRequestfresh(PluginLayer pluginLayer, AvailablePluginsRequest.TargetGroup targetGroup, AvailablePluginsRequest.Callback callback) Creates a request that retrieves current plugin information from the server for catalog-based target groups.static AvailablePluginsRequestfreshIfNoCache(PluginLayer pluginLayer, AvailablePluginsRequest.TargetGroup targetGroup, AvailablePluginsRequest.Callback callback) Creates a request that uses cached plugin information when available and retrieves it from the server otherwise for catalog-based target groups.static AvailablePluginsRequestfromCache(PluginLayer pluginLayer, AvailablePluginsRequest.TargetGroup targetGroup, AvailablePluginsRequest.Callback callback) Creates a request that uses cached plugin information only.final inthashCode()Returns a hash code value for this object.Returns the value of thepluginLayerrecord component.Returns the value of thetargetGrouprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
AvailablePluginsRequest
public AvailablePluginsRequest(PluginLayer pluginLayer, AvailablePluginsRequest.Callback callback, AvailablePluginsRequest.CacheMode cacheMode, AvailablePluginsRequest.TargetGroup targetGroup) Creates an instance of aAvailablePluginsRequestrecord class.- Parameters:
pluginLayer- the value for thepluginLayerrecord componentcallback- the value for thecallbackrecord componentcacheMode- the value for thecacheModerecord componenttargetGroup- the value for thetargetGrouprecord component
-
-
Method Details
-
fromCache
public static AvailablePluginsRequest fromCache(PluginLayer pluginLayer, AvailablePluginsRequest.TargetGroup targetGroup, AvailablePluginsRequest.Callback callback) Creates a request that uses cached plugin information only.For catalog-based target groups, if the cache is empty, the request succeeds with an empty list.
- Parameters:
pluginLayer- plugin layer to querytargetGroup- group of plugins to includecallback- callback that receives matchingqualifiersor an issue- Returns:
- request using
AvailablePluginsRequest.CacheMode.FROM_CACHE
-
fresh
public static AvailablePluginsRequest fresh(PluginLayer pluginLayer, AvailablePluginsRequest.TargetGroup targetGroup, AvailablePluginsRequest.Callback callback) Creates a request that retrieves current plugin information from the server for catalog-based target groups.- Parameters:
pluginLayer- plugin layer to querytargetGroup- group of plugins to includecallback- callback that receives matchingqualifiersor an issue- Returns:
- request using
AvailablePluginsRequest.CacheMode.FRESH
-
freshIfNoCache
public static AvailablePluginsRequest freshIfNoCache(PluginLayer pluginLayer, AvailablePluginsRequest.TargetGroup targetGroup, AvailablePluginsRequest.Callback callback) Creates a request that uses cached plugin information when available and retrieves it from the server otherwise for catalog-based target groups.- Parameters:
pluginLayer- plugin layer to querytargetGroup- group of plugins to includecallback- callback that receives matchingqualifiersor an issue- Returns:
- request using
AvailablePluginsRequest.CacheMode.FRESH_IF_NO_CACHE
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
pluginLayer
Returns the value of thepluginLayerrecord component.- Returns:
- the value of the
pluginLayerrecord component
-
callback
Returns the value of thecallbackrecord component.- Returns:
- the value of the
callbackrecord component
-
cacheMode
Returns the value of thecacheModerecord component.- Returns:
- the value of the
cacheModerecord component
-
targetGroup
Returns the value of thetargetGrouprecord component.- Returns:
- the value of the
targetGrouprecord component
-