public class OraClient extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) int |
appId |
(package private) String |
baseURL |
| Constructor and Description |
|---|
OraClient() |
| Modifier and Type | Method and Description |
|---|---|
Halo |
getHalo(int id)
Fetches the halo with specified id from the server.
|
ArrayList<Halo> |
getHaloCollection(int collectionId)
get a list of halos from the server.
|
Halo |
insertHalo(Halo halo)
Sends a halo to the server.
|
int |
insertHaloList(List<Halo> halos)
Sends a list of halos to the server.
|
private String |
jsonifyHalo(Halo h) |
private String |
jsonifyList(List<Halo> halos) |
private org.json.JSONObject |
jsonifyVertices(Halo h) |
private Halo |
parseHalo(org.json.JSONObject job) |
private Halo |
readHalo(HttpURLConnection conn) |
private String |
readResponse(HttpURLConnection conn) |
private HttpURLConnection |
sendData(URL url,
String method,
String data) |
Halo |
updateHalo(Halo halo)
Persists the new state of a halo to the server.
|
int appId
String baseURL
private org.json.JSONObject jsonifyVertices(Halo h)
private String readResponse(HttpURLConnection conn) throws IOException
IOExceptionprivate HttpURLConnection sendData(URL url, String method, String data) throws IOException
IOExceptionprivate Halo parseHalo(org.json.JSONObject job) throws org.json.JSONException
org.json.JSONExceptionprivate Halo readHalo(HttpURLConnection conn) throws IOException
IOExceptionpublic Halo getHalo(int id) throws IOException
id - The halo idIOException - On server errorpublic Halo insertHalo(Halo halo) throws IOException
halo - A halo object to store.IOException - On server failure.public Halo updateHalo(Halo halo) throws IOException
halo - A halo object to ubdate on the server.IOException - On server failure.public int insertHaloList(List<Halo> halos) throws IOException
halos - A list of halos.IOException - On server failure.public ArrayList<Halo> getHaloCollection(int collectionId) throws IOException
collectionId - The id of the collection.IOException - On server failure.Copyright © 2015. All rights reserved.