public class OpenWeatherMap extends HttpClient
Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
log |
cfgDir, dnaPool, MESSAGE_RECORDING_FORMAT_BINARY, MESSAGE_RECORDING_FORMAT_XML
Constructor and Description |
---|
OpenWeatherMap(java.lang.String reservedKey) |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
fetchForecast(java.lang.String location)
retrieve a string list of weather for the period indicated by hourPeriod 1 >=
hourPeriod is 3 hours per index -> 24 hours is 8.
|
java.lang.String[] |
fetchForecast(java.lang.String location,
int hourPeriod) |
java.lang.String |
fetchWeather(java.lang.String location)
Deprecated.
|
java.lang.String |
getApiBase() |
java.lang.String |
getApiKey() |
static ServiceType |
getMetaData()
This static method returns all the details of the class without it having
to be constructed.
|
java.lang.String |
getUnits() |
static void |
main(java.lang.String[] args) |
void |
setApiBase(java.lang.String apiBase) |
void |
setApiKey(java.lang.String apiKey) |
void |
setLang(java.lang.String lang) |
void |
setUnits(java.lang.String units) |
addFormField, addHttpDataListener, addHttpResponseListener, clearForm, get, getBytes, onHttpData, onHttpResponse, post, post, postBytes, processResponse, publishHttpData, publishHttpResponse, startService
addListener, addListener, addTask, addTask, addTask, addTaskOneShot, allowDisplay, allowDisplay, attach, attach, broadcastState, buildDna, buildDna, buildDnaKeys, buildDnaNames, clearLastError, close, containsTask, copyShallowFrom, createPeer, createPeer, createRootReserved, detach, detach, detach, echoHeartbeat, error, error, error, getAttached, getCfgDir, getComm, getDeclaredMethodNames, getDeclaredMethods, getDescription, getDna, getDnaString, getHostName, getInbox, getInstanceId, getIntanceName, getInterfaceSet, getLastError, getMessageSet, getMetaData, getMethodMap, getMethodNames, getMethods, getMethodToolTip, getMsg, getName, getNotifyList, getNotifyListKeySet, getOutbox, getPeerKey, getPeerName, getServiceResourceFile, getSimpleName, getTasks, getThisThread, getType, hasError, hasPeers, help, help, in, info, info, invoke, invoke, invoke, invokeOn, isAttached, isAttached, isLocal, isReady, isRunning, isRuntime, isVirtual, load, load, logTimeEnable, mergeDna, mergeDna, mergePeerDna, movePeerDna, out, out, preProcessHook, preRoutingHook, publishError, publishQueueStats, publishState, publishStats, publishStatus, purgeTask, purgeTasks, releasePeers, releaseService, removeAllListeners, removeListener, requiresSecurity, reserve, reserve, reserveRoot, reserveRoot, reserveRootAs, run, save, save, save, send, send, send, send, sendBlocking, sendBlocking, sendBlocking, sendBlocking, sendPeer, setInstanceId, setName, setPeer, setSecurityProvider, setState, setThisThread, setVirtual, sleep, stackToString, startHeartbeat, startPeer, startPeer, startRecording, stopHeartbeat, stopMsgRecording, stopService, subscribe, subscribe, subscribe, toString, unsubscribe, unsubscribe, unsubscribe, updateStats, warn, warn
public java.lang.String[] fetchForecast(java.lang.String location) throws org.apache.http.client.ClientProtocolException, java.io.IOException, org.json.JSONException
org.json.JSONException
java.io.IOException
org.apache.http.client.ClientProtocolException
public java.lang.String[] fetchForecast(java.lang.String location, int hourPeriod) throws org.apache.http.client.ClientProtocolException, java.io.IOException, org.json.JSONException
org.apache.http.client.ClientProtocolException
java.io.IOException
org.json.JSONException
@Deprecated public java.lang.String fetchWeather(java.lang.String location) throws org.apache.http.client.ClientProtocolException, java.io.IOException, org.json.JSONException
org.apache.http.client.ClientProtocolException
java.io.IOException
org.json.JSONException
public java.lang.String getApiBase()
public void setApiBase(java.lang.String apiBase)
apiBase
- The base url that is assocaited with the open weather map api.public java.lang.String getUnits()
public void setUnits(java.lang.String units)
units
- The units, can be either imperial or metric.public java.lang.String getApiKey()
public void setApiKey(java.lang.String apiKey)
apiKey
- REQUIRED: specify your API key with this method.public void setLang(java.lang.String lang)
public static ServiceType getMetaData()
public static void main(java.lang.String[] args)