org.ow2.jasmine.probe.rest.impl
Class JProbes

java.lang.Object
  extended by org.ow2.jasmine.probe.rest.impl.JProbes
All Implemented Interfaces:
Probes

public class JProbes
extends Object
implements Probes

Implements REST API for probes management : org.ow2.jasmine.probe.rest.Probes

Author:
danesa

Field Summary
 
Fields inherited from interface org.ow2.jasmine.probe.rest.Probes
RESOURCE_NAME, START_ACTION, STOP_ACTION
 
Constructor Summary
JProbes(JasmineProbeManager jpManager, TasksManager taskManager)
           
 
Method Summary
 javax.ws.rs.core.Response changeProbe(ProbeConfType probeDef, String probeId)
          PUT http://host:port/jprobe/probe/{probeId} Change a probe
 javax.ws.rs.core.Response changeProbePeriod(String probeId, String newPeriod)
          Process HTTP PUT requests having /probe/{id}/period allowing to change a probe's period
 javax.ws.rs.core.Response createProbe(ProbeType probeDef)
          POST http://host:port/jprobe/probe Create a new probe - corresponds to probe-create command.
 javax.ws.rs.core.Response deleteDataTask(String probeId)
          Process HTTP DELETE requests having /probe/{id}/data URI Removes the data task created for the probe
 javax.ws.rs.core.Response deleteProbe(String probeId)
          Process HTTP DELETE requests having /probe/{id} URI Corresponds to probe-remove id
 javax.ws.rs.core.Response getDataTask(String probeId, javax.ws.rs.core.UriInfo ui)
          Process HTTP POST requests having /probe/{id}/data URI Creates a data task for this probe allowing to get collected results from this task.
 javax.ws.rs.core.Response getProbe(String probeId, javax.ws.rs.core.UriInfo ui)
          Process HTTP GET requests having /probe/{id} URI Corresponds to probe-list -n id
 javax.ws.rs.core.Response getProbes(javax.ws.rs.core.UriInfo ui)
          Process HTTP GET requests having /probe URI Corresponds to probe-list command
 javax.ws.rs.core.Response setState(String probeId, String actionName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JProbes

public JProbes(JasmineProbeManager jpManager,
               TasksManager taskManager)
Method Detail

getProbes

public javax.ws.rs.core.Response getProbes(javax.ws.rs.core.UriInfo ui)
Description copied from interface: Probes
Process HTTP GET requests having /probe URI Corresponds to probe-list command

Specified by:
getProbes in interface Probes
Returns:
response containing the existent probe ids.

getProbe

public javax.ws.rs.core.Response getProbe(String probeId,
                                          javax.ws.rs.core.UriInfo ui)
Description copied from interface: Probes
Process HTTP GET requests having /probe/{id} URI Corresponds to probe-list -n id

Specified by:
getProbe in interface Probes
Returns:
response

createProbe

public javax.ws.rs.core.Response createProbe(ProbeType probeDef)
POST http://host:port/jprobe/probe Create a new probe - corresponds to probe-create command. The probeDef may contain the new probe's id. Otherwise, the id is generated by JasmineProbe.

Specified by:
createProbe in interface Probes
Parameters:
probeDef - new probe's definition
Returns:
status may be - CRETED (201) if creation successful (in this case the response contains the new probe's URI) - BAD_REQUEST (400) if failure (for example trying to create a probe while the provided id exists)

changeProbe

public javax.ws.rs.core.Response changeProbe(ProbeConfType probeDef,
                                             String probeId)
PUT http://host:port/jprobe/probe/{probeId} Change a probe

Specified by:
changeProbe in interface Probes
Parameters:
probeId - the id of the probe to update
probeDef - contains the updated configuration
Returns:
status may be - OK (200) if change successful - NOT_FOUND if no probe with probeId exists

changeProbePeriod

public javax.ws.rs.core.Response changeProbePeriod(String probeId,
                                                   String newPeriod)
Description copied from interface: Probes
Process HTTP PUT requests having /probe/{id}/period allowing to change a probe's period

Specified by:
changeProbePeriod in interface Probes
Parameters:
probeId - probe to change
newPeriod - updated period
Returns:

deleteProbe

public javax.ws.rs.core.Response deleteProbe(String probeId)
Description copied from interface: Probes
Process HTTP DELETE requests having /probe/{id} URI Corresponds to probe-remove id

Specified by:
deleteProbe in interface Probes

setState

public javax.ws.rs.core.Response setState(String probeId,
                                          String actionName)
Specified by:
setState in interface Probes

getDataTask

public javax.ws.rs.core.Response getDataTask(String probeId,
                                             javax.ws.rs.core.UriInfo ui)
Description copied from interface: Probes
Process HTTP POST requests having /probe/{id}/data URI Creates a data task for this probe allowing to get collected results from this task.

Specified by:
getDataTask in interface Probes

deleteDataTask

public javax.ws.rs.core.Response deleteDataTask(String probeId)
Description copied from interface: Probes
Process HTTP DELETE requests having /probe/{id}/data URI Removes the data task created for the probe

Specified by:
deleteDataTask in interface Probes


Copyright © 2012 OW2 Consortium. All Rights Reserved.