File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
src/main/java/es/upv/i3m/grycap/im/rest/client Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,30 @@ public ImClient(final String targetUrl, final String authorizationHeader)
8686 this .client = createRestClient ();
8787 }
8888
89+ /**
90+ * Creates a new client using the 'imServiceUrl' as endpoint.<br>
91+ * Loads the authorization credentials from the 'authorizationHeader'
92+ * parameter. It also enables to set the read and connection timeouts.
93+ *
94+ * @param targetUrl
95+ * : url of the IM rest service
96+ * @param authorizationHeader
97+ * : string with the authorization content
98+ * @param connectTimeout
99+ * : int with the client connection timeout
100+ * @param readTimeout
101+ * : int with the client read timeout
102+ */
103+ public ImClient (final String targetUrl , final String authorizationHeader ,
104+ final int connectTimeout , final int readTimeout )
105+ throws ImClientException {
106+ this .targetUrl = targetUrl ;
107+ this .authorizationHeader = authorizationHeader ;
108+ this .client = createRestClient ();
109+ this .client .property ("jersey.config.client.connectTimeout" , connectTimeout );
110+ this .client .property ("jersey.config.client.readTimeout" , readTimeout );
111+ }
112+
89113 /**
90114 * Creates a new REST client based on the target URL.
91115 */
You can’t perform that action at this time.
0 commit comments