|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.resource.Resource
org.restlet.resource.UniformResource
org.restlet.resource.ServerResource
de.twenty11.skysail.server.restlet.SkysailServerResource2<T>
de.twenty11.skysail.server.restlet.ListServerResource<T>
public class ListServerResource<T>
An class dealing with common functionality for a skysail server resource..
The class is not abstract in order to let jackson deserialize json requests more easily.
Concurrency note from parent: contrary to the Uniform class and its main Restlet subclass
where a single instance can handle several calls concurrently, one instance of ServerResource is created for
each call handled and accessed by only one thread at a time.
| Constructor Summary | |
|---|---|
ListServerResource()
|
|
| Method Summary | |
|---|---|
protected de.twenty11.skysail.common.responses.Response<de.twenty11.skysail.common.forms.ConstraintViolations<T>> |
addEntity(javax.persistence.EntityManager em,
T entity,
de.twenty11.skysail.common.forms.ConstraintViolations<T> constraintViolations)
|
void |
buildGrid()
|
protected de.twenty11.skysail.common.responses.Response<String> |
deleteEntity(javax.persistence.EntityManager em,
T entity)
|
protected int |
doHandlePagination(String configIdentifier,
int defaultSize)
|
protected Integer |
getCurrentPage()
|
protected de.twenty11.skysail.common.responses.Response<List<T>> |
getEntities(List<T> data,
String defaultMsg)
|
protected de.twenty11.skysail.common.responses.Response<T> |
getEntity(T data)
|
T |
getFilteredData()
Implementors of this class have to provide skysailData which will be used to create a restlet representation. |
protected Integer |
getPageSize()
|
protected Map<String,String> |
getParamsFromRequest()
|
int |
getTotalResults()
|
protected javax.validation.Validator |
getValidator()
|
int |
handlePagination()
|
void |
setCurrentPage(Integer currentPage)
|
void |
setPageSize(Integer pageSize)
|
protected void |
setTotalResults(int length)
|
| Methods inherited from class de.twenty11.skysail.server.restlet.SkysailServerResource2 |
|---|
describe, describe, describe, describe, describe, describe, describeDelete, describeGet, describeMethod, describeOptions, describeParameters, describePost, describePut, determineValue, getDescription, getMessage, getName, getParent, getResourcePath, getSkysailData, options, setAutoDescribing, setDescription, setLocationRef, setLocationRef, setMessage, setName, setSkysailData |
| Methods inherited from class org.restlet.resource.ServerResource |
|---|
abort, commit, delete, delete, describeVariants, doCatch, doConditionalHandle, doError, doHandle, doHandle, doNegotiatedHandle, get, get, getAttribute, getInfo, getInfo, getOnSent, getPreferredVariant, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions |
| Methods inherited from class org.restlet.resource.Resource |
|---|
doError, doInit, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getContext, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toObject, toRepresentation, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ListServerResource()
| Method Detail |
|---|
public void buildGrid()
public int handlePagination()
protected de.twenty11.skysail.common.responses.Response<List<T>> getEntities(List<T> data,
String defaultMsg)
protected de.twenty11.skysail.common.responses.Response<T> getEntity(T data)
protected de.twenty11.skysail.common.responses.Response<String> deleteEntity(javax.persistence.EntityManager em,
T entity)
protected de.twenty11.skysail.common.responses.Response<de.twenty11.skysail.common.forms.ConstraintViolations<T>> addEntity(javax.persistence.EntityManager em,
T entity,
de.twenty11.skysail.common.forms.ConstraintViolations<T> constraintViolations)
protected javax.validation.Validator getValidator()
public final T getFilteredData()
protected int doHandlePagination(String configIdentifier,
int defaultSize)
protected Map<String,String> getParamsFromRequest()
protected Integer getPageSize()
public void setPageSize(Integer pageSize)
protected Integer getCurrentPage()
public void setCurrentPage(Integer currentPage)
protected void setTotalResults(int length)
public int getTotalResults()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||