public interface IConnectionFactory extends Serializable
IConnectionFactory defines the factory that creates connections to the requested URLs.| Modifier and Type | Interface and Description |
|---|---|
static class |
IConnectionFactory.Service
Service identifies the service that is being used by the connection factory. |
| Modifier and Type | Method and Description |
|---|---|
HttpURLConnection |
getConnection(SecurityCallback callback,
String urlString,
String requestMethod)
Creates a new HTTP connection to the provided URL using the given request method.
|
HttpURLConnection |
getConnection(SecurityCallback callback,
String urlString,
String requestMethod,
Map<String,String> requestProperties)
Creates a new HTTP connection to the provided URL.
|
IConnectionFactory.Service |
getService()
Returns the service that is being used for all connections.
|
IConnectionFactory.Service |
switchService()
Switch the currently used service from primary to secondary or vice versa.
|
HttpURLConnection getConnection(SecurityCallback callback, String urlString, String requestMethod) throws ConnectionException
getConnection(SecurityCallback, String, String, Map) with null or empty map.callback - the security callback which is notified if a certificate needs to be acceptedurlString - URL to connect torequestMethod - HTTP request method (GET, POST, DELETE, etc.)ConnectionException - if there was an error creating the connectiongetConnection(SecurityCallback, String, String, Map)HttpURLConnection getConnection(SecurityCallback callback, String urlString, String requestMethod, Map<String,String> requestProperties) throws ConnectionException
requestProperties parameter. When a
connection is created its verifier is set to only allow connections to the RBAC authentication server. It is
expected that the connection to the URL is verified and that any certificate (that might be issued by the server)
is trusted before the connection is returned. The provided callback can be used to accept or deny certificate.callback - the security callback which is notified in case a certificate needs to be acceptedurlString - URL to connect torequestMethod - HTTP request method (GET, POST, DELETE, etc.)requestProperties - map of additional HTTP request properties (headers)ConnectionException - if there was an error creating the connectionSecurityCallback.acceptCertificate(String, java.security.cert.X509Certificate)IConnectionFactory.Service switchService()
IConnectionFactory.Service getService()
Copyright © 2023 European Spallation Source. All rights reserved.