Update to Worldwind release 0.4.1
[worldwind-tracker.git] / gov / nasa / worldwind / util / NetworkStatus.java
blob5159379926cd4577fb01579a000d26b01b403fa1
1 /*
2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
5 All Rights Reserved.
6 */
7 package gov.nasa.worldwind.util;
9 import gov.nasa.worldwind.avlist.AVList;
11 import java.net.URL;
13 /**
14 * @author tag
15 * @version $Id: NetworkStatus.java 3735 2007-12-06 02:20:43Z tgaskins $
17 public interface NetworkStatus extends AVList
19 void logUnavailableHost(URL url);
21 void logAvailableHost(URL url);
23 boolean isHostUnavailable(URL url);
25 boolean isNetworkUnavailable();
27 boolean isWorlWindServerUnavailable();
29 int getAttemptLimit();
31 long getTryAgainInterval();
33 /**
34 * Indicates whether World Wind will attempt to connect to the network to retrieve data or for other reasons.
36 * @return <code>true</code> if World Wind is in off-line mode, <code>false</code> if not.
38 boolean isOfflineMode();
40 /**
41 * Indicate whether World Wind should attempt to connect to the network to retrieve data or for other reasons.
42 * The default value for this attribute is <code>false</code>, indicating that the network should be used.
44 * @param offlineMode <code>true</code> if World Wind should use the network, <code>false</code> otherwise
46 void setOfflineMode(boolean offlineMode);
48 /**
49 * Set the number of times a host must be logged as unavailable before it is marked unavailable in this class.
51 * @param limit the number of log-unavailability invocations necessary to consider the host unreachable.
52 * @throws IllegalArgumentException if the limit is less than 1.
54 void setAttemptLimit(int limit);
56 /**
57 * Set the length of time to wait until a host is marked as not unreachable subsequent to its being marked
58 * unreachable.
60 * @param interval The length of time, in milliseconds, to wait to unmark a host as unreachable.
61 * @throws IllegalArgumentException if the interval is less than 0.
63 void setTryAgainInterval(long interval);