public class Soda2Base extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SODA_BASE_PATH |
static String |
SODA_QUERY |
Constructor and Description |
---|
Soda2Base(HttpLowLevel httpLowLevel)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<T> com.sun.jersey.api.client.ClientResponse |
doAdd(String resourceId,
T object)
Adds a single row to a dataset.
|
<T> com.sun.jersey.api.client.ClientResponse |
doAddObjects(String resourceId,
Collection<T> objects)
Adds a collection of rows to a dataset.
|
com.sun.jersey.api.client.ClientResponse |
doAddStream(String resourceId,
javax.ws.rs.core.MediaType mediaType,
InputStream stream)
Adds a collection of rows to a dataset, but does so by simply streaming a datastream to the SODA2 server.
|
com.sun.jersey.api.client.ClientResponse |
doDelete(String resourceId,
String uniqueId)
Deletes a single row from a dataset.
|
<T> com.sun.jersey.api.client.ClientResponse |
doReplaceObjects(String resourceId,
Collection<T> objects) |
com.sun.jersey.api.client.ClientResponse |
doReplaceStream(String resourceId,
javax.ws.rs.core.MediaType mediaType,
InputStream stream) |
com.sun.jersey.api.client.ClientResponse |
doTruncate(String resourceId)
Truncates a dataset by removing all the rows in it.
|
com.sun.jersey.api.client.ClientResponse |
doUpdate(String resourceId,
Object uniqueId,
Object object)
Update an object.
|
com.sun.jersey.api.client.ClientResponse |
getById(String resourceId,
javax.ws.rs.core.MediaType mediaType,
String uniqueId)
Load a single object based on it's unique ID.
|
HttpLowLevel |
getHttpLowLevel()
The HttpLowLevel used for communicating with the service.
|
com.sun.jersey.api.client.ClientResponse |
query(String resourceId,
javax.ws.rs.core.MediaType mediaType,
SoqlQuery query)
Runs a query against a SODA2 resource.
|
com.sun.jersey.api.client.ClientResponse |
query(String resourceId,
javax.ws.rs.core.MediaType mediaType,
String query)
Runs a query against a SODA2 resource.
|
public static final String SODA_BASE_PATH
public static final String SODA_QUERY
public Soda2Base(HttpLowLevel httpLowLevel)
httpLowLevel
- the HttpLowLevel this uses to contact the serverpublic com.sun.jersey.api.client.ClientResponse query(String resourceId, javax.ws.rs.core.MediaType mediaType, SoqlQuery query) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.query
- The query to be executed against the resource.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public com.sun.jersey.api.client.ClientResponse query(String resourceId, javax.ws.rs.core.MediaType mediaType, String query) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.query
- The query string to be executed against the resource. This should NOT be URL encoded.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public com.sun.jersey.api.client.ClientResponse getById(String resourceId, javax.ws.rs.core.MediaType mediaType, String uniqueId) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.uniqueId
- Id based on a dataset specific unique column, or the system ID created for each row.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public com.sun.jersey.api.client.ClientResponse doTruncate(String resourceId) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public com.sun.jersey.api.client.ClientResponse doDelete(String resourceId, String uniqueId) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.uniqueId
- Id based on a dataset specific unique column, or the system ID created for each row.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public <T> com.sun.jersey.api.client.ClientResponse doAdd(String resourceId, T object) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.object
- The object that should be serialized to JSON and added to the dataset. Jackson is used for serialization
and deserialization.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public <T> com.sun.jersey.api.client.ClientResponse doAddObjects(String resourceId, Collection<T> objects) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.objects
- The objects that should be serialized to JSON and added to the dataset. Jackson is used for serialization
and deserialization.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public com.sun.jersey.api.client.ClientResponse doAddStream(String resourceId, javax.ws.rs.core.MediaType mediaType, InputStream stream) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.mediaType
- The media type for the stream (normally JSON or CSV)stream
- The objects to add, already serialized in a stream.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public com.sun.jersey.api.client.ClientResponse doUpdate(String resourceId, Object uniqueId, Object object) throws LongRunningQueryException, SodaError
resourceId
- The id of the resource to query. This can either be the resource endpoint name
set in the metadata, or the unique ID given to the resource.uniqueId
- Id based on a dataset specific unique column, or the system ID created for each row.object
- The object that should be serialized to JSON and added to the dataset. Jackson is used for serialization
and deserialization.LongRunningQueryException
- thrown if this query is long running and a 202 is returned. In this case,
the caller likely wants to call follow202.SodaError
- thrown if there is an error. Investigate the structure for more information.public <T> com.sun.jersey.api.client.ClientResponse doReplaceObjects(String resourceId, Collection<T> objects) throws LongRunningQueryException, SodaError
LongRunningQueryException
SodaError
public com.sun.jersey.api.client.ClientResponse doReplaceStream(String resourceId, javax.ws.rs.core.MediaType mediaType, InputStream stream) throws LongRunningQueryException, SodaError
LongRunningQueryException
SodaError
public final HttpLowLevel getHttpLowLevel()
Copyright © 2013. All Rights Reserved.