edu.uiuc.ndiipp.hubandspoke.lrcrud.client
Class LrcrudClient

java.lang.Object
  extended by edu.uiuc.ndiipp.hubandspoke.lrcrud.client.LrcrudClient

public class LrcrudClient
extends java.lang.Object

Author:
thabing TEST

Nested Class Summary
 class LrcrudClient.CreateResponse
          This class represents the response an LRCRUD Create request
 class LrcrudClient.DeleteResponse
          This class represents the response an LRCRUD Delete request
 class LrcrudClient.LrcrudResponse
          This class represents a response returned by the LRCRUD service.
 class LrcrudClient.RetrieveResponse
          This class represents the response an LRCRUD Retrieve request The zip file is available as a stream.
 class LrcrudClient.UpdateResponse
          This class represents the response an LRCRUD Update request
 
Constructor Summary
LrcrudClient(java.lang.String url)
          Creates a new instance of the LrcrudClient ready to communicate to the LRCRUD Service at the given URL.
LrcrudClient(java.lang.String url, java.net.Authenticator auth)
          Creates a new instance of the LrcrudClient ready to communicate to the LRCRUD Service at the given URL.
LrcrudClient(java.lang.String url, java.lang.String uid, java.lang.String pw)
          Creates a new instance of the LrcrudClient ready to communicate to the LRCRUD Service at the given URL.
 
Method Summary
 LrcrudClient.CreateResponse create(java.lang.String location)
          Sends a request to the LRCRUD Service to create (POST) a new package
 LrcrudClient.DeleteResponse delete(java.lang.String identifier)
          Sends a request to the LRCRUD Service to delete (DELETE) a package
 java.net.URI getBaseURL()
           
 java.lang.String getFrom()
          Returns the value used for the From HTTP request header
 java.lang.String getUserAgent()
          Returns the value used for the User-Agent request header
 LrcrudClient.RetrieveResponse retrieve(java.lang.String identifier)
          Sends a request to the LRCRUD service to retrieve (GET) a specific package
 void setFrom(java.lang.String from)
          Sets the value used for the HTTP From request header.
 void setUserAgent(java.lang.String userAgent)
          Sets the value used for the HTTP User-Agent request header.
 LrcrudClient.UpdateResponse update(java.lang.String identifier, java.io.File f)
          Sends a request to the LRCRUD Service to update (PUT) a new package
 LrcrudClient.UpdateResponse update(java.lang.String identifier, java.lang.String source)
          Sends a request to the LRCRUD Service to update (PUT) a new package
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LrcrudClient

public LrcrudClient(java.lang.String url)
             throws LrcrudClientException
Creates a new instance of the LrcrudClient ready to communicate to the LRCRUD Service at the given URL.

Parameters:
url - an absolute URL giving the base location for the LRCRUD service
Throws:
LrcrudClientException

LrcrudClient

public LrcrudClient(java.lang.String url,
                    java.lang.String uid,
                    java.lang.String pw)
             throws LrcrudClientException
Creates a new instance of the LrcrudClient ready to communicate to the LRCRUD Service at the given URL.

Parameters:
url - an absolute URL giving the base location for the LRCRUD service
uid - the user id of a person authorized to use the service
pw - the password for the authorized user
Throws:
LrcrudClientException

LrcrudClient

public LrcrudClient(java.lang.String url,
                    java.net.Authenticator auth)
             throws LrcrudClientException
Creates a new instance of the LrcrudClient ready to communicate to the LRCRUD Service at the given URL.

Parameters:
url - an absolute URL giving the base location for the LRCRUD service
auth - an extension of Authenticator
Throws:
LrcrudClientException
Method Detail

getBaseURL

public java.net.URI getBaseURL()
Returns:
the baseURL

create

public LrcrudClient.CreateResponse create(java.lang.String location)
                                   throws LrcrudClientException
Sends a request to the LRCRUD Service to create (POST) a new package

Parameters:
location - the location in which the new package is to be created
Returns:
an LrcrudClient.CreateResponse object
Throws:
LrcrudClientException

retrieve

public LrcrudClient.RetrieveResponse retrieve(java.lang.String identifier)
                                       throws LrcrudClientException
Sends a request to the LRCRUD service to retrieve (GET) a specific package

Parameters:
identifier - the identifier of the package to retrieve
Returns:
an LrcrudClient.RetieveResponse object
Throws:
LrcrudClientException

update

public LrcrudClient.UpdateResponse update(java.lang.String identifier,
                                          java.lang.String source)
                                   throws LrcrudClientException
Sends a request to the LRCRUD Service to update (PUT) a new package

Parameters:
identifier - the identifier of the package to update
source - the location of the zip file which is to replace the current package
Returns:
an LrcrudClient.UpdateResponse object
Throws:
LrcrudClientException

update

public LrcrudClient.UpdateResponse update(java.lang.String identifier,
                                          java.io.File f)
                                   throws LrcrudClientException
Sends a request to the LRCRUD Service to update (PUT) a new package

Parameters:
identifier - the identifier of the package to update
f - file object representing the zip package
Returns:
an LrcrudClient.UpdateResponse object
Throws:
LrcrudClientException

delete

public LrcrudClient.DeleteResponse delete(java.lang.String identifier)
Sends a request to the LRCRUD Service to delete (DELETE) a package

Parameters:
identifier - the identifier of the package to deleted
Returns:
an LrcrudClient.DeleteResponse object

getFrom

public java.lang.String getFrom()
Returns the value used for the From HTTP request header

Returns:
the value to be used with the HTTP From request header

getUserAgent

public java.lang.String getUserAgent()
Returns the value used for the User-Agent request header

Returns:
the value to be used with the HTTP User-Agent request header

setFrom

public void setFrom(java.lang.String from)
Sets the value used for the HTTP From request header.

Parameters:
from - the value to be used for the HTTP From request header.

setUserAgent

public void setUserAgent(java.lang.String userAgent)
Sets the value used for the HTTP User-Agent request header.

Parameters:
userAgent - the value to be used with the HTTP User-Agent request header


Copyright © 2006, University of Illinois.