Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.web.jcr.rest
Class QueryHandler

    java.lang.Object
      org.modeshape.web.jcr.rest.QueryHandler

    @Immutable
    public class QueryHandler

extends Object

Resource handler that implements REST methods for items.

Field Summary
`protected static String` | `BASE64_ENCODING_SUFFIX`
`static String` | `EMPTY_REPOSITORY_NAME` Name to be used when the repository name is empty string as `"//"` is not a valid path.
`static String` | `EMPTY_WORKSPACE_NAME` Name to be used when the workspace name is empty string as `"//"` is not a valid path.
`protected static UrlEncoder` | `URL_ENCODER`

Constructor Summary
`QueryHandler()`

Method Summary
`protected Session` | `getSession(javax.servlet.http.HttpServletRequest request, String rawRepositoryName, String rawWorkspaceName)` Returns an active session for the given workspace name in the named repository.
`protected String` | `jsonEncodedStringFor(Value value)` Return the JSON-compatible string representation of the given property value.
`String` | `postItem(javax.servlet.http.HttpServletRequest request, String rawRepositoryName, String rawWorkspaceName, String language, String statement, long offset, long limit, javax.ws.rs.core.UriInfo uriInfo)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### BASE64_ENCODING_SUFFIX

    protected static final String BASE64_ENCODING_SUFFIX

See Also:
  Constant Field Values

### URL_ENCODER

    protected static final UrlEncoder URL_ENCODER

### EMPTY_REPOSITORY_NAME

    public static final String EMPTY_REPOSITORY_NAME

  Name to be used when the repository name is empty string as `"//"` is not a valid path.

  See Also:
    Constant Field Values

### EMPTY_WORKSPACE_NAME

    public static final String EMPTY_WORKSPACE_NAME

  Name to be used when the workspace name is empty string as `"//"` is not a valid path.

  See Also:
    Constant Field Values

Constructor Detail

### QueryHandler

    public QueryHandler()

Method Detail

### postItem

    public String postItem(javax.servlet.http.HttpServletRequest request,
                           String rawRepositoryName,
                           String rawWorkspaceName,
                           String language,
                           String statement,
                           long offset,
                           long limit,
                           javax.ws.rs.core.UriInfo uriInfo)
                    throws InvalidQueryException,
                           RepositoryException,
                           org.codehaus.jettison.json.JSONException

  Throws:
    `InvalidQueryException`
    `RepositoryException`
    `org.codehaus.jettison.json.JSONException`

### getSession

    protected Session getSession(javax.servlet.http.HttpServletRequest request,
                                 String rawRepositoryName,
                                 String rawWorkspaceName)
                          throws RepositoryException

  Returns an active session for the given workspace name in the named repository.

  Parameters:
    `request` - the servlet request; may not be null or unauthenticated
    `rawRepositoryName` - the URL-encoded name of the repository in which the session is created
    `rawWorkspaceName` - the URL-encoded name of the workspace to which the session should be connected
  Returns:
    an active session with the given workspace in the named repository
  Throws:
    `RepositoryException` - if any other error occurs

### jsonEncodedStringFor

    protected String jsonEncodedStringFor(Value value)
                                   throws RepositoryException

  Return the JSON-compatible string representation of the given property value. If the value is a `binary` value, then this method returns the Base-64 encoding of that value. Otherwise, it just returns the string representation of the value.

  Parameters:
    `value` - the property value; may not be null
  Returns:
    the string representation of the value
  Throws:
    `RepositoryException` - if there is a problem accessing the value

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.