use of org.ow2.proactive_grid_cloud_portal.common.RMRestInterface in project scheduling by ow2-proactive.
the class RMRestTest method callGetStatHistory.
private JSONObject callGetStatHistory() throws Exception {
RMProxyUserInterface rmMock = mock(RMProxyUserInterface.class);
String sessionId = SharedSessionStoreTestUtils.createValidSession(rmMock);
AttributeList value = new AttributeList(Collections.singletonList(new Attribute("test", createRrdDb().getBytes())));
when(rmMock.getMBeanAttributes(Matchers.<ObjectName>any(), Matchers.<String[]>any())).thenReturn(value);
RMRestInterface client = ProxyFactory.create(RMRestInterface.class, "http://localhost:" + port + "/");
String statHistory = client.getStatHistory(sessionId, "hhhhh");
return (JSONObject) new JSONParser().parse(statHistory);
}
use of org.ow2.proactive_grid_cloud_portal.common.RMRestInterface in project scheduling by ow2-proactive.
the class RMRestTest method callGetStatHistory.
private JSONObject callGetStatHistory(byte[] rrdb, ConsolFun function) throws Exception {
RMProxyUserInterface rmMock = mock(RMProxyUserInterface.class);
String sessionId = SharedSessionStoreTestUtils.createValidSession(rmMock);
AttributeList value = new AttributeList(Collections.singletonList(new Attribute("test", rrdb)));
when(rmMock.getMBeanAttributes(Matchers.<ObjectName>any(), Matchers.<String[]>any())).thenReturn(value);
RMRestInterface client = ProxyFactory.create(RMRestInterface.class, "http://localhost:" + port + "/");
String statHistory = client.getStatHistory(sessionId, "hhhhh", function.name());
return (JSONObject) new JSONParser().parse(statHistory);
}
use of org.ow2.proactive_grid_cloud_portal.common.RMRestInterface in project scheduling by ow2-proactive.
the class RMClientExample method main.
public static void main(String[] args) throws LoginException, KeyException, RMException {
System.out.println("Hello from example.");
RMRestClient client = new RMRestClient("http://localhost:8080/rest/", null);
RMRestInterface rm = client.getRm();
String sessionId = rm.rmConnect("admin", "admin");
System.out.println(sessionId);
}
use of org.ow2.proactive_grid_cloud_portal.common.RMRestInterface in project scheduling by ow2-proactive.
the class RMRestClient method createRestProxy.
private static RMRestInterface createRestProxy(ResteasyProviderFactory provider, String restEndpointURL, ClientHttpEngine httpEngine) {
ResteasyClient client = buildResteasyClient(provider);
ResteasyWebTarget target = client.target(restEndpointURL);
RMRestInterface rmRestInterface = target.proxy(RMRestInterface.class);
return createExceptionProxy(rmRestInterface);
}
Aggregations