001 /* 002 // $Id: XmlaOlap4jProxy.java 243 2009-05-22 07:21:37Z jhyde $ 003 // This software is subject to the terms of the Eclipse Public License v1.0 004 // Agreement, available at the following URL: 005 // http://www.eclipse.org/legal/epl-v10.html. 006 // Copyright (C) 2007-2008 Julian Hyde 007 // All Rights Reserved. 008 // You must accept the terms of that agreement to use this software. 009 */ 010 package org.olap4j.driver.xmla.proxy; 011 012 import java.io.IOException; 013 import java.net.URL; 014 import java.util.concurrent.Future; 015 016 /** 017 * Defines a common set of methods for proxy objects. 018 * @version $Id: XmlaOlap4jProxy.java 243 2009-05-22 07:21:37Z jhyde $ 019 */ 020 public interface XmlaOlap4jProxy { 021 /** 022 * Sends a request to a URL and returns the response. 023 * 024 * @param url Target URL 025 * @param request Request string 026 * @return Response The byte array that contains the whole response 027 * from the server. 028 * @throws IOException This exception declaration will be removed soon. 029 * Don't catch this. Catch XmlaOlap4jProxyException instead. 030 * @throws XmlaOlap4jProxyException If anything occurs during the 031 * request execution. 032 */ 033 /* 034 * FIXME We will need to remove the IOException declaration because 035 * this type of error is linked to the proxy type. A wrapper 036 * class was created, but some proxies out there (MondrianInprocProxy...) 037 * still uses this. 038 */ 039 byte[] get( 040 URL url, 041 String request) 042 throws XmlaOlap4jProxyException, IOException; 043 044 /** 045 * Submits a request for background execution. 046 * 047 * @param url URL 048 * @param request Request 049 * @return Future object representing the submitted job 050 */ 051 Future<byte[]> submit( 052 URL url, 053 String request); 054 055 /** 056 * Returns the name of the character set use for encoding the XML 057 * string. 058 */ 059 String getEncodingCharsetName(); 060 } 061 062 // End XmlaOlap4jProxy.java