public class BaseBackendResource extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseBackendResource.BackendFailureException
An exception which may be thrown from a BackendOperation invoke()
method with a message containing details of the operation failure.
|
protected class |
BaseBackendResource.EntityNotFoundException
A BackendFailureException subclass specifically indicating that
the entity targeted by the operation does not exist.
|
protected class |
BaseBackendResource.WebFaultException |
Modifier and Type | Field and Description |
---|---|
protected BackendLocal |
backend |
protected javax.ws.rs.core.HttpHeaders |
httpHeaders |
protected static LogCompat |
LOG |
protected MessageBundle |
messageBundle |
protected SessionHelper |
sessionHelper |
protected javax.ws.rs.core.UriInfo |
uriInfo |
Constructor and Description |
---|
BaseBackendResource() |
Modifier and Type | Method and Description |
---|---|
protected <T> List<T> |
asCollection(Class<T> clz,
Object o) |
protected Guid |
asGuid(NGuid nGuid) |
protected Guid |
asGuid(String id) |
protected String |
combine(String head,
String tail) |
protected Fault |
fault(String reason,
String detail) |
BackendLocal |
getBackend() |
protected Current |
getCurrent() |
protected Locale |
getEffectiveLocale() |
javax.ws.rs.core.HttpHeaders |
getHttpHeaders() |
MessageBundle |
getMessageBundle() |
SessionHelper |
getSessionHelper() |
javax.ws.rs.core.UriInfo |
getUriInfo() |
protected <T> T |
handleError(Class<T> clz,
Exception e,
boolean notFoundAs404)
Handle a BackendFailureException or an exception thrown from a
backend query/action and re-throw as a WebApplicationException.
|
protected <T> T |
handleError(Exception e,
boolean notFoundAs404)
Handle a BackendFailureException or an exception thrown from a
backend query/action and re-throw as a WebApplicationException.
|
protected <T> T |
instantiate(Class<T> clz) |
protected String |
localize(List<String> errors) |
protected String |
localize(Messages message,
Object... parameters) |
protected String |
localize(String error) |
protected <P extends VdcActionParametersBase> |
sessionize(P parameters) |
protected <P extends VdcQueryParametersBase> |
sessionize(P parameters) |
void |
setBackend(BackendLocal backend) |
void |
setHttpHeaders(javax.ws.rs.core.HttpHeaders httpHeaders) |
void |
setMessageBundle(MessageBundle messageBundle) |
void |
setSessionHelper(SessionHelper sessionHelper) |
void |
setUriInfo(javax.ws.rs.core.UriInfo uriInfo) |
<E extends Enum<E>> |
validateEnum(Class<E> clz,
String name) |
void |
validateParameters(Object model,
int frameOffset,
String... required) |
void |
validateParameters(Object model,
String... required) |
protected static final LogCompat LOG
protected BackendLocal backend
protected SessionHelper sessionHelper
protected MessageBundle messageBundle
protected javax.ws.rs.core.UriInfo uriInfo
protected javax.ws.rs.core.HttpHeaders httpHeaders
public void setBackend(BackendLocal backend)
public BackendLocal getBackend()
public void setSessionHelper(SessionHelper sessionHelper)
public SessionHelper getSessionHelper()
public void setMessageBundle(MessageBundle messageBundle)
public MessageBundle getMessageBundle()
public javax.ws.rs.core.UriInfo getUriInfo()
@Context public void setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
public javax.ws.rs.core.HttpHeaders getHttpHeaders()
@Context public void setHttpHeaders(javax.ws.rs.core.HttpHeaders httpHeaders)
protected Current getCurrent()
protected <P extends VdcQueryParametersBase> P sessionize(P parameters)
protected <P extends VdcActionParametersBase> P sessionize(P parameters)
protected <T> T handleError(Exception e, boolean notFoundAs404)
e
- the exception to handlenotFoundAs404
- whether to return a 404 if appropriateprotected <T> T handleError(Class<T> clz, Exception e, boolean notFoundAs404)
clz
- dummy explicit type parameter for use when type
inference is not possible (irrelevant in any case as a value
is never returned, rather an exception is always thrown)e
- the exception to handlenotFoundAs404
- whether to return a 404 if appropriateprotected <T> T instantiate(Class<T> clz)
protected Locale getEffectiveLocale()
public void validateParameters(Object model, int frameOffset, String... required)
Copyright © 2012. All Rights Reserved.