Class SClient4WPSSession
- java.lang.Object
-
- org.gcube.data.analysis.dataminermanagercl.server.dmservice.wps.SClient4WPSSession
-
- All Implemented Interfaces:
Serializable
public class SClient4WPSSession extends Object implements Serializable
- Author:
- Giancarlo Panichi
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description HashMap<String,net.opengis.wps.x100.ProcessDescriptionsDocument>processDescriptions
-
Constructor Summary
Constructors Constructor Description SClient4WPSSession(String user, String password)Initializes a WPS client session.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcancelComputation(String url, String computationId)booleanconnect(String url)Connects to a WPS and retrieves Capabilities plus puts all available Descriptions into cache.booleanconnect(String url, boolean refresh)booleanconnectForMonitoring(String url)Connects to a WPS and retrieves Capabilities plus puts all available Descriptions into cache.net.opengis.wps.x100.ProcessDescriptionsDocumentdescribeAllProcesses(String url)retrieves all current available ProcessDescriptions of a WPS.net.opengis.wps.x100.ProcessDescriptionsDocumentdescribeProcess(String[] processIDs, String serverID)retrieves the desired description for a service.booleandescriptionsAvailableInCache(String serverID)informs you if the descriptions for the specified service is already in the session.voiddisconnect(String url)removes a service from the sessionObjectexecute(String serverID, net.opengis.wps.x100.ExecuteDocument execute)Executes a process at a WPSObjectexecuteViaGET(String urlString, String executeAsGETString)Executes a process at a WPSnet.opengis.wps.x100.ProcessDescriptionType[]getAllProcessDescriptions(String wpsUrl)Delivers all ProcessDescriptions from a WPSList<String>getLoggedServices()returns the serverIDs of all loggedServicesnet.opengis.wps.x100.ProcessDescriptionTypegetProcessDescription(String serverID, String processID)String[]getProcessNames(String url)net.opengis.wps.x100.CapabilitiesDocumentgetWPSCaps(String url)provides you the cached capabilities for a specified service.protected List<String>retrievesSingleDescription(InputStream is)booleanserviceAlreadyRegistered(String serverID)looks up, if the service exists already in session.
-
-
-
Method Detail
-
connect
public boolean connect(String url) throws org.n52.wps.client.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:
org.n52.wps.client.WPSClientException- WPSClientException
-
connect
public boolean connect(String url, boolean refresh) throws org.n52.wps.client.WPSClientException
- Throws:
org.n52.wps.client.WPSClientException
-
connectForMonitoring
public boolean connectForMonitoring(String url) throws org.n52.wps.client.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:
org.n52.wps.client.WPSClientException- WPSClientException
-
disconnect
public void disconnect(String url)
removes a service from the session- Parameters:
url- url
-
getLoggedServices
public List<String> getLoggedServices()
returns the serverIDs of all loggedServices- Returns:
- list of server ids
-
descriptionsAvailableInCache
public boolean descriptionsAvailableInCache(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- server id- Returns:
- success
-
getProcessDescription
public net.opengis.wps.x100.ProcessDescriptionType getProcessDescription(String serverID, String processID) throws IOException
- Parameters:
serverID- server idprocessID- process id- Returns:
- a ProcessDescription for a specific process from Cache.
- Throws:
IOException- IOException
-
getAllProcessDescriptions
public net.opengis.wps.x100.ProcessDescriptionType[] getAllProcessDescriptions(String wpsUrl) throws IOException
Delivers all ProcessDescriptions from a WPS- Parameters:
wpsUrl- the URL of the WPS- Returns:
- An Array of ProcessDescriptions
- Throws:
IOException- IOException
-
serviceAlreadyRegistered
public boolean serviceAlreadyRegistered(String serverID)
looks up, if the service exists already in session.- Parameters:
serverID- server id- Returns:
- true if registered
-
getWPSCaps
public net.opengis.wps.x100.CapabilitiesDocument getWPSCaps(String url)
provides you the cached capabilities for a specified service.- Parameters:
url- url- Returns:
- CapabilitiesDocument
-
describeAllProcesses
public net.opengis.wps.x100.ProcessDescriptionsDocument describeAllProcesses(String url) throws org.n52.wps.client.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- url- Returns:
- process descriptions document
- Throws:
org.n52.wps.client.WPSClientException- WPSClientException
-
describeProcess
public net.opengis.wps.x100.ProcessDescriptionsDocument describeProcess(String[] processIDs, String serverID) throws org.n52.wps.client.WPSClientException
retrieves the desired description for a service. the retrieved information will not be held in cache!- Parameters:
processIDs- one or more processIDsserverID- server id- Returns:
- process description document
- Throws:
org.n52.wps.client.WPSClientException- WPSClientExpcetion
-
execute
public Object execute(String serverID, net.opengis.wps.x100.ExecuteDocument execute) throws org.n52.wps.client.WPSClientException
Executes a process at a WPS- Parameters:
serverID- server idexecute- exceute document- Returns:
- either an ExecuteResponseDocument or an InputStream if asked for RawData or an Exception Report
- Throws:
org.n52.wps.client.WPSClientException- WPSClientException
-
retrievesSingleDescription
protected List<String> retrievesSingleDescription(InputStream is) throws org.n52.wps.client.WPSClientException
- Throws:
org.n52.wps.client.WPSClientException
-
getProcessNames
public String[] getProcessNames(String url) throws IOException
- Throws:
IOException
-
executeViaGET
public Object executeViaGET(String urlString, String executeAsGETString) throws org.n52.wps.client.WPSClientException
Executes a process at a WPS- Parameters:
urlString- url of server not the entry additionally defined in the caps.executeAsGETString- KVP Execute request- Returns:
- either an ExecuteResponseDocument or an InputStream if asked for RawData or an Exception Report
- Throws:
org.n52.wps.client.WPSClientException- WSPClientException
-
-