Search in sources :

Example 6 with RuntimeIoException

use of com.opentext.ia.sdk.support.io.RuntimeIoException in project infoarchive-sip-sdk by Enterprise-Content-Management.

the class JwtAuthentication method postToGateway.

private AuthenticationSuccess postToGateway(String payload) {
    AuthenticationSuccess result;
    String gatewayUrl = gatewayInfo.getGatewayUrl();
    Collection<Header> headers = new ArrayList<>(Arrays.asList(gatewayInfo.getAuthorizationHeader(), gatewayInfo.getContentTypeHeader()));
    try {
        result = httpClient.post(gatewayUrl, headers, AuthenticationSuccess.class, payload);
    } catch (IOException ex) {
        if (timer != null) {
            timer.stop();
        }
        throw new RuntimeIoException(ex);
    }
    return result;
}
Also used : Header(com.opentext.ia.sdk.support.http.Header) IOException(java.io.IOException) RuntimeIoException(com.opentext.ia.sdk.support.io.RuntimeIoException)

Aggregations

RuntimeIoException (com.opentext.ia.sdk.support.io.RuntimeIoException)6 IOException (java.io.IOException)5 ApplicationIngestionResourcesCache (com.opentext.ia.sdk.client.impl.ApplicationIngestionResourcesCache)1 Header (com.opentext.ia.sdk.support.http.Header)1 DataBuffer (com.opentext.ia.sdk.support.io.DataBuffer)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 AtomicReference (java.util.concurrent.atomic.AtomicReference)1 HttpEntity (org.apache.http.HttpEntity)1 StatusLine (org.apache.http.StatusLine)1 HttpResponseException (org.apache.http.client.HttpResponseException)1 Test (org.junit.Test)1