|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.sentinel.client.bean.BeanTransporterBase<B,P> com.novell.sentinel.client.bean.java.BeanTransporterSyncBase<B,P>
B
- Bean type (e.g., IdentityBean)P
- HTTP content parser type (e.g., JSONParser or org.xml.sax.Parser)public abstract class BeanTransporterSyncBase<B extends SentinelBean,P>
A base class for synchronous Java BeanTransporterSync implementations.
This classes uses the callback methods in its implementation, but hides the messy callback details in order to provide a clean, synchronous implementation whose methods return results directly and throw exceptions rather than reporting results and exceptions through callbacks.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.novell.sentinel.client.bean.BeanTransporterBase |
---|
BeanTransporterBase.ParseException |
Field Summary |
---|
Fields inherited from interface com.novell.sentinel.client.bean.BeanTransporter |
---|
NO_FIELDS, UNLIMITED_PAGE_SIZE |
Constructor Summary | |
---|---|
protected |
BeanTransporterSyncBase(BeanMetaData<? extends B> _beanMD,
HttpRequestor<P> _requestor,
UriConstructorFactory _urlFactory)
Constructor for derived classes. |
Method Summary | |
---|---|
void |
cleanup(String url)
Issues a cleanup request to the server for the passed URL. |
long |
count()
Get a count of the data instances available. |
long |
count(String query)
Get a count of the data instances available, optionally filtered by the passed query. |
void |
delete(B bean)
Delete the data instance represented by the passed bean. |
void |
delete(String url)
Delete the data instance at the specified URL. |
B |
get(String url,
Iterable<String> fields)
Get the data at the passed URL in a bean. |
byte[] |
getOctetData(String url)
Get the octet stream value of an object attribute referenced by the passed URL. |
PagedBeanCollection<B> |
list()
Get a collection of the beans available. |
PagedBeanCollection<B> |
list(String query,
int pageSize,
Iterable<String> fields)
Get a collection of the data instances available, optionally filtered by the passed query. |
PagedBeanCollection<B> |
list(String query,
int pageSize,
Iterable<String> fields,
boolean getChangeCounts)
Get a collection of the data instances available, optionally filtered by the passed query. |
PagedBeanCollection<B> |
listFromURL(String url)
Get a collection of the beans available at the passed URL. |
PagedBeanCollection<B> |
listFromURL(String url,
int pageSize,
Iterable<String> fields)
Get a collection of the data instances available at the passed URL. |
PagedBeanCollection<B> |
listFromURL(String url,
int pageSize,
Iterable<String> fields,
boolean getChangeCounts)
Get a collection of the data instances available at the passed URL. |
String |
post(B bean)
Create a new data instance. |
void |
put(B bean)
Update the underlying Sentinel data from the passed bean. |
void |
put(String url,
byte[] data)
Put the octet stream value of an object attribute referenced by the passed URL. |
Methods inherited from class com.novell.sentinel.client.bean.BeanTransporterBase |
---|
cleanup, count, count, createBean, createPage, createParser, delete, delete, get, get, getBeanMD, getLocaleName, getRequestor, getSortFields, getUrlFactory, list, list, list, listFromURL, listFromURL, listFromURL, parseCount, parseURL, post, put, put, setLocaleName, setSortFields |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected BeanTransporterSyncBase(BeanMetaData<? extends B> _beanMD, HttpRequestor<P> _requestor, UriConstructorFactory _urlFactory)
_beanMD
- The metadata for the SentinelBean type._requestor
- The HttpRequestor implementation that will be used to make requests. This
must be a synchronous implementation._urlFactory
- The factory that will be used to construct URI instances.Method Detail |
---|
public long count() throws HttpException
BeanTransporterSync
count
in interface BeanTransporterSync<B extends SentinelBean>
HttpException
- If an error occurs executing the HTTP request.public long count(String query) throws HttpException
BeanTransporterSync
count
in interface BeanTransporterSync<B extends SentinelBean>
query
- Optional filter for the results (may be null
).
HttpException
- If an error occurs executing the HTTP request.public PagedBeanCollection<B> listFromURL(String url) throws HttpException
BeanTransporterSync
listFromURL
in interface BeanTransporterSync<B extends SentinelBean>
url
- The URL specifying the beans.
HttpException
- If an error occurs executing the HTTP request.public PagedBeanCollection<B> listFromURL(String url, int pageSize, Iterable<String> fields) throws HttpException
BeanTransporterSync
listFromURL
in interface BeanTransporterSync<B extends SentinelBean>
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).
HttpException
- If an error occurs executing the HTTP request.public PagedBeanCollection<B> listFromURL(String url, int pageSize, Iterable<String> fields, boolean getChangeCounts) throws HttpException
BeanTransporterSync
listFromURL
in interface BeanTransporterSync<B extends SentinelBean>
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.
HttpException
- If an error occurs executing the HTTP request.public PagedBeanCollection<B> list(String query, int pageSize, Iterable<String> fields) throws HttpException
BeanTransporterSync
list
in interface BeanTransporterSync<B extends SentinelBean>
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).
HttpException
- If an error occurs executing the HTTP request.public PagedBeanCollection<B> list(String query, int pageSize, Iterable<String> fields, boolean getChangeCounts) throws HttpException
BeanTransporterSync
list
in interface BeanTransporterSync<B extends SentinelBean>
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.
HttpException
- If an error occurs executing the HTTP request.public PagedBeanCollection<B> list() throws HttpException
BeanTransporterSync
list
in interface BeanTransporterSync<B extends SentinelBean>
HttpException
- If an error occurs executing the HTTP request.public B get(String url, Iterable<String> fields) throws HttpException
BeanTransporterSync
get
in interface BeanTransporterSync<B extends SentinelBean>
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).
HttpException
- If an error occurs executing the HTTP request.public byte[] getOctetData(String url) throws HttpException
BeanTransporterSync
getOctetData
in interface BeanTransporterSync<B extends SentinelBean>
url
- The reference to the attribute value.
HttpException
- If an error occurs executing the HTTP request.public void put(B bean) throws BeanSerializationException, HttpException
BeanTransporterSync
put
in interface BeanTransporterSync<B extends SentinelBean>
bean
- The bean containing the updated data (must have been obtained from a list
or get
call.
BeanSerializationException
HttpException
- If an error occurs executing the HTTP request.public void put(String url, byte[] data) throws HttpException
BeanTransporterSync
put
in interface BeanTransporterSync<B extends SentinelBean>
url
- The reference to the attribute value.data
- The octet stream data for the attribute value.
HttpException
- If an error occurs executing the HTTP request.public String post(B bean) throws BeanSerializationException, HttpException
BeanTransporterSync
post
in interface BeanTransporterSync<B extends SentinelBean>
bean
- The bean containing the data for the new instance.
BeanSerializationException
- If an error occurs transforming the bean data into HTTP request data.
HttpException
- If an error occurs executing the HTTP request.public void delete(String url) throws HttpException
BeanTransporterSync
delete
in interface BeanTransporterSync<B extends SentinelBean>
url
- The URL specifying the data instance to be deleted.
HttpException
- If an error occurs executing the HTTP request.public void delete(B bean) throws HttpException
BeanTransporterSync
delete
in interface BeanTransporterSync<B extends SentinelBean>
bean
- The representation of the data instance to be deleted (must have been obtained from a list
or get
call.
HttpException
- If an error occurs executing the HTTP request.public void cleanup(String url) throws HttpException
BeanTransporterSync
cleanup
in interface BeanTransporterSync<B extends SentinelBean>
url
- The URL representing the resource to clean up.
HttpException
- If an error occurs executing the HTTP request.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |