org.openrdf.http.protocol
Class Protocol

java.lang.Object
  extended by org.openrdf.http.protocol.Protocol

public abstract class Protocol
extends Object


Field Summary
static String ACCEPT_PARAM_NAME
          Parameter name for the Accept parameter (may also be used as the name of the Accept HTTP header).
static String AMOUNT
           
static String BASEURI_PARAM_NAME
          Parameter name for the base-URI parameter.
static String BEGIN
           
static String BINDING_PREFIX
          Parameter prefix for query-external variable bindings.
static String BINDINGS_QUERY
          Value for X_QUERY_TYPE for tuple query results.
static String BNODE
           
static String BNODES
           
static String BOOLEAN_QUERY
          Value for X_QUERY_TYPE for boolean query results.
static String COMMIT
           
static String CONFIG
          Relative location of the config resource.
static String CONFIGURATIONS
          Relative location of the repository configurations resource.
static String CONN_PATH
           
static String CONNECTIONS
           
static String CONTEXT_PARAM_NAME
          Parameter name for the context parameter.
static String CONTEXTS
          Relative location of the context list resource of a repository.
static String DEFAULT_GRAPH_PARAM_NAME
          Parameter name for the default graph URI parameter.
static String FORM_MIME_TYPE
          MIME type for www forms: application/x-www-form-urlencoded.
static String GRAPH_QUERY
          Value for X_QUERY_TYPE for graph query results.
static String IF_NONE_MATCH
           
static String INCLUDE_INFERRED_PARAM_NAME
          Parameter name for the 'includeInferred' parameter.
static String LIMIT
           
static long MAX_TIME_OUT
           
static String METADATA
           
static String METADATA_NAMESPACE
           
static long MIN_TIME_OUT
           
static String NAMED_GRAPH_PARAM_NAME
          Parameter name for the named graph URI parameter.
static String NAMESPACE
           
static String NAMESPACES
          Relative location of the namespaces list resource of a repository.
static String NODE_ID
           
static String NULL_PARAM_VALUE
          Parameter value for the NULL context.
static String OBJECT_PARAM_NAME
          Parameter name for the 'object' parameter of statement query.
static String OFFSET
           
static String PING
           
static String PREDICATE_PARAM_NAME
          Parameter name for the 'predicate' parameter of a statement query.
static String PREFIX
           
static String PROTOCOL
          Relative location of the protocol resource.
static String QUERIES
           
static String QUERY_LANGUAGE_PARAM_NAME
          Parameter name for the query language parameter.
static String QUERY_PARAM_NAME
          Parameter name for the query parameter.
static String REPO_PATH
           
static String REPOSITORIES
          Relative location of the repository list resource.
static String ROLLBACK
           
static String SCHEMAS
          Relative location of the template schemas resource.
static String SIZE
          Relative location of the 'size' resource of a repository.
static String STATEMENTS
          Relative location of the statement list resource of a repository.
static String SUBJECT_PARAM_NAME
          Parameter name for the 'subject' parameter of a statement query.
static String TEMPLATES
          Relative location of the templates resource.
static TimeUnit TIME_OUT_UNITS
           
static String TXN_MIME_TYPE
          MIME type for transactions: application/x-rdftransaction.
static String VERSION
          Protocol version.
static String X_QUERY_TYPE
          Custom header used to convey query types from a server to a client.
 
Constructor Summary
Protocol()
           
 
Method Summary
static Resource decodeContext(String encodedValue, ValueFactory valueFactory)
          Decode a previously encoded context Resource.
static Resource[] decodeContexts(String[] encodedValues, ValueFactory valueFactory)
          Decode previously encoded contexts.
static Resource decodeResource(String encodedValue, ValueFactory valueFactory)
          Decode a previously encoded Resource.
static URI decodeURI(String encodedValue, ValueFactory valueFactory)
          Decode a previously encoded URI.
static Value decodeValue(String encodedValue, ValueFactory valueFactory)
          Decode a previously encoded value.
static String encodeContext(Resource context)
          Encodes a context resource for use in a URL.
static String[] encodeContexts(Resource... contexts)
          Encode context resources for use in a URL.
static String encodeValue(Value value)
          Encodes a value for use in a URL.
static String getConfigLocation(String serverLocation)
          Get the location of the server configuration resource on the specified server.
static String getContextsLocation(String repositoryLocation)
          Get the location of the contexts lists resource for a specific repository.
static String getNamespacePrefixLocation(String repositoryLocation, String prefix)
          Get the location of the namespace with the specified prefix for a specific repository on the specified server.
static String getNamespacesLocation(String repositoryLocation)
          Get the location of the namespaces lists resource for a specific repository on the specified server.
static String getProtocolLocation(String serverLocation)
          Get the location of the protocol resource on the specified server.
static String getRepositoriesLocation(String serverLocation)
          Get the location of the repository list resource on the specified server.
static String getRepositoryLocation(String serverLocation, String repositoryID)
          Get the location of a specific repository resource on the specified server.
static String getServerLocation(String repositoryLocation)
          Get the location of server containing the specified repository resource.
static String getSizeLocation(String repositoryLocation)
          Get the location of the 'size' resource for a specific repository on the specified server.
static String getStatementsLocation(String repositoryLocation)
          Get the location of the statements resource for a specific repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
Protocol version.

See Also:
Constant Field Values

SUBJECT_PARAM_NAME

public static final String SUBJECT_PARAM_NAME
Parameter name for the 'subject' parameter of a statement query.

See Also:
Constant Field Values

PREDICATE_PARAM_NAME

public static final String PREDICATE_PARAM_NAME
Parameter name for the 'predicate' parameter of a statement query.

See Also:
Constant Field Values

OBJECT_PARAM_NAME

public static final String OBJECT_PARAM_NAME
Parameter name for the 'object' parameter of statement query.

See Also:
Constant Field Values

INCLUDE_INFERRED_PARAM_NAME

public static final String INCLUDE_INFERRED_PARAM_NAME
Parameter name for the 'includeInferred' parameter.

See Also:
Constant Field Values

CONTEXT_PARAM_NAME

public static final String CONTEXT_PARAM_NAME
Parameter name for the context parameter.

See Also:
Constant Field Values

NULL_PARAM_VALUE

public static final String NULL_PARAM_VALUE
Parameter value for the NULL context.

See Also:
Constant Field Values

BASEURI_PARAM_NAME

public static final String BASEURI_PARAM_NAME
Parameter name for the base-URI parameter.

See Also:
Constant Field Values

QUERY_PARAM_NAME

public static final String QUERY_PARAM_NAME
Parameter name for the query parameter.

See Also:
Constant Field Values

QUERY_LANGUAGE_PARAM_NAME

public static final String QUERY_LANGUAGE_PARAM_NAME
Parameter name for the query language parameter.

See Also:
Constant Field Values

DEFAULT_GRAPH_PARAM_NAME

public static final String DEFAULT_GRAPH_PARAM_NAME
Parameter name for the default graph URI parameter.

See Also:
Constant Field Values

NAMED_GRAPH_PARAM_NAME

public static final String NAMED_GRAPH_PARAM_NAME
Parameter name for the named graph URI parameter.

See Also:
Constant Field Values

ACCEPT_PARAM_NAME

public static final String ACCEPT_PARAM_NAME
Parameter name for the Accept parameter (may also be used as the name of the Accept HTTP header).

See Also:
Constant Field Values

PROTOCOL

public static final String PROTOCOL
Relative location of the protocol resource.

See Also:
Constant Field Values

CONFIG

public static final String CONFIG
Relative location of the config resource.

See Also:
Constant Field Values

REPOSITORIES

public static final String REPOSITORIES
Relative location of the repository list resource.

See Also:
Constant Field Values

STATEMENTS

public static final String STATEMENTS
Relative location of the statement list resource of a repository.

See Also:
Constant Field Values

CONTEXTS

public static final String CONTEXTS
Relative location of the context list resource of a repository.

See Also:
Constant Field Values

NAMESPACES

public static final String NAMESPACES
Relative location of the namespaces list resource of a repository.

See Also:
Constant Field Values

BINDING_PREFIX

public static final String BINDING_PREFIX
Parameter prefix for query-external variable bindings.

See Also:
Constant Field Values

SIZE

public static final String SIZE
Relative location of the 'size' resource of a repository.

See Also:
Constant Field Values

CONFIGURATIONS

public static final String CONFIGURATIONS
Relative location of the repository configurations resource.

See Also:
Constant Field Values

TEMPLATES

public static final String TEMPLATES
Relative location of the templates resource.

See Also:
Constant Field Values

SCHEMAS

public static final String SCHEMAS
Relative location of the template schemas resource.

See Also:
Constant Field Values

X_QUERY_TYPE

public static final String X_QUERY_TYPE
Custom header used to convey query types from a server to a client. The client can use the header to decide which set of result parsers are relevant for the response body.

See Also:
Constant Field Values

BINDINGS_QUERY

public static final String BINDINGS_QUERY
Value for X_QUERY_TYPE for tuple query results.

See Also:
Constant Field Values

GRAPH_QUERY

public static final String GRAPH_QUERY
Value for X_QUERY_TYPE for graph query results.

See Also:
Constant Field Values

BOOLEAN_QUERY

public static final String BOOLEAN_QUERY
Value for X_QUERY_TYPE for boolean query results.

See Also:
Constant Field Values

IF_NONE_MATCH

public static final String IF_NONE_MATCH
See Also:
Constant Field Values

TXN_MIME_TYPE

public static final String TXN_MIME_TYPE
MIME type for transactions: application/x-rdftransaction.

See Also:
Constant Field Values

FORM_MIME_TYPE

public static final String FORM_MIME_TYPE
MIME type for www forms: application/x-www-form-urlencoded.

See Also:
Constant Field Values

METADATA

public static final String METADATA
See Also:
Constant Field Values

METADATA_NAMESPACE

public static final String METADATA_NAMESPACE
See Also:
Constant Field Values

OFFSET

public static final String OFFSET
See Also:
Constant Field Values

LIMIT

public static final String LIMIT
See Also:
Constant Field Values

REPO_PATH

public static final String REPO_PATH
See Also:
Constant Field Values

CONN_PATH

public static final String CONN_PATH
See Also:
Constant Field Values

CONNECTIONS

public static final String CONNECTIONS
See Also:
Constant Field Values

BEGIN

public static final String BEGIN
See Also:
Constant Field Values

COMMIT

public static final String COMMIT
See Also:
Constant Field Values

ROLLBACK

public static final String ROLLBACK
See Also:
Constant Field Values

QUERIES

public static final String QUERIES
See Also:
Constant Field Values

AMOUNT

public static final String AMOUNT
See Also:
Constant Field Values

PING

public static final String PING
See Also:
Constant Field Values

BNODE

public static final String BNODE
See Also:
Constant Field Values

BNODES

public static final String BNODES
See Also:
Constant Field Values

MIN_TIME_OUT

public static final long MIN_TIME_OUT
See Also:
Constant Field Values

MAX_TIME_OUT

public static final long MAX_TIME_OUT
See Also:
Constant Field Values

TIME_OUT_UNITS

public static final TimeUnit TIME_OUT_UNITS

NODE_ID

public static final String NODE_ID
See Also:
Constant Field Values

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

NAMESPACE

public static final String NAMESPACE
See Also:
Constant Field Values
Constructor Detail

Protocol

public Protocol()
Method Detail

getProtocolLocation

public static final String getProtocolLocation(String serverLocation)
Get the location of the protocol resource on the specified server.

Parameters:
serverLocation - the base location of a server implementing this REST protocol.
Returns:
the location of the protocol resource on the specified server

getConfigLocation

public static final String getConfigLocation(String serverLocation)
Get the location of the server configuration resource on the specified server.

Parameters:
serverLocation - the base location of a server implementing this REST protocol.
Returns:
the location of the server configuration resource on the specified server

getRepositoriesLocation

public static final String getRepositoriesLocation(String serverLocation)
Get the location of the repository list resource on the specified server.

Parameters:
serverLocation - the base location of a server implementing this REST protocol.
Returns:
the location of the repository list resource on the specified server

getRepositoryLocation

public static final String getRepositoryLocation(String serverLocation,
                                                 String repositoryID)
Get the location of a specific repository resource on the specified server.

Parameters:
serverLocation - the base location of a server implementing this REST protocol.
repositoryID - the ID of the repository
Returns:
the location of a specific repository resource on the specified server

