API FinTP REST
 All Classes Namespaces Files Functions Variables
ro.allevo.fintpws.resources.QueueResource Class Reference

Resource class implementing /queues/{name} path methods. More...

Public Member Functions

 QueueResource (UriInfo uriInfo, EntityManager entityManagerConfig, EntityManager entityManagerData, String queueName)
 Creates a new instance of QueueResource. More...
 
JSONObject getQueue ()
 GET method : returns an application/json formatted queue. More...
 
MessagesResource getMessages ()
 Method getMessages. More...
 
Response updateQueue (JSONObject jsonEntity)
 PUT method : updates the queue. More...
 
Response deleteQueue ()
 DELETE method : deletes the queue. More...
 
String toString ()
 Method toString. More...
 

Static Public Member Functions

static QueueEntity findByName (EntityManager entityManager, String name)
 Method findByName. More...
 
static JSONObject asJson (QueueEntity queueEntity, String path) throws JSONException
 Returns the resource formatted as json. More...
 

Private Attributes

UriInfo uriInfo
 Field uriInfo. More...
 
EntityManager entityManagerConfig
 Field entityManagerConfig. More...
 
EntityManager entityManagerData
 Field entityManagerData. More...
 
QueueEntity queueEntity
 the JPA entity More...
 
String queueName
 queue name More...
 

Static Private Attributes

static Logger logger
 Field logger. More...
 

Detailed Description

Resource class implementing /queues/{name} path methods.

Author
horia
Version
Revision:
1.0

Constructor & Destructor Documentation

ro.allevo.fintpws.resources.QueueResource.QueueResource ( UriInfo  uriInfo,
EntityManager  entityManagerConfig,
EntityManager  entityManagerData,
String  queueName 
)
inline

Creates a new instance of QueueResource.

Parameters
uriInfoUriInfo actual uri passed by parent resource
queueNameString Queue name
entityManagerConfigEntityManager
entityManagerDataEntityManager

Member Function Documentation

static JSONObject ro.allevo.fintpws.resources.QueueResource.asJson ( QueueEntity  queueEntity,
String  path 
) throws JSONException
inlinestatic

Returns the resource formatted as json.

Parameters
queueEntityQueueEntity
pathString
Returns
JSONObject
Exceptions
JSONException
Response ro.allevo.fintpws.resources.QueueResource.deleteQueue ( )
inline

DELETE method : deletes the queue.

Returns
Response
static QueueEntity ro.allevo.fintpws.resources.QueueResource.findByName ( EntityManager  entityManager,
String  name 
)
inlinestatic

Method findByName.

Looks for a QueueEntity based on it's name.

Parameters
entityManagerEntityManager
nameString
Returns
QueueEntity
MessagesResource ro.allevo.fintpws.resources.QueueResource.getMessages ( )
inline

Method getMessages.

Returns
MessagesResource
JSONObject ro.allevo.fintpws.resources.QueueResource.getQueue ( )
inline

GET method : returns an application/json formatted queue.

Returns
JSONObject the queue
String ro.allevo.fintpws.resources.QueueResource.toString ( )
inline

Method toString.

Returns
String
Response ro.allevo.fintpws.resources.QueueResource.updateQueue ( JSONObject  jsonEntity)
inline

PUT method : updates the queue.

Parameters
jsonEntityJSONObject the queue holding new values
Returns
Response

Member Data Documentation

EntityManager ro.allevo.fintpws.resources.QueueResource.entityManagerConfig
private

Field entityManagerConfig.

EntityManager ro.allevo.fintpws.resources.QueueResource.entityManagerData
private

Field entityManagerData.

Logger ro.allevo.fintpws.resources.QueueResource.logger
staticprivate
Initial value:
= LogManager.getLogger(QueueResource.class
.getName())

Field logger.

QueueEntity ro.allevo.fintpws.resources.QueueResource.queueEntity
private

the JPA entity

String ro.allevo.fintpws.resources.QueueResource.queueName
private

queue name

UriInfo ro.allevo.fintpws.resources.QueueResource.uriInfo
private

Field uriInfo.


The documentation for this class was generated from the following file: