com.sibvisions.rad.server.http.rest
Class AbstractStorageServerResource

java.lang.Object
  extended by org.restlet.resource.Resource
      extended by org.restlet.resource.UniformResource
          extended by org.restlet.resource.ServerResource
              extended by com.sibvisions.rad.server.http.rest.AbstractStorageServerResource

public class AbstractStorageServerResource
extends org.restlet.resource.ServerResource

The AbstractStorageServerResource lists all available records of an AbstractStorage.


Constructor Summary
AbstractStorageServerResource()
           
 
Method Summary
 org.restlet.representation.Representation executeDelete()
          Deletes records from the storage.
 org.restlet.representation.Representation executeFetch()
          Fetches records from the storage.
 org.restlet.representation.Representation executeGetMetaData()
          Gets the metadata for the storage.
 org.restlet.representation.Representation executeInsert(org.restlet.representation.Representation pRepresentation)
          Inserts a new record.
 org.restlet.representation.Representation executeUpdate(org.restlet.representation.Representation pRepresentation)
          Updates a record.
 
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, options, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDimensions, setExisting, setLocationRef, setLocationRef, 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

AbstractStorageServerResource

public AbstractStorageServerResource()
Method Detail

executeFetch

@Get
public org.restlet.representation.Representation executeFetch()
                                                       throws Throwable
Fetches records from the storage. It is possible to filter the result if query parameters are used.

Returns:
the records as JSON representation
Throws:
Throwable - if fetch fails

executeInsert

@Post
public org.restlet.representation.Representation executeInsert(org.restlet.representation.Representation pRepresentation)
                                                        throws Throwable
Inserts a new record.

Parameters:
pRepresentation - the new record
Returns:
the inserted record
Throws:
Throwable - if insert fails

executeUpdate

@Put
public org.restlet.representation.Representation executeUpdate(org.restlet.representation.Representation pRepresentation)
                                                        throws Throwable
Updates a record. It is not possible to change columns that are primary key columns.

Parameters:
pRepresentation - the new record
Returns:
the updated record
Throws:
Throwable - if update fails

executeDelete

@Delete
public org.restlet.representation.Representation executeDelete()
                                                        throws Throwable
Deletes records from the storage. It is possible to delete more than one row if query parameters are used. If no record is found, the NOT_FOUND status is set. If PK is used and more than one records were found, the CONFLICT status is set.

Returns:
the number of deleted records
Throws:
Throwable - if delete fails

executeGetMetaData

@Options
public org.restlet.representation.Representation executeGetMetaData()
                                                             throws Throwable
Gets the metadata for the storage.

Returns:
the metadata
Throws:
Throwable - if metadata detection fails


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.