getServerLocation

public static final String getServerLocation(String repositoryLocation)
Get the location of server containing the specified repository resource.

Parameters:
serverLocation - the base location of a server implementing this REST protocol.
repositoryID - the ID of the repository
Returns:
the location of a specific repository resource on the specified server

getStatementsLocation

public static final String getStatementsLocation(String repositoryLocation)
Get the location of the statements resource for a specific repository.

Parameters:
repositoryLocation - the location of a repository implementing this REST protocol.
Returns:
the location of the statements resource for the specified repository

getContextsLocation

public static final String getContextsLocation(String repositoryLocation)
Get the location of the contexts lists resource for a specific repository.

Parameters:
repositoryLocation - the location of a repository implementing this REST protocol.
Returns:
the location of the contexts lists resource for the specified repository

getNamespacesLocation

public static final String getNamespacesLocation(String repositoryLocation)
Get the location of the namespaces lists resource for a specific repository on the specified server.

Parameters:
repositoryLocation - the base location of a server implementing this REST protocol.
Returns:
the location of the namespaces lists resource for a specific repository on the specified server

getNamespacePrefixLocation

public static final String getNamespacePrefixLocation(String repositoryLocation,
                                                      String prefix)
Get the location of the namespace with the specified prefix for a specific repository on the specified server.

Parameters:
repositoryLocation - the location of a repository implementing this REST protocol.
prefix - the namespace prefix
Returns:
the location of the the namespace with the specified prefix for a specific repository on the specified server

getSizeLocation

public static final String getSizeLocation(String repositoryLocation)
Get the location of the 'size' resource for a specific repository on the specified server.

Parameters:
repositoryLocation - the location of a repository implementing this REST protocol.
Returns:
the location of the 'size' resource for a specific repository on the specified server

encodeValue

public static String encodeValue(Value value)
Encodes a value for use in a URL.

Parameters:
value - The value to encode, possibly null.
Returns:
The N-Triples representation of the supplied value, or NULL_PARAM_VALUE if the supplied value was null.

decodeValue

public static Value decodeValue(String encodedValue,
                                ValueFactory valueFactory)
Decode a previously encoded value.

Parameters:
encodedValue - the encoded value
valueFactory - the factory to use for constructing the Value
Returns:
the decoded Value
See Also:
encodeValue(Value)

decodeResource

public static Resource decodeResource(String encodedValue,
                                      ValueFactory valueFactory)
Decode a previously encoded Resource.

Parameters:
encodedValue - the encoded value
valueFactory - the factory to use for constructing the Resource
Returns:
the decoded Resource
See Also:
encodeValue(Value)

decodeURI

public static URI decodeURI(String encodedValue,
                            ValueFactory valueFactory)
Decode a previously encoded URI.

Parameters:
encodedValue - the encoded value
valueFactory - the factory to use for constructing the URI
Returns:
the decoded URI
See Also:
encodeValue(Value)

encodeContext

public static String encodeContext(Resource context)
Encodes a context resource for use in a URL.

Parameters:
context - The context to encode, possibly null.
Returns:
The N-Triples representation of the supplied context, or NULL_PARAM_VALUE if the supplied value was null.

decodeContext

public static Resource decodeContext(String encodedValue,
                                     ValueFactory valueFactory)
Decode a previously encoded context Resource.

Parameters:
encodedValue - the encoded value
valueFactory - the factory to use for constructing the Resource
Returns:
the decoded Resource, or null if the encoded values was null or equal to NULL_PARAM_VALUE

encodeContexts

public static String[] encodeContexts(Resource... contexts)
Encode context resources for use in a URL.

Parameters:
contexts - the contexts to encode, must not be null.
Returns:
the encoded contexts
Throws:
IllegalArgumentException - If the contexts is null.

decodeContexts

public static Resource[] decodeContexts(String[] encodedValues,
                                        ValueFactory valueFactory)
Decode previously encoded contexts.

Parameters:
encodedValues - the encoded values
valueFactory - the factory to use for constructing the Resources
Returns:
the decoded Resources, or an empty array if the supplied encodedValues was null.


Copyright © 2001-2009 Aduna. All Rights Reserved.