VolD 0.1

de.zib.vold.client.RESTClient Class Reference

The VolD REST based client api. More...

Inheritance diagram for de.zib.vold.client.RESTClient:
Collaboration diagram for de.zib.vold.client.RESTClient:

List of all members.

Public Member Functions

 RESTClient ()
 Construct an uninitialized RESTClient.
 RESTClient (String baseURL)
 Construct a RESTClient with all necessary informations.
void setBaseURL (String baseURL)
 Set the URL of the remote REST based VolD service.
void setEnc (String enc)
 Set the encoding used to encode all keys.
void checkState ()
 Check the state of the object.
Map< String, String > insert (String source, Map< Key, Set< String > > map)
 Insert a set of keys.
Map< String, String > refresh (String source, Set< Key > set)
 Refresh a set of keys.
Map< String, String > delete (String source, Set< Key > set)
 Delete a set of keys.
Map< Key, Set< String > > lookup (Set< Key > keys)
 Query a set of keys.
Map< String, String > insert (String source, Key key, Set< String > values)
 Insert a single key.
Map< Key, Set< String > > lookup (Key key)
 Query a key.

Protected Attributes

final Logger log = LoggerFactory.getLogger( this.getClass() )

Private Member Functions

String getGreatestCommonPrefix (Collection< String > words)
 Get the largest prefix shared by a set of words.
String getCommonPrefix (String a, String b)
 Get the greatest common prefix of two strings.
String buildURI (Collection< Key > keys)
 Build a URI requesting a set of keys from the remote VolD.

Private Attributes

String baseURL
ApplicationContext context
RestTemplate rest
String enc = "utf-8"

Detailed Description

The VolD REST based client api.

See also:
RESTController

Definition at line 33 of file RESTClient.java.


Constructor & Destructor Documentation

de.zib.vold.client.RESTClient.RESTClient ( )
de.zib.vold.client.RESTClient.RESTClient ( String  baseURL)

Construct a RESTClient with all necessary informations.

Parameters:
baseURLThe URL of the remote REST based VolD service.

Definition at line 65 of file RESTClient.java.

References de.zib.vold.client.RESTClient.baseURL, de.zib.vold.client.RESTClient.context, and de.zib.vold.client.RESTClient.rest.


Member Function Documentation

String de.zib.vold.client.RESTClient.buildURI ( Collection< Key keys) [private]

Build a URI requesting a set of keys from the remote VolD.

Parameters:
keysThe set of keys to request.
Returns:
The URL defining the request.

Definition at line 486 of file RESTClient.java.

References de.zib.vold.client.RESTClient.baseURL.

Referenced by de.zib.vold.client.RESTClient.delete(), de.zib.vold.client.RESTClient.insert(), de.zib.vold.client.RESTClient.lookup(), and de.zib.vold.client.RESTClient.refresh().

Here is the caller graph for this function:

void de.zib.vold.client.RESTClient.checkState ( )
Map< String, String > de.zib.vold.client.RESTClient.delete ( String  source,
Set< Key set 
)
String de.zib.vold.client.RESTClient.getCommonPrefix ( String  a,
String  b 
) [private]

Get the greatest common prefix of two strings.

Parameters:
aA string.
bA string.
Returns:
The greatest common prefix of both strings.

Definition at line 462 of file RESTClient.java.

Referenced by de.zib.vold.client.RESTClient.getGreatestCommonPrefix().

Here is the caller graph for this function:

String de.zib.vold.client.RESTClient.getGreatestCommonPrefix ( Collection< String >  words) [private]

Get the largest prefix shared by a set of words.

Parameters:
wordsThe set of words to get the largest prefix from.
Returns:
The greatest common prefix.

Definition at line 438 of file RESTClient.java.

References de.zib.vold.client.RESTClient.getCommonPrefix().

Referenced by de.zib.vold.client.RESTClient.delete(), de.zib.vold.client.RESTClient.insert(), and de.zib.vold.client.RESTClient.refresh().

Here is the call graph for this function:

Here is the caller graph for this function:

Map< String, String > de.zib.vold.client.RESTClient.insert ( String  source,
Key  key,
Set< String >  values 
)

Insert a single key.

Parameters:
sourceThe source of the key.
keyThe key to store.
valuesThe values associated with the key.

Definition at line 412 of file RESTClient.java.

References de.zib.vold.client.RESTClient.insert().

Here is the call graph for this function:

Map< String, String > de.zib.vold.client.RESTClient.insert ( String  source,
Map< Key, Set< String > >  map 
)
Map< Key, Set< String > > de.zib.vold.client.RESTClient.lookup ( Key  key)

Query a key.

Parameters:
keythe key to lookup.
Returns:
A map containing the key and its values if found, an empty map otherwise.

Definition at line 425 of file RESTClient.java.

References de.zib.vold.client.RESTClient.lookup().

Here is the call graph for this function:

Map< Key, Set< String > > de.zib.vold.client.RESTClient.lookup ( Set< Key keys)

Query a set of keys.

Parameters:
keysThe set of keys to query
Returns:
The set of found keys with its values.

Implements de.zib.vold.common.VoldInterface.

Definition at line 342 of file RESTClient.java.

References de.zib.vold.client.RESTClient.baseURL, de.zib.vold.client.RESTClient.buildURI(), de.zib.vold.client.RESTClient.checkState(), de.zib.vold.client.RESTClient.log, and de.zib.vold.client.RESTClient.rest.

Referenced by de.zib.vold.client.RESTClient.lookup().

Here is the call graph for this function:

Here is the caller graph for this function:

Map< String, String > de.zib.vold.client.RESTClient.refresh ( String  source,
Set< Key set 
)
void de.zib.vold.client.RESTClient.setBaseURL ( String  baseURL)

Set the URL of the remote REST based VolD service.

Parameters:
baseURLThe remote URL of VolD.

Definition at line 83 of file RESTClient.java.

References de.zib.vold.client.RESTClient.baseURL.

Referenced by de.zib.vold.replication.RESTVoldReplicator.setBaseURL().

Here is the caller graph for this function:

void de.zib.vold.client.RESTClient.setEnc ( String  enc)

Set the encoding used to encode all keys.

Definition at line 91 of file RESTClient.java.

References de.zib.vold.client.RESTClient.enc.


Member Data Documentation

ApplicationContext de.zib.vold.client.RESTClient.context [private]

Definition at line 39 of file RESTClient.java.

Referenced by de.zib.vold.client.RESTClient.RESTClient().


The documentation for this class was generated from the following file: