Reserving a Task Scheduling a Task Submit Reserve

156 Copyright © 2011 Open Geospatial Consortium Listing 20 - Reserve request example sps:Reserve service = SPS version = 2.0.0 xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:xsi = http:www.w3.org2001XMLSchema- instance sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:taskingParameters sps:ParameterData sps:encoding swe:TextEncoding tokenSeparator = , blockSeparator = sps:encoding sps:values 2010-08-20T12:37:00+02:00,2010-08- 20T14:30:00+02:00,Y,pointToLookAt,51.902112,8.192728,0,Y,3.5 sps:values sps:ParameterData sps:taskingParameters sps:latestResponseTime 2010-08-20T11:20:00+02:00 sps:latestResponseTime sps:reservationExpiration 2010-08-20T11:30:00+02:00 sps:reservationExpiration sps:Reserve 2010-08-20T11:12:01+02:00 – The service sends a response indicating that the reservation was successful. It will expire at 2010-08-20T11:30:00+02:00. Listing 21 - Reserve response example sps:ReserveResponse xmlns:sps = http:www.opengis.netsps2.0 xmlns:xsi = http:www.w3.org2001XMLSchema-instance sps:result sps:ReservationReport sps:task http:www.ogc.orgprocedurecamera1tasks6 sps:task sps:estimatedToC 2010-08-20T14:30:00+02:00 sps:estimatedToC sps:event TaskReserved sps:event sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:requestStatus Accepted sps:requestStatus sps:taskStatus Reserved sps:taskStatus sps:updateTime 2010-08-20T11:12:01+02:00 sps:updateTime sps:reservationExpiration 2010-08-20T11:30:00+02:00 sps:reservationExpiration sps:ReservationReport sps:result sps:ReserveResponse Now there are several options: the task automatically expires at 2010-08- 20T11:30:00+02:00, the client confirms, updates or cancels the task beforehand or the task fails for some reason. The option that the reservation was updated is not considere here.

9.6.5.3 Automatic Reservation Expiration

2010-08-20T12:00:00+02:00 – The client sends a GetStatus request to the service. The since parameter, although supported by the service, is not used in the request. Thus the current status of the task is requested. Listing 22 - GetStatus request example sps:GetStatus service = SPS version = 2.0.0 xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:xsi = http:www.w3.org2001XMLSchema- instance sps:task http:www.ogc.orgprocedurecamera1tasks6 sps:task sps:GetStatus 2010-08-20T12:00:01+02:00 – The service sends a response with information about the current status of the task, indicating that the reservation expired at 2010-08- 20T11:30:00+02:00. Copyright © 2011 Open Geospatial Consortium 157 Listing 23 - GetStatus response example for expired reservation sps:GetStatusResponse xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:swes = http:www.opengis.netswes2.0 xmlns:xsi = http:www.w3.org2001XMLSchema-instance sps:status sps:StatusReport sps:task http:www.ogc.orgprocedurecamera1tasks6 sps:task sps:event ReservationExpired sps:event sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:requestStatus Accepted sps:requestStatus sps:statusMessage xml:lang = en Your reservation expired as it was not confirmed before the agreed expiration time. sps:statusMessage sps:taskStatus Expired sps:taskStatus sps:updateTime 2010-08-20T11:30:00+02:00 sps:updateTime sps:StatusReport sps:status sps:GetStatusResponse

9.6.5.4 Confirming a Reserved Task

2010-08-20T11:23:00+02:00 – The client sends a Confirm request to the service to confirm the reservation. Listing 24 - Confirm request example sps:Confirm service = SPS version = 2.0.0 xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:xsi = http:www.w3.org2001XMLSchema- instance sps:task http:www.ogc.orgprocedurecamera1tasks6 sps:task sps:Confirm 2010-08-20T11:23:08+02:00 – The service sends a response indicating that the task was confirmed and is now in execution, so will be performed as planned. Listing 25 - Confirm response example sps:ConfirmResponse xmlns:sps = http:www.opengis.netsps2.0 xmlns:xsi = http:www.w3.org2001XMLSchema-instance sps:result sps:StatusReport sps:task http:www.ogc.orgprocedurecamera1tasks6 sps:task sps:procedure http:www.ogc.orgprocedurecamera1 sps:procedure sps:requestStatus Accepted sps:requestStatus sps:updateTime 2010-08-20T11:23:08+02:00 sps:updateTime sps:StatusReport sps:result sps:ConfirmResponse 2010-08-20T12:00:00+02:00 – The client sends a GetTask request to the service. Listing 26 - GetTask request example sps:GetTask service = SPS version = 2.0.0 xmlns:sps = http:www.opengis.netsps2.0 xmlns:swe = http:www.opengis.netswe2.0 xmlns:xsi = http:www.w3.org2001XMLSchema- instance sps:task http:www.ogc.orgprocedurecamera1tasks6 sps:task sps:GetTask 2010-08-20T12:00:01+02:00 – The service sends a response with information about the task, including all state transitions made so far. All transitions are reported because the service supports state logging. Note that here the tasking parameters used in reserving the task are also included.