*** This class provides Binary Compatibility only, not Source Compatibility ***
Package com.sas.services.discovery
Class LookupPolicyTimeout
java.lang.Object
com.sas.services.discovery.LookupPolicyTimeout
- All Implemented Interfaces:
LookupPolicyInterface
@SASScope("ALL")
@BinaryCompatibilityOnly
public class LookupPolicyTimeout
extends Object
implements LookupPolicyInterface
A service discovery policy that will re-attempt to lookup services until
the specified timeout occurs.
- Since:
- 1.0
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a service lookup timeout policy using a default timeout.LookupPolicyTimeout(long timeoutInMsec) Constructs an instance of a service lookup timeout policy using the specified timeout. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanisOKToRetryLookup(String serviceLookupRequestId) In the event that a local service lookup fails to return any results, this method will be invoked to determine whether or not the service lookup should be re-attempted.final voidserviceLookupInitiated(String serviceLookupRequestId) Notifies the policy implementation that a service lookup has started.final voidserviceLookupTerminated(String serviceLookupRequestId) Notifies the policy implementation that a service lookup has been terminated.final voidsetTimeout(long timeoutInMsec) Sets the service lookup timeout.final StringtoString()Gets a string representation of the state of this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
LookupPolicyTimeout
public LookupPolicyTimeout()Constructs a service lookup timeout policy using a default timeout. -
LookupPolicyTimeout
public LookupPolicyTimeout(long timeoutInMsec) Constructs an instance of a service lookup timeout policy using the specified timeout.- Parameters:
timeoutInMsec- Service lookup timeout in msec.- Throws:
IllegalArgumentException- if an invalid timeout parameter is specified.
-
-
Method Details
-
setTimeout
public final void setTimeout(long timeoutInMsec) Sets the service lookup timeout.- Parameters:
timeoutInMsec- Service lookup timeout in msec.
-
serviceLookupInitiated
public final void serviceLookupInitiated(String serviceLookupRequestId) Notifies the policy implementation that a service lookup has started.- Specified by:
serviceLookupInitiatedin interfaceLookupPolicyInterface- Parameters:
serviceLookupRequestId- An ID that the policy control implementation can use to distinguish between multiple service lookup requests. This value will be used in future interactions between the local discovery service and this policy implementation. Refer to the following methods for additional details.
-
serviceLookupTerminated
public final void serviceLookupTerminated(String serviceLookupRequestId) Notifies the policy implementation that a service lookup has been terminated.- Specified by:
serviceLookupTerminatedin interfaceLookupPolicyInterface- Parameters:
serviceLookupRequestId- An ID that the policy control implementation can use to distinguish between multiple service lookup requests. This value was originally provided to the policy implementation when it was notified of the start of a service lookup via the(String) serviceLookupInitiated (serviceLookupRequestId)method.
-
isOKToRetryLookup
public final boolean isOKToRetryLookup(String serviceLookupRequestId) In the event that a local service lookup fails to return any results, this method will be invoked to determine whether or not the service lookup should be re-attempted.- Specified by:
isOKToRetryLookupin interfaceLookupPolicyInterface- Parameters:
serviceLookupRequestId- The ID associated with a particular service lookup request. The policy control implementation can use to distinguish between multiple service lookup requests. This value was originally provided to the policy implementation when it was notified of the start of a service lookup via the(String) serviceLookupInitiated (serviceLookupRequestId)method.- Returns:
trueif the service lookup should be re-attempted orfalseif it shouldn't.
-
toString
public final String toString()Gets a string representation of the state of this object.- Overrides:
toStringin classObject- Returns:
- Descriptive string detailing the currently specified timeout
parameters:
- maximum timeout (msec)
-