public class

DiscoveryReliability

extends Object
java.lang.Object
   ↳ org.ocast.discovery.DiscoveryReliability

Class Overview

Defines a level a reliability for the discovery process It is based on two factors: the timeout of a discovery request and the number of attempts before considering a device has been lost.

Summary

Fields
public static final DiscoveryReliability HIGH defines a discovery request to be sent every 3 seconds, consider a device lost if it didn't respond 2 consecutive times.
public static final DiscoveryReliability LOW defines a discovery request to be sent every 10 seconds, consider a device lost if it didn't respond 5 consecutive times.
public static final DiscoveryReliability MEDIUM defines a discovery request to be sent every 6 seconds, consider a device lost if it didn't respond 3 consecutive times.
Public Constructors
DiscoveryReliability(int timeout, int retry)
Constructs an object and initializes it with the provided values
Public Methods
int getRetry()
get the retry number before considering a device got lost
int getTimeout()
get the discovery timeout to consider no device responded
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final DiscoveryReliability HIGH

defines a discovery request to be sent every 3 seconds, consider a device lost if it didn't respond 2 consecutive times.

public static final DiscoveryReliability LOW

defines a discovery request to be sent every 10 seconds, consider a device lost if it didn't respond 5 consecutive times.

public static final DiscoveryReliability MEDIUM

defines a discovery request to be sent every 6 seconds, consider a device lost if it didn't respond 3 consecutive times.

Public Constructors

public DiscoveryReliability (int timeout, int retry)

Constructs an object and initializes it with the provided values

Parameters
timeout timeout for a discovery request (seconds)
retry number of attempts before considering a device has been lost

Public Methods

public int getRetry ()

get the retry number before considering a device got lost

Returns
  • the number of retry

public int getTimeout ()

get the discovery timeout to consider no device responded

Returns
  • a duration in seconds

public String toString ()