@Singleton @Path(value="/") public class AgentServices extends Object
| Constructor and Description |
|---|
AgentServices() |
| Modifier and Type | Method and Description |
|---|---|
protected Attachment |
generateAttachmentForException(Throwable e) |
protected Attachment |
generateAttachmentForStacktrace(String attachmentName,
StackTraceElement[] e) |
protected OutputMessage |
handleUnexpectedError(InputMessage inputMessage,
Exception e) |
void |
init() |
List<Token> |
listTokens() |
protected OutputMessage |
newErrorOutput(String error,
Attachment... attachments) |
OutputMessage |
process(String tokenId,
InputMessage message) |
void |
releaseToken(String tokenId) |
void |
reserveToken(String tokenId) |
@PostConstruct public void init()
@POST
@Consumes(value="application/json")
@Produces(value="application/json")
@Path(value="/token/{id}/process")
public OutputMessage process(@PathParam(value="id")
String tokenId,
InputMessage message)
@GET
@Consumes(value="application/json")
@Path(value="/token/{id}/reserve")
public void reserveToken(@PathParam(value="id")
String tokenId)
throws AgentTokenPool.InvalidTokenIdException
@GET
@Consumes(value="application/json")
@Path(value="/token/{id}/release")
public void releaseToken(@PathParam(value="id")
String tokenId)
throws AgentTokenPool.InvalidTokenIdException
protected OutputMessage handleUnexpectedError(InputMessage inputMessage, Exception e)
protected OutputMessage newErrorOutput(String error, Attachment... attachments)
protected Attachment generateAttachmentForException(Throwable e)
protected Attachment generateAttachmentForStacktrace(String attachmentName, StackTraceElement[] e)
Copyright © 2018. All rights reserved.