use of org.ow2.proactive.authentication.ConnectionInfo in project scheduling by ow2-proactive.
the class SchedulerClient method init.
@Override
public void init(ConnectionInfo connectionInfo) throws Exception {
HttpClient client = new HttpClientBuilder().insecure(connectionInfo.isInsecure()).useSystemProperties().build();
SchedulerRestClient restApiClient = new SchedulerRestClient(connectionInfo.getUrl(), new ApacheHttpClient4Engine(client));
ResteasyProviderFactory factory = ResteasyProviderFactory.getInstance();
factory.register(new WildCardTypeReader());
factory.register(new OctetStreamReader());
factory.register(new TaskResultReader());
setApiClient(restApiClient);
this.connectionInfo = connectionInfo;
this.initialized = true;
renewSession();
}
use of org.ow2.proactive.authentication.ConnectionInfo in project scheduling by ow2-proactive.
the class DataSpaceClient method init.
public void init(ConnectionInfo connectionInfo) throws Exception {
ISchedulerClient client = SchedulerClient.createInstance();
client.init(connectionInfo);
init(connectionInfo.getUrl(), client);
}
use of org.ow2.proactive.authentication.ConnectionInfo in project scheduling by ow2-proactive.
the class DataTransferTest method clientInstance.
private IDataSpaceClient clientInstance() throws Exception {
DataSpaceClient client = new DataSpaceClient();
client.init(new ConnectionInfo(getRestServerUrl(), getLogin(), getPassword(), null, true));
return client;
}
use of org.ow2.proactive.authentication.ConnectionInfo in project scheduling by ow2-proactive.
the class SchedulerClientTest method testGetGroups.
@Test(timeout = MAX_WAIT_TIME)
public void testGetGroups() throws Exception {
ISchedulerClient client = SchedulerClient.createInstance();
client.init(new ConnectionInfo(getRestServerUrl(), getLogin(), getPassword(), null, true));
UserData userData = client.getCurrentUserData();
Assert.assertNotNull(userData);
Assert.assertNotNull(userData.getGroups());
Assert.assertTrue(userData.getGroups().contains("admin"));
client.disconnect();
client.init(new ConnectionInfo(getRestServerUrl(), getNonAdminLogin(), getNonAdminLoginPassword(), null, true));
userData = client.getCurrentUserData();
Assert.assertNotNull(userData);
Assert.assertNotNull(userData.getGroups());
Assert.assertTrue(userData.getGroups().contains("user"));
client.disconnect();
}
use of org.ow2.proactive.authentication.ConnectionInfo in project scheduling by ow2-proactive.
the class SchedulerClientTest method clientInstance.
private ISchedulerClient clientInstance() throws Exception {
ISchedulerClient client = SchedulerClient.createInstance();
client.init(new ConnectionInfo(getRestServerUrl(), getLogin(), getPassword(), null, true));
return client;
}
Aggregations