com.novell.sentinel.client.bean.java
Interface BeanTransporterSync<B extends SentinelBean>

Type Parameters:
B - Bean type (e.g., com.novell.db.object.IdentityBean).
All Known Implementing Classes:
BeanTransporterJSONSync, BeanTransporterSyncBase

public interface BeanTransporterSync<B extends SentinelBean>

A synchronous, non-callback variation of BeanTransporter for use in Java code (as opposed to GWT code).


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.
 

Method Detail

count

long count()
           throws HttpException
Get a count of the data instances available.

Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

count

long count(String query)
           throws HttpException
Get a count of the data instances available, optionally filtered by the passed query.

Parameters:
query - Optional filter for the results (may be null).
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

listFromURL

PagedBeanCollection<B> listFromURL(String url)
                                                        throws HttpException
Get a collection of the beans available at the passed URL. The URL supplied must be appropriate for the bean type <B>.

Parameters:
url - The URL specifying the beans.
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

listFromURL

PagedBeanCollection<B> listFromURL(String url,
                                   int pageSize,
                                   Iterable<String> fields)
                                                        throws HttpException
Get a collection of the data instances available at the passed URL. The URL supplied must be appropriate for the bean type <B>.

Parameters:
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).
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

listFromURL

PagedBeanCollection<B> listFromURL(String url,
                                   int pageSize,
                                   Iterable<String> fields,
                                   boolean getChangeCounts)
                                                        throws HttpException
Get a collection of the data instances available at the passed URL. The URL supplied must be appropriate for the bean type <B>.

Parameters:
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.
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

list

PagedBeanCollection<B> list(String query,
                            int pageSize,
                            Iterable<String> fields)
                                                 throws HttpException
Get a collection of the data instances available, optionally filtered by the passed query.

Parameters:
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).
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

list

PagedBeanCollection<B> list(String query,
                            int pageSize,
                            Iterable<String> fields,
                            boolean getChangeCounts)
                                                 throws HttpException
Get a collection of the data instances available, optionally filtered by the passed query.

Parameters:
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.
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

list

PagedBeanCollection<B> list()
                                                 throws HttpException
Get a collection of the beans available.

Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

get

B get(String url,
      Iterable<String> fields)
                           throws HttpException
Get the data at the passed URL in a bean.

Parameters:
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).
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

getOctetData

byte[] getOctetData(String url)
                    throws HttpException
Get the octet stream value of an object attribute referenced by the passed URL.

Parameters:
url - The reference to the attribute value.
Returns:
The result of the HTTP request.
Throws:
HttpException - If an error occurs executing the HTTP request.

put

void put(B bean)
         throws BeanSerializationException,
                HttpException
Update the underlying Sentinel data from the passed bean.

Parameters:
bean - The bean containing the updated data (must have been obtained from a list or get call.
Throws:
BeanSerializationException
HttpException - If an error occurs executing the HTTP request.

put

void put(String url,
         byte[] data)
         throws HttpException
Put the octet stream value of an object attribute referenced by the passed URL.

Parameters:
url - The reference to the attribute value.
data - The octet stream data for the attribute value.
Throws:
HttpException - If an error occurs executing the HTTP request.

post

String post(B bean)
            throws BeanSerializationException,
                   HttpException
Create a new data instance.

Parameters:
bean - The bean containing the data for the new instance.
Returns:
The result of the HTTP request (the URL to the newly-created entity).
Throws:
BeanSerializationException - If an error occurs transforming the bean data into HTTP request data.
HttpException - If an error occurs executing the HTTP request.

delete

void delete(String url)
            throws HttpException
Delete the data instance at the specified URL.

Parameters:
url - The URL specifying the data instance to be deleted.
Throws:
HttpException - If an error occurs executing the HTTP request.

delete

void delete(B bean)
            throws HttpException
Delete the data instance represented by the passed bean.

Parameters:
bean - The representation of the data instance to be deleted (must have been obtained from a list or get call.
Throws:
HttpException - If an error occurs executing the HTTP request.

cleanup

void cleanup(String url)
             throws HttpException
Issues a cleanup request to the server for the passed URL. Cleanup requests are used for certain types of resources that implicitly create server-side resources that can be freed once the client is finished with them. An example is a search job created implicitly when events are searched for using the EventBean list operation, rather than the EventSearch post operation.

Parameters:
url - The URL representing the resource to clean up.
Throws:
HttpException - If an error occurs executing the HTTP request.