Class ISServiceCallerImpl

java.lang.Object
cz.metacentrum.perun.core.impl.modules.pwdmgr.ISServiceCallerImpl
All Implemented Interfaces:
ISServiceCaller

public class ISServiceCallerImpl extends Object implements ISServiceCaller
Author:
Vojtech Sassmann <vojtech.sassmann@gmail.com>
  • Constructor Details

    • ISServiceCallerImpl

      public ISServiceCallerImpl()
  • Method Details

    • getInstance

      public static ISServiceCallerImpl getInstance()
    • call

      public ISResponseData call(String requestBody, int requestId) throws IOException
      Description copied from interface: ISServiceCaller
      Sends a request to the IS with the given body. The received response is returned, with the status code and an error (if some has occurred).
      Specified by:
      call in interface ISServiceCaller
      Parameters:
      requestBody - body of the http request, that will be send (xml format)
      requestId - id of the request
      Returns:
      response data
      Throws:
      IOException - if the connection to the IS failed
    • makeCall

      public InputStream makeCall(String dataToPass, int requestId) throws IOException
      Makes secure SSL connection to IS MU and perform required password manager action
      Parameters:
      dataToPass - XML request body
      requestId - unique ID of a request
      Returns:
      InputStream response to be parsed
      Throws:
      InternalErrorException
      IOException
    • parseResponse

      public ISResponseData parseResponse(InputStream inputStream, int requestID)
      Parse XML response from IS MU to XML document.
      Parameters:
      inputStream - Stream to be parsed to Document
      requestID - ID of request made to IS MU.
      Returns:
      XML document for further processing
      Throws:
      InternalErrorException