fr.cnes.sitools.order
Class UserOrderResource

java.lang.Object
  extended by ExtendedWadlServerResource
      extended by fr.cnes.sitools.common.resource.AbstractSitoolsResource
          extended by fr.cnes.sitools.common.SitoolsResource
              extended by fr.cnes.sitools.order.AbstractOrderResource
                  extended by fr.cnes.sitools.order.UserOrderResource

public final class UserOrderResource
extends AbstractOrderResource

Resource for POSTing new orders

Author:
jp.boignard (AKKA Technologies)

Field Summary
 
Fields inherited from class fr.cnes.sitools.common.SitoolsResource
DEFAULT_MEDIATYPE
 
Constructor Summary
UserOrderResource()
           
 
Method Summary
 java.lang.String addFile(org.restlet.representation.Representation repr, java.lang.String urlDest)
          Create a file from the following Representation at the given urlDest. urlDest must be relative url using RIAP.
 void configure(com.thoughtworks.xstream.XStream xstream, Response response)
          Configure the XStream
 java.lang.String copyFile(java.lang.String fileUrl, java.lang.String destUrl)
          Copy a file from fileUrl to destUrl destUrl must be pointing to a folder
 org.restlet.representation.Representation deleteOrder(org.restlet.representation.Variant variant)
          Delete Order
 void describeDelete(org.restlet.ext.wadl.MethodInfo info)
           
 void describeGet(org.restlet.ext.wadl.MethodInfo info)
           
 void describePost(org.restlet.ext.wadl.MethodInfo info)
           
 org.restlet.representation.Representation getFile(java.lang.String fileUrl)
          Gets the representation of a File
 org.restlet.representation.Representation newOrder(org.restlet.representation.Representation representation, org.restlet.representation.Variant variant)
          Post a new order
 org.restlet.representation.Representation retrieveOrder(org.restlet.representation.Variant variant)
          Invokes GET method to retrieve Order(s)
 void sitoolsDescribe()
          Method implementation mandatory
 
Methods inherited from class fr.cnes.sitools.order.AbstractOrderResource
doInit, getActionId, getEvent, getObject, getOrderId, getRepresentation, getStore, getUserId, setUserId
 
Methods inherited from class fr.cnes.sitools.common.SitoolsResource
addStandardGetRequestInfo, addStandardInternalServerErrorInfo, addStandardNotificationInfo, addStandardObjectResponseInfo, addStandardPostOrPutRequestInfo, addStandardResourceCollectionFilterInfo, addStandardResponseInfo, addStandardSimpleResponseInfo, getNotificationObject, getRepresentation, getSettings, getSitoolsApplication, getSitoolsSetting
 
Methods inherited from class fr.cnes.sitools.common.resource.AbstractSitoolsResource
getMediaType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserOrderResource

public UserOrderResource()
Method Detail

sitoolsDescribe

public void sitoolsDescribe()
Description copied from class: AbstractSitoolsResource
Method implementation mandatory

Specified by:
sitoolsDescribe in class AbstractSitoolsResource

addFile

public java.lang.String addFile(org.restlet.representation.Representation repr,
                                java.lang.String urlDest)
                         throws SitoolsException
Create a file from the following Representation at the given urlDest. urlDest must be relative url using RIAP. It must contains the file name as well

Parameters:
repr - the representation
urlDest - the destination url
Returns:
The location of the new File
Throws:
SitoolsException - if there is an error while creating the file

copyFile

public java.lang.String copyFile(java.lang.String fileUrl,
                                 java.lang.String destUrl)
                          throws SitoolsException
Copy a file from fileUrl to destUrl destUrl must be pointing to a folder

Parameters:
fileUrl - the file to copy
destUrl - the destination folder url
Returns:
the url of the created file
Throws:
SitoolsException - if the copy is unsuccessful

getFile

public org.restlet.representation.Representation getFile(java.lang.String fileUrl)
                                                  throws SitoolsException
Gets the representation of a File

Parameters:
fileUrl - the url of the file
Returns:
the Representation of a File
Throws:
SitoolsException - if there is an error while getting the file

newOrder

@Post
public org.restlet.representation.Representation newOrder(org.restlet.representation.Representation representation,
                                                               org.restlet.representation.Variant variant)
Post a new order

Parameters:
representation - Order representation
variant - client preferred media type
Returns:
Representation

describePost

public void describePost(org.restlet.ext.wadl.MethodInfo info)

retrieveOrder

@Get
public org.restlet.representation.Representation retrieveOrder(org.restlet.representation.Variant variant)
Invokes GET method to retrieve Order(s)

Parameters:
variant - Variant
Returns:
Representation

describeGet

public void describeGet(org.restlet.ext.wadl.MethodInfo info)

deleteOrder

@Delete
public org.restlet.representation.Representation deleteOrder(org.restlet.representation.Variant variant)
Delete Order

Parameters:
variant - client preferred media type
Returns:
Representation

describeDelete

public void describeDelete(org.restlet.ext.wadl.MethodInfo info)

configure

public void configure(com.thoughtworks.xstream.XStream xstream,
                      Response response)
Configure the XStream

Overrides:
configure in class SitoolsResource
Parameters:
xstream - the XStream to treat
response - the response used


Copyright © 2010-2013 CNES. All Rights Reserved.