Package de.dlr.proseo.planner.service
Klasse ServiceConnection
java.lang.Object
de.dlr.proseo.planner.service.ServiceConnection
Service class to connect to the prosEO backend services from planner
- Autor:
- Dr. Thomas Bassler, Ernst Melchinger
-
Feldübersicht
FelderModifizierer und TypFeldBeschreibung(Package privat) ProductionPlannerConfigurationProduction planner configuration -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoiddeleteFromService(String serviceUrl, String requestPath, String username, String password) Calls a prosEO service at the given location with HTTP DELETE<T> TgetFromService(String serviceUrl, String requestPath, Class<T> clazz, String username, String password) Calls a prosEO service at the given location with HTTP GET<T> TpatchToService(String serviceUrl, String requestPath, Object restObject, Class<T> clazz, String username, String password) Calls a prosEO service at the given location with HTTP Patch<T> TpostToService(String serviceUrl, String requestPath, Object restObject, Class<T> clazz, String username, String password) Calls a prosEO service at the given location with HTTP Post<T> TputToService(String serviceUrl, String requestPath, Class<T> clazz, String username, String password) Calls a prosEO service at the given location with HTTP PUT
-
Felddetails
-
config
Production planner configuration
-
-
Konstruktordetails
-
ServiceConnection
public ServiceConnection()
-
-
Methodendetails
-
getFromService
public <T> T getFromService(String serviceUrl, String requestPath, Class<T> clazz, String username, String password) throws org.springframework.web.client.RestClientException, RuntimeException Calls a prosEO service at the given location with HTTP GET- Typparameter:
T- the class of the REST object to return- Parameter:
serviceUrl- the base URL of the service (protocol, hostname, port, base URI)requestPath- the specific request path including request parametersclazz- the class of the return objectusername- the username for basic HTTP authentication (optional)password- the password for basic HTTP authentication (optional)- Gibt zurück:
- the body of the HTTP response converted into an object of the expected class
- Löst aus:
org.springframework.web.client.RestClientException- if an error (HTTP status code 4xx or 5xx) occurred in the communication to the serviceRuntimeException- if the service returned an HTTP status different from OK (200)
-
putToService
public <T> T putToService(String serviceUrl, String requestPath, Class<T> clazz, String username, String password) throws org.springframework.web.client.RestClientException, RuntimeException Calls a prosEO service at the given location with HTTP PUT- Typparameter:
T- the class of the REST object to use as PUT data- Parameter:
serviceUrl- the base URL of the service (protocol, hostname, port, base URI)requestPath- the specific request path including request parametersclazz- the class of the return objectusername- the username for basic HTTP authentication (optional)password- the password for basic HTTP authentication (optional)- Gibt zurück:
- the body of the HTTP response converted into an object of the expected class
- Löst aus:
org.springframework.web.client.RestClientException- if an error (HTTP status code 4xx or 5xx) occurred in the communication to the serviceRuntimeException- if the service returned an HTTP status different from OK (200)
-
postToService
public <T> T postToService(String serviceUrl, String requestPath, Object restObject, Class<T> clazz, String username, String password) throws org.springframework.web.client.RestClientException, RuntimeException Calls a prosEO service at the given location with HTTP Post- Typparameter:
T- the class of the REST object to use as POST data- Parameter:
serviceUrl- the base URL of the service (protocol, hostname, port, base URI)requestPath- the specific request path including request parametersrestObject- the object to post to the serviceclazz- the class of the expected result objectusername- the username for basic HTTP authentication (optional)password- the password for basic HTTP authentication (optional)- Gibt zurück:
- the body of the HTTP response converted into an object of the expected class
- Löst aus:
org.springframework.web.client.RestClientException- if an error (HTTP status code 4xx or 5xx) occurred in the communication to the serviceRuntimeException- if the service returned an HTTP status different from OK (200)
-
patchToService
public <T> T patchToService(String serviceUrl, String requestPath, Object restObject, Class<T> clazz, String username, String password) throws org.springframework.web.client.RestClientException, RuntimeException Calls a prosEO service at the given location with HTTP Patch- Typparameter:
T- the class of the REST object to use as PATCH data- Parameter:
serviceUrl- the base URL of the service (protocol, hostname, port, base URI)requestPath- the specific request path including request parametersrestObject- the object to patch to the serviceclazz- the class of the expected result objectusername- the username for basic HTTP authentication (optional)password- the password for basic HTTP authentication (optional)- Gibt zurück:
- the body of the HTTP response converted into an object of the expected class
- Löst aus:
org.springframework.web.client.RestClientException- if an error (HTTP status code 4xx or 5xx) occurred in the communication to the serviceRuntimeException- if the service returned an HTTP status different from OK (200) or another unrecoverable error occurred
-
deleteFromService
public void deleteFromService(String serviceUrl, String requestPath, String username, String password) throws org.springframework.web.client.RestClientException Calls a prosEO service at the given location with HTTP DELETE- Parameter:
serviceUrl- the base URL of the service (protocol, hostname, port, base URI)requestPath- the specific request path including request parametersusername- the username for basic HTTP authentication (optional)password- the password for basic HTTP authentication (optional)- Löst aus:
org.springframework.web.client.RestClientException- if an error (HTTP status code 304, 4xx or 5xx) occurred in the communication to the service
-