Class FederationOptions

  • All Implemented Interfaces:
    java.lang.Cloneable

    @Immutable
    public class FederationOptions
    extends java.lang.Object
    implements java.lang.Cloneable
    Options for controlling federation to a single source. This is a value object.
    Author:
    Tony Vaagenes
    • Constructor Detail

      • FederationOptions

        public FederationOptions​(java.lang.Boolean optional,
                                 java.lang.Integer timeoutInMilliseconds,
                                 java.lang.Boolean useByDefault)
        Creates a request with no separate requestTimeoutInMilliseconds
      • FederationOptions

        public FederationOptions​(java.lang.Boolean optional,
                                 java.lang.Integer timeoutInMilliseconds,
                                 java.lang.Integer requestTimeoutInMilliseconds,
                                 java.lang.Boolean useByDefault)
        Creates a fully specified set of options
        Parameters:
        optional - whether this should be optional
        timeoutInMilliseconds - the max time to wait for a result from this source, or null to use the timeout of the query
        requestTimeoutInMilliseconds - the max time to allow this request to live, or null to make this the same as timeoutInMilliseconds. Setting this higher than timeoutInMilliseconds is useful to use queries to populate the cache of slow sources
        useByDefault - whether this should be invoked by default
      • FederationOptions

        public FederationOptions()
        Creates a set of default options: Mandatory, no timeout restriction and not used by default
    • Method Detail

      • setOptional

        public FederationOptions setOptional​(java.lang.Boolean newOptional)
        Returns a set of options which are the same of this but with optional set to the given value
      • setTimeoutInMilliseconds

        public FederationOptions setTimeoutInMilliseconds​(java.lang.Integer newTimeoutInMilliseconds)
        Returns a set of options which are the same of this but with timeout set to the given value
      • setRequestTimeoutInMilliseconds

        public FederationOptions setRequestTimeoutInMilliseconds​(java.lang.Integer newRequestTimeoutInMilliseconds)
        Returns a set of options which are the same of this but with request timeout set to the given value
      • setUseByDefault

        public FederationOptions setUseByDefault​(java.lang.Boolean newUseByDefault)
        Returns a set of options which are the same of this but with default set to the given value
      • getOptional

        public boolean getOptional()
      • getTimeoutInMilliseconds

        public int getTimeoutInMilliseconds()
        Returns the amount of time we should wait for this target, or -1 to use default
      • getRequestTimeoutInMilliseconds

        public int getRequestTimeoutInMilliseconds()
        Returns the amount of time we should allow this target execution to run, or -1 to use default
      • getSearchChainExecutionTimeoutInMilliseconds

        public long getSearchChainExecutionTimeoutInMilliseconds​(long queryTimeout)
      • getUseByDefault

        public boolean getUseByDefault()
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object