org.n52.wps.client
Class WPSClientSession

java.lang.Object
  extended by org.n52.wps.client.WPSClientSession

public class WPSClientSession
extends java.lang.Object

Contains some convenient methods to access and manage WebProcessingSerivces in a very generic way. This is implemented as a singleton.

Author:
foerster

Method Summary
 boolean connect(java.lang.String url)
          Connects to a WPS and retrieves Capabilities plus puts all available Descriptions into cache.
 net.opengis.wps.x100.ProcessDescriptionsDocument describeAllProcesses(java.lang.String url)
          retrieves all current available processdescriptions of a WPS.
 net.opengis.wps.x100.ProcessDescriptionsDocument describeProcess(java.lang.String[] processIDs, java.lang.String serverID)
          retrieves the desired description for a service. the retrieved information will not be held in cache!
 boolean descriptionsAvailableInCache(java.lang.String serverID)
          informs you if the descriptions for the specified service is already in the session.
 void disconnect(java.lang.String url)
          removes a service from the session
 java.lang.Object execute(java.lang.String serverID, net.opengis.wps.x100.ExecuteDocument execute)
           
 java.lang.Object execute(java.lang.String serverID, net.opengis.wps.x100.ExecuteDocument execute, boolean rawData)
          Execute tries to retrieve features encoded as gzip.
 net.opengis.wps.x100.ProcessDescriptionType[] getAllProcessDescriptions(java.lang.String wpsUrl)
           
static WPSClientSession getInstance()
           
 java.util.List<java.lang.String> getLoggedServices()
          returns the serverIDs of all loggedServices
 net.opengis.wps.x100.ProcessDescriptionType getProcessDescription(java.lang.String serverID, java.lang.String processID)
          return the processDescription for a specific process from Cache.
 java.lang.String[] getProcessNames(java.lang.String url)
           
 java.lang.String[] getURLs()
           
 net.opengis.wps.x100.CapabilitiesDocument getWPSCaps(java.lang.String url)
          provides you the cached capabilities for a specified serivce.
static void reset()
          This resets the WPSClientSession.
 boolean serviceAlreadyRegistered(java.lang.String serverID)
          look up, if the service exists already in session.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static WPSClientSession getInstance()

reset

public static void reset()
This resets the WPSClientSession. This might be necessary, to get rid of old service entries/descriptions. However, the session has to be repopulated afterwards.


connect

public boolean connect(java.lang.String url)
                throws WPSClientException
Connects to a WPS and retrieves Capabilities plus puts all available Descriptions into cache.

Parameters:
url - the entry point for the service. This is used as id for further identification of the service.
Returns:
true, if connect succeeded, false else.
Throws:
WPSClientException

disconnect

public void disconnect(java.lang.String url)
removes a service from the session

Parameters:
url -

getLoggedServices

public java.util.List<java.lang.String> getLoggedServices()
returns the serverIDs of all loggedServices

Returns:

descriptionsAvailableInCache

public boolean descriptionsAvailableInCache(java.lang.String serverID)
informs you if the descriptions for the specified service is already in the session. in normal case it should return true :)

Parameters:
serverID -
Returns:

getProcessDescription

public net.opengis.wps.x100.ProcessDescriptionType getProcessDescription(java.lang.String serverID,
                                                                         java.lang.String processID)
                                                                  throws java.io.IOException
return the processDescription for a specific process from Cache.

Parameters:
serverID -
processID -
Returns:
Throws:
java.io.IOException

getAllProcessDescriptions

public net.opengis.wps.x100.ProcessDescriptionType[] getAllProcessDescriptions(java.lang.String wpsUrl)
                                                                        throws java.io.IOException
Throws:
java.io.IOException

serviceAlreadyRegistered

public boolean serviceAlreadyRegistered(java.lang.String serverID)
look up, if the service exists already in session.


getWPSCaps

public net.opengis.wps.x100.CapabilitiesDocument getWPSCaps(java.lang.String url)
provides you the cached capabilities for a specified serivce.

Parameters:
url -
Returns:

describeAllProcesses

public net.opengis.wps.x100.ProcessDescriptionsDocument describeAllProcesses(java.lang.String url)
                                                                      throws WPSClientException
retrieves all current available processdescriptions of a WPS. Mention: to get the current list of all processes, which will be requested, the cached capabilities will be used. Please keep that in mind. the retrieved descriptions will not be cached, so only transient information!

Parameters:
url -
Returns:
Throws:
WPSClientException

describeProcess

public net.opengis.wps.x100.ProcessDescriptionsDocument describeProcess(java.lang.String[] processIDs,
                                                                        java.lang.String serverID)
                                                                 throws WPSClientException
retrieves the desired description for a service. the retrieved information will not be held in cache!

Parameters:
processIDs - one or more processIDs
serverID -
Throws:
WPSClientException

execute

public java.lang.Object execute(java.lang.String serverID,
                                net.opengis.wps.x100.ExecuteDocument execute,
                                boolean rawData)
                         throws WPSClientException
Execute tries to retrieve features encoded as gzip.

Parameters:
url - url of server not the entry additionally defined in the caps.
execute -
Returns:
Throws:
WPSClientException

execute

public java.lang.Object execute(java.lang.String serverID,
                                net.opengis.wps.x100.ExecuteDocument execute)
                         throws WPSClientException
Throws:
WPSClientException

getProcessNames

public java.lang.String[] getProcessNames(java.lang.String url)
                                   throws java.io.IOException
Throws:
java.io.IOException

getURLs

public java.lang.String[] getURLs()