Class XmlaOlap4jHttpProxy

java.lang.Object
org.olap4j.driver.xmla.proxy.XmlaOlap4jHttpProxy
All Implemented Interfaces:
XmlaOlap4jCachedProxy, XmlaOlap4jProxy

public class XmlaOlap4jHttpProxy extends Object
Extends the AbstractCachedProxy and serves as a production ready http communication class. Every SOAP request sends a POST call to the destination XMLA server and returns the response as a byte array, conforming to the Proxy interface.

It also takes advantage of the AbstractHttpProxy cookie managing facilities. All cookies received from the end point server will be sent back if they are not expired and they also conform to cookie domain rules.

Author:
Luc Boudreau and Julian Hyde
  • Constructor Details

    • XmlaOlap4jHttpProxy

      public XmlaOlap4jHttpProxy(XmlaOlap4jDriver driver)
      Creates a XmlaOlap4jHttpProxy.
      Parameters:
      driver - Driver
  • Method Details

    • getResponse

      public byte[] getResponse(XmlaOlap4jServerInfos serverInfos, String request) throws XmlaOlap4jProxyException
      Sends a request to a URL and returns the response.
      Parameters:
      request - Request string
      Returns:
      Response
      Throws:
      XmlaOlap4jProxyException
    • getResponseViaSubmit

      public Future<byte[]> getResponseViaSubmit(XmlaOlap4jServerInfos serverInfos, String request)
      Submits a request for background execution.
      Parameters:
      request - Request
      Returns:
      Future object representing the submitted job
    • getEncodingCharsetName

      public String getEncodingCharsetName()
      Description copied from interface: XmlaOlap4jProxy
      Returns the name of the character set use for encoding the XML string.
    • useCookies

      protected void useCookies(URLConnection urlConn)
      Helper method to add cookies to a given connection.
      Parameters:
      urlConn - The url connection to which we want the cookies applied to.
    • saveCookies

      protected void saveCookies(URLConnection urlConn)
      Helper method to save cookies for later use.
      Parameters:
      urlConn - The url connection for which we want the cookies saved for later use.
    • setCache

      public void setCache(Map<String,String> config, Map<String,String> properties) throws OlapException
      Description copied from interface: XmlaOlap4jCachedProxy

      Sets the cache class to use as a SOAP message cache.

      Calling this method is not mandatory. If it isn't called, no cache will be used and all SOAP requests will be sent to the service end-point.

      Specified by:
      setCache in interface XmlaOlap4jCachedProxy
      Parameters:
      config - This contains all the parameters used to configure the Olap4j driver. It contains the full class name of the cache implementation to use as well as the raw Cache config parameters.
      properties - The properties to configure the cache, so all config parameters which started by Cache.* are inside this convenient thigny.
      Throws:
      OlapException
      See Also:
    • get

      public byte[] get(XmlaOlap4jServerInfos serverInfos, String request) throws XmlaOlap4jProxyException
      Description copied from interface: XmlaOlap4jProxy
      Sends a request to a URL and returns the response.
      Specified by:
      get in interface XmlaOlap4jProxy
      Parameters:
      serverInfos - Server infos.
      request - Request string
      Returns:
      Response The byte array that contains the whole response from the server.
      Throws:
      XmlaOlap4jProxyException - If anything occurs during the request execution.
    • submit

      public Future<byte[]> submit(XmlaOlap4jServerInfos serverInfos, String request)
      Description copied from interface: XmlaOlap4jProxy
      Submits a request for background execution.
      Specified by:
      submit in interface XmlaOlap4jProxy
      Parameters:
      serverInfos - Server infos.
      request - Request
      Returns:
      Future object representing the submitted job