fr.cnes.sitools.resources.order.utils
Class OrderAPI

java.lang.Object
  extended by fr.cnes.sitools.resources.order.utils.OrderAPI

public final class OrderAPI
extends java.lang.Object

Util class to simplify Order management

Author:
m.gond

Method Summary
static Order activateOrder(Order order, org.restlet.Context context)
          Activate the given order
static Order createEvent(Order order, org.restlet.Context context, java.lang.String msg)
          Add a event to the order
static Order createOrder(java.lang.String userIdentifier, org.restlet.Context context, java.lang.String orderDescription)
          Create an order to trace it into the Sitools order system
static Order orderFailed(Order order, org.restlet.Context context, java.lang.String localizedMessage)
          Set the order to fail
static Order terminateOrder(Order order, org.restlet.Context context)
          Set to done the given order
static Order updateOrder(Order order, org.restlet.Context context)
          Update the order
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createOrder

public static Order createOrder(java.lang.String userIdentifier,
                                org.restlet.Context context,
                                java.lang.String orderDescription)
                         throws SitoolsException
Create an order to trace it into the Sitools order system

Parameters:
userIdentifier - the user identifier of the order
context - the context
orderDescription - the description of the order
Returns:
the created Order
Throws:
SitoolsException - if there is an error

updateOrder

public static Order updateOrder(Order order,
                                org.restlet.Context context)
                         throws SitoolsException
Update the order

Parameters:
order - the order to update
context - the context
Returns:
Order the updated order
Throws:
SitoolsException - if there is an error

createEvent

public static Order createEvent(Order order,
                                org.restlet.Context context,
                                java.lang.String msg)
                         throws SitoolsException
Add a event to the order

Parameters:
order - the order to update
context - the context
msg - the message of the event to create
Returns:
Order the order with the new Event
Throws:
SitoolsException - if there is an error

activateOrder

public static Order activateOrder(Order order,
                                  org.restlet.Context context)
                           throws SitoolsException
Activate the given order

Parameters:
order - the order
context - the context
Returns:
Order the order activated
Throws:
SitoolsException - if there is an error

terminateOrder

public static Order terminateOrder(Order order,
                                   org.restlet.Context context)
                            throws SitoolsException
Set to done the given order

Parameters:
order - the order
context - the context
Returns:
Order the order activated
Throws:
SitoolsException - if there is an error

orderFailed

public static Order orderFailed(Order order,
                                org.restlet.Context context,
                                java.lang.String localizedMessage)
                         throws SitoolsException
Set the order to fail

Parameters:
order - the order
context - the context
localizedMessage - the message to set
Returns:
the failed order
Throws:
SitoolsException - if something goes wrong


Copyright © 2010-2013 CNES. All Rights Reserved.