org.olap4j.driver.xmla.proxy
Class XmlaOlap4jHttpProxy

java.lang.Object
  extended by 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.

Version:
$Id: XmlaOlap4jHttpProxy.java 482 2012-01-05 23:27:27Z jhyde $
Author:
Luc Boudreau and Julian Hyde

Constructor Summary
XmlaOlap4jHttpProxy(XmlaOlap4jDriver driver)
          Creates a XmlaOlap4jHttpProxy.
 
Method Summary
 byte[] get(XmlaOlap4jServerInfos serverInfos, String request)
          Sends a request to a URL and returns the response.
 String getEncodingCharsetName()
          Returns the name of the character set use for encoding the XML string.
 byte[] getResponse(XmlaOlap4jServerInfos serverInfos, String request)
          Sends a request to a URL and returns the response.
 Future<byte[]> getResponseViaSubmit(XmlaOlap4jServerInfos serverInfos, String request)
          Submits a request for background execution.
 void setCache(Map<String,String> config, Map<String,String> properties)
          Sets the cache class to use as a SOAP message cache.
 Future<byte[]> submit(XmlaOlap4jServerInfos serverInfos, String request)
          Submits a request for background execution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlaOlap4jHttpProxy

public XmlaOlap4jHttpProxy(XmlaOlap4jDriver driver)
Creates a XmlaOlap4jHttpProxy.

Parameters:
driver - Driver
Method Detail

getResponse

public byte[] getResponse(XmlaOlap4jServerInfos serverInfos,
                          String request)
                   throws XmlaOlap4jProxyException
Sends a request to a URL and returns the response.

request - Request string
Returns:
Response
Throws:
XmlaOlap4jProxyException

getResponseViaSubmit

public Future<byte[]> getResponseViaSubmit(XmlaOlap4jServerInfos serverInfos,
                                           String request)
Submits a request for background execution.

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.


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:
XmlaOlap4jCache

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

SourceForge.net_Logo