Search in sources :

Example 11 with TCompactProtocol

use of org.apache.thrift.protocol.TCompactProtocol in project sw360portal by sw360.

the class Sw360ComponentService method getThriftComponentClient.

private ComponentService.Iface getThriftComponentClient() throws TTransportException {
    THttpClient thriftClient = new THttpClient(thriftServerUrl + "/components/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    return new ComponentService.Client(protocol);
}
Also used : TProtocol(org.apache.thrift.protocol.TProtocol) THttpClient(org.apache.thrift.transport.THttpClient) TCompactProtocol(org.apache.thrift.protocol.TCompactProtocol) THttpClient(org.apache.thrift.transport.THttpClient)

Example 12 with TCompactProtocol

use of org.apache.thrift.protocol.TCompactProtocol in project sw360portal by sw360.

the class Sw360LicenseService method getThriftLicenseClient.

private LicenseService.Iface getThriftLicenseClient() throws TTransportException {
    THttpClient thriftClient = new THttpClient(thriftServerUrl + "/licenses/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    return new LicenseService.Client(protocol);
}
Also used : TProtocol(org.apache.thrift.protocol.TProtocol) THttpClient(org.apache.thrift.transport.THttpClient) TCompactProtocol(org.apache.thrift.protocol.TCompactProtocol) THttpClient(org.apache.thrift.transport.THttpClient)

Example 13 with TCompactProtocol

use of org.apache.thrift.protocol.TCompactProtocol in project sw360portal by sw360.

the class Sw360VulnerabilityService method getThriftVulnerabilityClient.

private VulnerabilityService.Iface getThriftVulnerabilityClient() throws TTransportException {
    THttpClient thriftClient = new THttpClient(thriftServerUrl + "/vulnerabilities/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    return new VulnerabilityService.Client(protocol);
}
Also used : TProtocol(org.apache.thrift.protocol.TProtocol) THttpClient(org.apache.thrift.transport.THttpClient) TCompactProtocol(org.apache.thrift.protocol.TCompactProtocol) THttpClient(org.apache.thrift.transport.THttpClient)

Example 14 with TCompactProtocol

use of org.apache.thrift.protocol.TCompactProtocol in project sw360portal by sw360.

the class Sw360AttachmentService method getThriftComponentClient.

private ComponentService.Iface getThriftComponentClient() throws TTransportException {
    THttpClient thriftClient = new THttpClient(thriftServerUrl + "/components/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    return new ComponentService.Client(protocol);
}
Also used : TProtocol(org.apache.thrift.protocol.TProtocol) THttpClient(org.apache.thrift.transport.THttpClient) TCompactProtocol(org.apache.thrift.protocol.TCompactProtocol) THttpClient(org.apache.thrift.transport.THttpClient)

Example 15 with TCompactProtocol

use of org.apache.thrift.protocol.TCompactProtocol in project sw360portal by sw360.

the class ThriftClients method makeProtocol.

/**
 * Creates a Thrift Compact Protocol object linked to the given address
 */
private static TProtocol makeProtocol(String url, String service) {
    THttpClient thriftClient = null;
    final String destinationAddress = url + service;
    try {
        thriftClient = new THttpClient(destinationAddress);
    } catch (TTransportException e) {
        log.error("cannot connect to backend on " + destinationAddress, e);
    }
    return new TCompactProtocol(thriftClient);
}
Also used : THttpClient(org.apache.thrift.transport.THttpClient) TTransportException(org.apache.thrift.transport.TTransportException) TCompactProtocol(org.apache.thrift.protocol.TCompactProtocol)

Aggregations

TCompactProtocol (org.apache.thrift.protocol.TCompactProtocol)54 TProtocol (org.apache.thrift.protocol.TProtocol)38 THttpClient (org.apache.thrift.transport.THttpClient)18 TSocket (org.apache.thrift.transport.TSocket)18 TException (org.apache.thrift.TException)15 TTransport (org.apache.thrift.transport.TTransport)11 TFramedTransport (org.apache.thrift.transport.TFramedTransport)9 IOException (java.io.IOException)8 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)7 TBinaryProtocol (org.apache.thrift.protocol.TBinaryProtocol)7 TIOStreamTransport (org.apache.thrift.transport.TIOStreamTransport)7 TTransportException (org.apache.thrift.transport.TTransportException)5 TFramedTransport (org.apache.thrift.transport.layered.TFramedTransport)5 Test (org.junit.Test)5 LoginException (javax.security.auth.login.LoginException)4 Hello (org.tech.model.Hello)4 URI (java.net.URI)3 ArrayList (java.util.ArrayList)3 UGIAssumingTransport (org.apache.accumulo.core.rpc.UGIAssumingTransport)3 AccumuloProxy (org.apache.accumulo.proxy.thrift.AccumuloProxy)3