Search in sources :

Example 61 with BasicNameValuePair

use of org.apache.http.message.BasicNameValuePair in project tdi-studio-se by Talend.

the class paloconnection method shutdown.

// Shutdowns the Server
public void shutdown() throws paloexception {
    List<NameValuePair> qparams = new ArrayList<NameValuePair>();
    qparams.add(new BasicNameValuePair("sid", this.strToken));
    sendToServerSingleRC(qparams, "/server/shutdown");
}
Also used : BasicNameValuePair(org.apache.http.message.BasicNameValuePair) NameValuePair(org.apache.http.NameValuePair) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) ArrayList(java.util.ArrayList)

Example 62 with BasicNameValuePair

use of org.apache.http.message.BasicNameValuePair in project tdi-studio-se by Talend.

the class palocube method unload.

public void unload() throws paloexception {
    List<NameValuePair> qparams = new ArrayList<NameValuePair>();
    qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
    qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
    qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
    plConn.sendToServerSingleRC(qparams, "/cube/unload");
}
Also used : BasicNameValuePair(org.apache.http.message.BasicNameValuePair) NameValuePair(org.apache.http.NameValuePair) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) ArrayList(java.util.ArrayList)

Example 63 with BasicNameValuePair

use of org.apache.http.message.BasicNameValuePair in project tdi-studio-se by Talend.

the class palocube method refreshCubeInfo.

public void refreshCubeInfo() throws paloexception {
    List<NameValuePair> qparams = new ArrayList<NameValuePair>();
    qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
    qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
    qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
    try {
        HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/info");
        CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
        csv.setQuoteChar('"');
        csv.readNext();
        this.iCubeId = palohelpers.StringToInt(csv.get(0));
        this.strCubeName = csv.get(1);
        this.iNumberOfDimensions = palohelpers.StringToInt(csv.get(2));
        this.iArrDimensionsIdentifier = palohelpers.StringToIntArray(csv.get(3), palohelpers.StringToInt(csv.get(2)));
        this.iNumberOfCells = palohelpers.StringToLong(csv.get(4));
        this.lNumberOfFilledCells = palohelpers.StringToLong(csv.get(5));
        this.iCubeStatus = palohelpers.StringToInt(csv.get(6));
        this.iCubeType = palohelpers.StringToInt(csv.get(7));
        this.iCubeToken = palohelpers.StringToInt(csv.get(8));
        csv.close();
        entity.consumeContent();
    } catch (Exception e) {
        throw new paloexception(e.getMessage());
    }
}
Also used : BasicNameValuePair(org.apache.http.message.BasicNameValuePair) NameValuePair(org.apache.http.NameValuePair) HttpEntity(org.apache.http.HttpEntity) CSVReader(com.talend.csv.CSVReader) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) ArrayList(java.util.ArrayList)

Example 64 with BasicNameValuePair

use of org.apache.http.message.BasicNameValuePair in project tdi-studio-se by Talend.

the class palocube method rename.

public void rename(String strCubeNewName) throws paloexception {
    if (null != strCubeNewName && strCubeNewName.length() > 0 && !strCubeName.equals(strCubeNewName)) {
        List<NameValuePair> qparams = new ArrayList<NameValuePair>();
        qparams.add(new BasicNameValuePair("sid", this.plConn.getPaloToken()));
        qparams.add(new BasicNameValuePair("database", String.valueOf(lDatabaseId)));
        qparams.add(new BasicNameValuePair("cube", String.valueOf(iCubeId)));
        qparams.add(new BasicNameValuePair("new_name", strCubeNewName));
        try {
            HttpEntity entity = this.plConn.sendToServer(qparams, "/cube/rename");
            CSVReader csv = new CSVReader(entity.getContent(), ';', "UTF-8");
            csv.setQuoteChar('"');
            csv.readNext();
            this.strCubeName = csv.get(1);
            csv.close();
            entity.consumeContent();
        } catch (Exception e) {
            throw new paloexception(e.getMessage());
        }
    }
}
Also used : BasicNameValuePair(org.apache.http.message.BasicNameValuePair) NameValuePair(org.apache.http.NameValuePair) HttpEntity(org.apache.http.HttpEntity) CSVReader(com.talend.csv.CSVReader) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) ArrayList(java.util.ArrayList)

Example 65 with BasicNameValuePair

use of org.apache.http.message.BasicNameValuePair in project tdi-studio-se by Talend.

the class palocube method load.

public void load() throws paloexception {
    List<NameValuePair> qparams = new ArrayList<NameValuePair>();
    qparams.add(new BasicNameValuePair("sid", plConn.getPaloToken()));
    qparams.add(new BasicNameValuePair("database", String.valueOf(this.lDatabaseId)));
    qparams.add(new BasicNameValuePair("cube", String.valueOf(this.iCubeId)));
    plConn.sendToServerSingleRC(qparams, "/cube/load");
}
Also used : BasicNameValuePair(org.apache.http.message.BasicNameValuePair) NameValuePair(org.apache.http.NameValuePair) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) ArrayList(java.util.ArrayList)

Aggregations

BasicNameValuePair (org.apache.http.message.BasicNameValuePair)289 NameValuePair (org.apache.http.NameValuePair)199 ArrayList (java.util.ArrayList)187 UrlEncodedFormEntity (org.apache.http.client.entity.UrlEncodedFormEntity)101 HttpPost (org.apache.http.client.methods.HttpPost)87 HttpResponse (org.apache.http.HttpResponse)77 HttpEntity (org.apache.http.HttpEntity)58 IOException (java.io.IOException)55 DefaultHttpClient (org.apache.http.impl.client.DefaultHttpClient)33 Test (org.junit.Test)32 HttpGet (org.apache.http.client.methods.HttpGet)29 ClientProtocolException (org.apache.http.client.ClientProtocolException)28 CSVReader (com.talend.csv.CSVReader)27 HttpClient (org.apache.http.client.HttpClient)25 UnsupportedEncodingException (java.io.UnsupportedEncodingException)23 HashMap (java.util.HashMap)20 JSONObject (org.json.JSONObject)20 Map (java.util.Map)19 URI (java.net.URI)16 WebserviceInvocation (com.github.hakko.musiccabinet.domain.model.library.WebserviceInvocation)15