|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jeffpalm.logfiles.NetGeoClient
public class NetGeoClient
| Field Summary | |
|---|---|
static int |
ARRAY_LENGTH_LIMIT
|
static java.lang.String |
CITY_GRAN
|
static java.lang.String |
COUNTRY_GRAN
|
static boolean |
DEBUG
|
static java.lang.String |
DEFAULT_SERVER_URL
|
static int |
DEFAULT_TIMEOUT
|
static java.lang.String |
HTTP_ERROR
|
static java.lang.String |
INPUT_ERROR
|
static int |
LAT_INDEX
|
static int |
LONG_INDEX
|
static java.lang.String |
LOOKUP_IN_PROGRESS
|
static java.lang.String |
NETGEO_LIMIT_EXCEEDED
|
static java.lang.String |
NO_COUNTRY
|
static java.lang.String |
NO_MATCH
|
static java.lang.String |
OK
|
static java.lang.String |
STATE_GRAN
|
static java.lang.String |
UNKNOWN
|
static java.lang.String |
VERSION
|
static java.lang.String |
WHOIS_ERROR
|
static java.lang.String |
WHOIS_TIMEOUT
|
| Constructor Summary | |
|---|---|
NetGeoClient()
Description: NetGeoClient constructor |
|
NetGeoClient(java.lang.String applicationName)
Description: NetGeoClient constructor |
|
NetGeoClient(java.lang.String applicationName,
java.lang.String netGeoUrl)
Description: NetGeoClient constructor |
|
| Method Summary | |
|---|---|
void |
clearCache()
|
void |
clearLocalCache()
Description: Remove all entries from the local cache. |
void |
clearLocalCacheEntry(java.lang.String target)
Description: Remove the entry in the local cache with a key matching the standardized form of the input target. |
static float[] |
convertLatLong(java.util.Hashtable latLongHash)
Description: Convert the Hashtable returned by getLatLong into a 2-element float array. |
java.lang.String |
getCountry(java.lang.String target)
Description: Returns the country corresponding to the input target string, or returns NO_MATCH or NO_COUNTRY. |
java.util.Hashtable[] |
getCountryArray(java.lang.String[] stringArray)
Description: |
static float |
getLat(java.util.Hashtable latLongHash)
Description: Extract the latitude string from the lat/long hashtable and return it as a float primitive. |
java.util.Hashtable |
getLatLong(java.lang.String target)
Description: Returns a hashtable containing ( String, String ) pairs, with the keys LAT, LONG, LAT_LONG_GRAN, and STATUS. |
java.util.Hashtable[] |
getLatLongArray(java.lang.String[] stringArray)
Description: |
static float |
getLong(java.util.Hashtable latLongHash)
Description: Extract the longitude string from the lat/long hashtable and return it as a float primitive. |
java.util.Hashtable |
getRecord(java.lang.String target)
Description: Returns a full record for the input target string. |
java.util.Hashtable[] |
getRecordArray(java.lang.String[] stringArray)
Description: |
boolean |
getSave()
|
static java.lang.String[] |
intArrayToStringArray(int[] intArray)
Description: Convert an int array to an equivalent String array. |
void |
load()
jpalm |
static void |
main(java.lang.String[] argv)
Description: |
void |
save()
jpalm |
void |
setNonblocking(boolean trueOrFalse)
Description: Specify whether or not the server should wait on whois lookups. |
void |
setSave(boolean save)
|
void |
setTimeout(int seconds)
Description: Set the time limit (in seconds) to be allowed for a whois lookup. |
java.lang.String |
updateCountryArray(java.util.Hashtable[] recordArray)
Description: |
java.lang.String |
updateLatLongArray(java.util.Hashtable[] recordArray)
Description: |
java.lang.String |
updateRecordArray(java.util.Hashtable[] recordArray)
Description: |
void |
useLocalCache(boolean trueOrFalse)
Description: Keep a cache of results in memory on the machine executing this NetGeoClient code. |
java.lang.String |
verifyAsNumberFormat(java.lang.String methodName,
java.lang.String input)
Description: |
boolean |
verifyDomainNameFormat(java.lang.String input,
int lastDotIndex)
Description: |
void |
verifyInputFormat(java.lang.String methodName,
java.util.Hashtable hashtable)
Description: Test the target string from the input hashtable and make sure it's in an acceptable format. |
boolean |
verifyIpAddressFormat(java.lang.String input,
int lastDotIndex)
Description: |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VERSION
public static final java.lang.String DEFAULT_SERVER_URL
public static final java.lang.String OK
public static final java.lang.String LOOKUP_IN_PROGRESS
public static final java.lang.String NO_MATCH
public static final java.lang.String NO_COUNTRY
public static final java.lang.String UNKNOWN
public static final java.lang.String WHOIS_ERROR
public static final java.lang.String HTTP_ERROR
public static final java.lang.String INPUT_ERROR
public static final java.lang.String WHOIS_TIMEOUT
public static final java.lang.String NETGEO_LIMIT_EXCEEDED
public static final int ARRAY_LENGTH_LIMIT
public static final java.lang.String CITY_GRAN
public static final java.lang.String STATE_GRAN
public static final java.lang.String COUNTRY_GRAN
public static final int DEFAULT_TIMEOUT
public static final int LAT_INDEX
public static final int LONG_INDEX
public static final boolean DEBUG
| Constructor Detail |
|---|
public NetGeoClient(java.lang.String applicationName)
String - - application name and version, e.g., "plot_AS_loc/1.2.3".public NetGeoClient()
-
public NetGeoClient(java.lang.String applicationName,
java.lang.String netGeoUrl)
String - - application name and version, e.g., "plot_AS_loc/1.2.3".String - - url of NetGeo server, e.g.,
http://www.caida.org/cgi-bin/netgeo/netgeo.cgi| Method Detail |
|---|
public static void main(java.lang.String[] argv)
String[] - argvpublic void setTimeout(int seconds)
int - - secondspublic void setNonblocking(boolean trueOrFalse)
boolean - - trueOrFalsepublic void useLocalCache(boolean trueOrFalse)
boolean - - trueOrFalsepublic void clearLocalCache()
public void clearLocalCacheEntry(java.lang.String target)
String - - targetpublic final void setSave(boolean save)
public final boolean getSave()
public void save()
public void load()
public void clearCache()
public java.util.Hashtable getRecord(java.lang.String target)
String -
public java.lang.String getCountry(java.lang.String target)
String -
public java.util.Hashtable getLatLong(java.lang.String target)
String -
public java.util.Hashtable[] getRecordArray(java.lang.String[] stringArray)
String[] -
public java.util.Hashtable[] getCountryArray(java.lang.String[] stringArray)
String[] -
public java.util.Hashtable[] getLatLongArray(java.lang.String[] stringArray)
String[] -
public java.lang.String updateRecordArray(java.util.Hashtable[] recordArray)
Hashtable[] -
public java.lang.String updateCountryArray(java.util.Hashtable[] recordArray)
Hashtable[] -
public java.lang.String updateLatLongArray(java.util.Hashtable[] recordArray)
Hashtable[] -
public static java.lang.String[] intArrayToStringArray(int[] intArray)
int[] -
public static float getLat(java.util.Hashtable latLongHash)
Hashtable -
public static float getLong(java.util.Hashtable latLongHash)
Hashtable -
public static float[] convertLatLong(java.util.Hashtable latLongHash)
Hashtable - - latLongHash
public void verifyInputFormat(java.lang.String methodName,
java.util.Hashtable hashtable)
String - - methodNameHashtable - - hashtable
public java.lang.String verifyAsNumberFormat(java.lang.String methodName,
java.lang.String input)
String - - methodNameString - - input, already trimmed and not null
public boolean verifyDomainNameFormat(java.lang.String input,
int lastDotIndex)
String - - input, already trimmed and not nullint - - lastDotIndex
public boolean verifyIpAddressFormat(java.lang.String input,
int lastDotIndex)
String - - input, already trimmed and not nullint - - lastDotIndexString - - lastOctet, the part of the input string following
the last dot. In an IP address this is the 4th octet.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||