Search in sources :

Example 36 with TCompactProtocol

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

the class TestUserClient method main.

public static void main(String[] args) throws TException, IOException {
    THttpClient thriftClient = new THttpClient("http://127.0.0.1:8080/users/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    UserService.Iface client = new UserService.Client(protocol);
    System.out.println(client.getByEmail("cedric.bodet@tngtech.com"));
}
Also used : TProtocol(org.apache.thrift.protocol.TProtocol) UserService(org.eclipse.sw360.datahandler.thrift.users.UserService) THttpClient(org.apache.thrift.transport.THttpClient) TCompactProtocol(org.apache.thrift.protocol.TCompactProtocol) THttpClient(org.apache.thrift.transport.THttpClient)

Example 37 with TCompactProtocol

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

the class TestModerationClient method main.

public static void main(String[] args) throws TException, IOException {
    THttpClient thriftClient = new THttpClient("http://127.0.0.1:8080//moderation/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    ModerationService.Iface client = new ModerationService.Client(protocol);
    List<ModerationRequest> requestsByModerator = client.getRequestsByModerator(new User().setId("").setEmail("cedric.bodet@tngtech.com").setDepartment("BB"));
    System.out.println("Fetched " + requestsByModerator.size() + " moderation requests from moderation service");
}
Also used : ModerationService(org.eclipse.sw360.datahandler.thrift.moderation.ModerationService) ModerationRequest(org.eclipse.sw360.datahandler.thrift.moderation.ModerationRequest) User(org.eclipse.sw360.datahandler.thrift.users.User) 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 38 with TCompactProtocol

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

the class Sw360ProjectService method getThriftProjectClient.

private ProjectService.Iface getThriftProjectClient() throws TTransportException {
    THttpClient thriftClient = new THttpClient(thriftServerUrl + "/projects/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    return new ProjectService.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 39 with TCompactProtocol

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

the class Sw360VendorService method getThriftVendorClient.

private VendorService.Iface getThriftVendorClient() throws TTransportException {
    THttpClient thriftClient = new THttpClient(thriftServerUrl + "/vendors/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    return new VendorService.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 40 with TCompactProtocol

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

the class Sw360LicenseInfoService method getThriftLicenseInfoClient.

private LicenseInfoService.Iface getThriftLicenseInfoClient() throws TTransportException {
    THttpClient thriftClient = new THttpClient(thriftServerUrl + "/licenseinfo/thrift");
    TProtocol protocol = new TCompactProtocol(thriftClient);
    return new LicenseInfoService.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)

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