|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
B
- bean type (e.g., com.novell.db.object.bean.IdentityBean).public interface BeanTransporter<B extends SentinelBean>
Interface specifying methods used to send and receive SentinelBean
-derived instances to and from
the Sentinel server.
BeanTransporterSync
and the
implementation BeanTransporterJSONSync
.
To use a BeanTransporter
it is necessary to first construct an implementation of
HttpRequestor
and then use the HttpRequestor
implementation
to construct an implementation of BeanTransporter
(or, for the synchronous case, of
BeanTransporterSync
).
Once a transporter implementation is available the count, list and get methods are used to obtain data
from the Sentinel server.
To create, update, or delete data on the server the post, put, and delete methods are used.
Field Summary | |
---|---|
static List<String> |
NO_FIELDS
Value specifying that no field values are to be returned. |
static int |
UNLIMITED_PAGE_SIZE
Value specifying that no limit is placed on the maximum number of data instances returned as the result of a list call. |
Method Summary | |
---|---|
void |
cleanup(String url,
OnBeanDelete handler)
Issues a cleanup request to the server for the passed URL. |
void |
count(OnBeanCount handler)
Get a count of the data instances available. |
void |
count(String query,
OnBeanCount handler)
Get a count of the data instances available, optionally filtered by the passed query. |
void |
delete(B bean,
OnBeanDelete handler)
Delete the data instance represented by the passed bean. |
void |
delete(String url,
OnBeanDelete handler)
Delete the data instance at the specified URL. |
void |
get(String url,
Iterable<String> fields,
OnBeanLoad<B> handler)
Get the data at the passed URL in a bean. |
void |
get(String url,
OnOctetStreamLoad handler)
Get the octet stream value of an object attribute referenced by the passed URL. |
String |
getLocaleName()
Get the locale name currently set in the implementing instance. |
List<String> |
getSortFields()
Get the sort field names currently set in the implementing instance. |
void |
list(OnBeanPageLoad<B> handler)
Get a collection of the beans available. |
void |
list(String query,
int pageSize,
Iterable<String> fields,
boolean getChangeCounts,
OnBeanPageLoad<B> handler)
Get a collection of the data instances available, optionally filtered by the passed query. |
void |
list(String query,
int pageSize,
Iterable<String> fields,
OnBeanPageLoad<B> handler)
Get a collection of the data instances available, optionally filtered by the passed query. |
void |
listFromURL(String url,
int pageSize,
Iterable<String> fields,
boolean getChangeCounts,
OnBeanPageLoad<B> handler)
Get a collection of the data instances available at the passed URL. |
void |
listFromURL(String url,
int pageSize,
Iterable<String> fields,
OnBeanPageLoad<B> handler)
Get a collection of the data instances available at the passed URL. |
void |
listFromURL(String url,
OnBeanPageLoad<B> handler)
Get a collection of the beans available at the passed URL. |
void |
post(B bean,
OnBeanPost handler)
Create a new data instance. |
void |
put(B bean,
OnBeanPut handler)
Update the underlying Sentinel data from the passed bean. |
void |
put(String url,
byte[] data,
OnBeanPut handler)
Put the octet stream value of an object attribute referenced by the passed URL. |
void |
setLocaleName(String localeName)
Set the name of the locale to use to sort list results if an order is used. |
void |
setSortFields(List<String> sortFields)
Set list of field names on which to sort list results. |
Field Detail |
---|
static final int UNLIMITED_PAGE_SIZE
list
call.
static final List<String> NO_FIELDS
fields
parameter of
the list
and get
methods.
Method Detail |
---|
void setLocaleName(String localeName)
localeName
- The String getLocaleName()
void setSortFields(List<String> sortFields)
sortFields
- The list of field names on which to sort list results.List<String> getSortFields()
void count(OnBeanCount handler)
handler
- The handler to which the result of the HTTP request will be reported.void count(String query, OnBeanCount handler)
query
- Optional filter for the results (may be null
).handler
- The handler to which the result of the HTTP request will be reported.void listFromURL(String url, OnBeanPageLoad<B> handler)
url
- The URL specifying the beans.handler
- The handler to which the result of the HTTP request will be reported.void listFromURL(String url, int pageSize, Iterable<String> fields, OnBeanPageLoad<B> handler)
url
- The URL specifying the beans.pageSize
- The maximum number of beans to return as a result of this call.fields
- Optional collection of the names of fields to return in each bean (may be null
,
if a single value of "none" is specified then no fields are retrieved).handler
- The handler to which the result of the HTTP request will be reported.void listFromURL(String url, int pageSize, Iterable<String> fields, boolean getChangeCounts, OnBeanPageLoad<B> handler)
url
- The URL specifying the beans.pageSize
- The maximum number of beans to return as a result of this call.fields
- Optional collection of the names of fields to return in each bean (may be null
,
if a single value of "none" is specified then no fields are retrieved).getChangeCounts
- if true, get the "delta counts" of the object.handler
- The handler to which the result of the HTTP request will be reported.void list(String query, int pageSize, Iterable<String> fields, OnBeanPageLoad<B> handler)
query
- Optional filter for the results (may be null
).pageSize
- The maximum number of beans to return as a result of this call.fields
- Optional collection of the names of fields to return in each bean (may be null
,
if a single value of "none" is specified then no fields are retrieved).handler
- The handler to which the result of the HTTP request will be reported.void list(String query, int pageSize, Iterable<String> fields, boolean getChangeCounts, OnBeanPageLoad<B> handler)
query
- Optional filter for the results (may be null
).pageSize
- The maximum number of beans to return as a result of this call.fields
- Optional collection of the names of fields to return in each bean (may be null
,
if a single value of "none" is specified then no fields are retrieved).getChangeCounts
- if true, get the "delta counts" of the object.handler
- The handler to which the result of the HTTP request will be reported.void list(OnBeanPageLoad<B> handler)
handler
- The handler to which the result of the HTTP request will be reported.void get(String url, Iterable<String> fields, OnBeanLoad<B> handler)
url
- The URL specifying the data to retrieve.fields
- Optional collection of the names of fields to return in each bean (may be null
,
if a single value of "none" is specified then no fields are retrieved).handler
- The handler to which the result of the HTTP request will be reported.void get(String url, OnOctetStreamLoad handler)
url
- The reference to the attribute value.handler
- The handler to which the result of the HTTP request will be reported.void put(B bean, OnBeanPut handler) throws BeanSerializationException
bean
- The bean containing the updated data (must have been obtained from a list
or get
call.handler
- The handler to which the status of the HTTP request will be reported.
BeanSerializationException
void put(String url, byte[] data, OnBeanPut handler)
url
- The reference to the attribute value.data
- The octet stream data for the attribute value.handler
- The handler to which the status of the HTTP request will be reported.void post(B bean, OnBeanPost handler) throws BeanSerializationException
bean
- The bean containing the data for the new instance.handler
- The handler to which the result of the HTTP request will be reported.
BeanSerializationException
- If an error occurs transforming the bean data into HTTP request data.void delete(String url, OnBeanDelete handler)
url
- The URL specifying the data instance to be deleted.handler
- The handler to which the result of the HTTP request will be reported.void delete(B bean, OnBeanDelete handler)
bean
- The representation of the data instance to be deleted (must have been obtained from a list
or get
call.handler
- The handler to which the result of the HTTP request will be reported.void cleanup(String url, OnBeanDelete handler)
url
- The URL representing the resource to clean up.handler
- The handler to which the result of the HTTP request will be reported.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |