Class AerisRequest
- java.lang.Object
- 
- com.aerisweather.aeris.communication.UrlBuilder
- 
- com.aerisweather.aeris.communication.AerisRequest
 
 
- 
- Direct Known Subclasses:
- AerisBatchRequest,- AerisPermissionsRequest
 
 public class AerisRequest extends UrlBuilder Builds request for various endpoints, actions, and parameters.Some code examples: Construct a request for the observation for zip code 55403 AerisRequest request = new AerisRequest(TestConstants.CLIENT_ID, TestConstants.CLIENT_SECRET, new Endpoint( EndpointType.OBSERVATIONS), "55403"):Construct a request for 5 observations within 50 miles of zip code 55403 (Minneapolis). Results will be sorted by distance (ascending) from zip code 55403 AerisRequest request = new AerisRequest(TestConstants.CLIENT_ID, TestConstants.CLIENT_SECRET, new Endpoint( EndpointType.OBSERVATIONS), Action.CLOSEST, new PlaceParameter("55403"), new LimitParameter(5), new RadiusParameter(50, RadiusUnitParameter.MILES) ;
- 
- 
Field SummaryFields Modifier and Type Field Description protected Actionactionprotected booleandebugprotected Endpointendpointprotected Stringidprotected Doublelatprotected Doublelongitudeprotected Parameter[]parametersprotected booleansecureAccess- 
Fields inherited from class com.aerisweather.aeris.communication.UrlBuilderclientId, clientSecret, packageName
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAerisRequest()AerisRequest(Endpoint endpoint, Action action, Parameter... params)Builds the request with a specified endpoint, action, params.AerisRequest(Endpoint endpoint, String id, Parameter... params)Builds the request with a specified endpoint, action, params.AerisRequest(String clientId, String clientSecret, String packageName, Endpoint endpoint, Action action, Parameter... params)Builds the request with a specified endpoint, action, params.AerisRequest(String clientId, String clientSecret, String packageName, Endpoint endpoint, String id, Parameter... params)Builds the request with a specified endpoint, action, params.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()Builds the request for from the given parametersdoublegetLat()doublegetLongitude()protected StringgetParameters()Gets the parameters in the correct format.booleanisDebug()Returns if debug has been enabled which allows for the request and response to be logged in logcatbooleanisSecureAccess()Returns whether secure access has been enabled.AerisRequestwithDebugOutput(boolean debug)Constructs the request with the debug set to a value.AerisRequestwithSecureAccess(boolean secureAccess)Sets the secure access.- 
Methods inherited from class com.aerisweather.aeris.communication.UrlBuildergetLimit, getOAuth, getPositionString
 
- 
 
- 
- 
- 
Constructor Detail- 
AerisRequestprotected AerisRequest() 
 - 
AerisRequestpublic AerisRequest(Endpoint endpoint, Action action, Parameter... params) Builds the request with a specified endpoint, action, params. Grabs the secret id and client id from theAerisEngine.- Parameters:
- endpoint- Endpoint we are requesting data from
- action- Action to take on the endpoint
- params- Optional parameters
 
 - 
AerisRequestpublic AerisRequest(Endpoint endpoint, String id, Parameter... params) Builds the request with a specified endpoint, action, params. Grabs the secret id and client id from theAerisEngine.- Parameters:
- endpoint- Endpoint we are requesting data from
- id- String
- params- optional
 
 - 
AerisRequestpublic AerisRequest(String clientId, String clientSecret, String packageName, Endpoint endpoint, String id, Parameter... params) Builds the request with a specified endpoint, action, params.- Parameters:
- clientId- Aeris account id
- clientSecret- Aeris account secret
- packageName- The package name of the service requesting data
- endpoint- Endpoint was are requesting
- id- String
- params- optional
 
 - 
AerisRequestpublic AerisRequest(String clientId, String clientSecret, String packageName, Endpoint endpoint, Action action, Parameter... params) Builds the request with a specified endpoint, action, params.- Parameters:
- clientId- Aeris account id
- clientSecret- Aeris account secret
- packageName- The package name of the service requesting data
- endpoint- Endpoint was are requesting
- action- Action to take on the endpoint
- params- optional
 
 
- 
 - 
Method Detail- 
withDebugOutputpublic AerisRequest withDebugOutput(boolean debug) Constructs the request with the debug set to a value. Default value is false- Parameters:
- debug- debug boolean to set as. True will log the request and response from Aeris.
- Returns:
- The AerisRequest
 
 - 
isDebugpublic boolean isDebug() Returns if debug has been enabled which allows for the request and response to be logged in logcat- Returns:
- true if debug is enabled, false otherwise
 
 - 
isSecureAccesspublic boolean isSecureAccess() Returns whether secure access has been enabled. Secure access points the API to use HTTPS versus HTTP.- Returns:
- true if secure access is enabled.
 
 - 
withSecureAccesspublic AerisRequest withSecureAccess(boolean secureAccess) Sets the secure access. Secure access points the API to use HTTPS versus HTTP. Default is false.- Parameters:
- secureAccess- What to set the secure access to.
- Returns:
- AerisRequest obj
 
 - 
buildpublic String build() Builds the request for from the given parameters- Specified by:
- buildin class- UrlBuilder
- Returns:
- the String url for the request.
 
 - 
getParametersprotected String getParameters() Gets the parameters in the correct format.- Returns:
- Parameters in a Url friendly format. 04april2016sshie - removed the appID (AMP update)
 
 - 
getLatpublic double getLat() throws UnsupportedOperationException- Throws:
- UnsupportedOperationException
 
 - 
getLongitudepublic double getLongitude() throws UnsupportedOperationException- Throws:
- UnsupportedOperationException
 
 
- 
 
-