001 /*
002 // $Id: XmlaOlap4jProxy.java 482 2012-01-05 23:27:27Z jhyde $
003 //
004 // Licensed to Julian Hyde under one or more contributor license
005 // agreements. See the NOTICE file distributed with this work for
006 // additional information regarding copyright ownership.
007 //
008 // Julian Hyde licenses this file to you under the Apache License,
009 // Version 2.0 (the "License"); you may not use this file except in
010 // compliance with the License. You may obtain a copy of the License at:
011 //
012 // http://www.apache.org/licenses/LICENSE-2.0
013 //
014 // Unless required by applicable law or agreed to in writing, software
015 // distributed under the License is distributed on an "AS IS" BASIS,
016 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017 // See the License for the specific language governing permissions and
018 // limitations under the License.
019 */
020 package org.olap4j.driver.xmla.proxy;
021
022 import org.olap4j.driver.xmla.XmlaOlap4jServerInfos;
023
024 import java.util.concurrent.Future;
025
026 /**
027 * Defines a common set of methods for proxy objects.
028 * @version $Id: XmlaOlap4jProxy.java 482 2012-01-05 23:27:27Z jhyde $
029 */
030 public interface XmlaOlap4jProxy {
031 /**
032 * Sends a request to a URL and returns the response.
033 *
034 * @param serverInfos Server infos.
035 * @param request Request string
036 * @return Response The byte array that contains the whole response
037 * from the server.
038 * @throws XmlaOlap4jProxyException If anything occurs during the
039 * request execution.
040 */
041 byte[] get(
042 XmlaOlap4jServerInfos serverInfos,
043 String request)
044 throws XmlaOlap4jProxyException;
045
046 /**
047 * Submits a request for background execution.
048 *
049 * @param serverInfos Server infos.
050 * @param request Request
051 * @return Future object representing the submitted job
052 */
053 Future<byte[]> submit(
054 XmlaOlap4jServerInfos serverInfos,
055 String request);
056
057 /**
058 * Returns the name of the character set use for encoding the XML
059 * string.
060 */
061 String getEncodingCharsetName();
062 }
063
064 // End XmlaOlap4jProxy.java