Lines Matching defs:connection

419         HttpURLConnection connection = (HttpURLConnection) restSTSInstanceTranslateUrl.openConnection();
420 connection.setDoOutput(true);
421 connection.setRequestMethod("POST");
422 connection.setRequestProperty(SharedSTSConstants.CONTENT_TYPE, SharedSTSConstants.APPLICATION_JSON);
426 connection.setRequestProperty(stsClientCertHeaderName, Base64.encode(userCertificate.getEncoded()));
431 OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
435 final int responseCode = connection.getResponseCode();
437 return parseTokenTranslationResponse(getSuccessMessage(connection));
439 throw new TokenCreationException(responseCode, getErrorMessage(connection));
446 HttpURLConnection connection = (HttpURLConnection) restSTSInstanceValidateUrl.openConnection();
447 connection.setDoOutput(true);
448 connection.setRequestMethod("POST");
449 connection.setRequestProperty(SharedSTSConstants.CONTENT_TYPE, SharedSTSConstants.APPLICATION_JSON);
451 OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
455 final int responseCode = connection.getResponseCode();
457 return getSuccessMessage(connection);
459 throw new TokenValidationException(responseCode, getErrorMessage(connection));
465 HttpURLConnection connection = (HttpURLConnection) restSTSInstanceCancelUrl.openConnection();
466 connection.setDoOutput(true);
467 connection.setRequestMethod("POST");
468 connection.setRequestProperty(SharedSTSConstants.CONTENT_TYPE, SharedSTSConstants.APPLICATION_JSON);
470 OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
473 final int responseCode = connection.getResponseCode();
475 return getSuccessMessage(connection);
477 throw new TokenCancellationException(responseCode, getErrorMessage(connection));
481 private String getSuccessMessage(HttpURLConnection connection) throws IOException {
482 return readInputStream(connection.getInputStream());
485 private String getErrorMessage(HttpURLConnection connection) throws IOException {
486 if (connection.getErrorStream() != null) {
487 return readInputStream(connection.getErrorStream());
489 return readInputStream(connection.getInputStream());