net.derquinse.bocas.jersey
Class BocasResources

java.lang.Object
  extended by net.derquinse.common.base.NotInstantiable
      extended by net.derquinse.bocas.jersey.BocasResources

public final class BocasResources
extends NotInstantiable

Resource constants for Bocas RESTful API.

Author:
Andres Rodriguez.

Field Summary
static String CATALOG
          Catalog resource.
static String KEY
          Key query parameter.
static Splitter KEY_SPLITTER
          Key response splitter.
static String ZIP
          Zip resource.
static String ZIPGZIP
          Zip and GZip resource.
 
Method Summary
static String checkKey(ByteString key)
          Turns a non-null key into a string.
static String czip2response(Map<String,MaybeCompressed<ByteString>> entries)
           
static String iterable2String(Iterable<ByteString> keys)
          Turns a collection of keys into a string.
static Map<String,MaybeCompressed<ByteString>> response2czip(String response)
           
static List<ByteString> response2List(String response)
          Turns a text/plain response into a list of keys.
static Map<String,ByteString> response2zip(String response)
           
static StreamingOutput value2Output(BocasValue value)
          Turns a Bocas value into an streaming output.
static String zip2response(Map<String,ByteString> entries)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SPLITTER

public static final Splitter KEY_SPLITTER
Key response splitter.


KEY

public static final String KEY
Key query parameter.

See Also:
Constant Field Values

CATALOG

public static final String CATALOG
Catalog resource.

See Also:
Constant Field Values

ZIP

public static final String ZIP
Zip resource.

See Also:
Constant Field Values

ZIPGZIP

public static final String ZIPGZIP
Zip and GZip resource.

See Also:
Constant Field Values
Method Detail

checkKey

public static String checkKey(ByteString key)
Turns a non-null key into a string.


iterable2String

public static String iterable2String(Iterable<ByteString> keys)
Turns a collection of keys into a string.


response2List

public static List<ByteString> response2List(@Nullable
                                             String response)
Turns a text/plain response into a list of keys.

Throws:
BocasException - if unable to perform the conversion.

value2Output

public static StreamingOutput value2Output(BocasValue value)
Turns a Bocas value into an streaming output.


zip2response

public static String zip2response(Map<String,ByteString> entries)

czip2response

public static String czip2response(Map<String,MaybeCompressed<ByteString>> entries)

response2zip

public static Map<String,ByteString> response2zip(String response)

response2czip

public static Map<String,MaybeCompressed<ByteString>> response2czip(String response)


Copyright © 2013 Derquinse Projects. All Rights Reserved.