RemoteCollector { public String executeActionAndCollectData(Action action, String counterName, String sessionId, String threadId, String jobId, String cacheId) throws IOException { assert action != null; final List<URL> actionUrls = new ArrayList<URL>(getURLs().size()); for (final URL url : getURLs()) { final URL actionUrl = createRemoteCall(url).getActionUrl(action, counterName, sessionId, threadId, jobId, cacheId); actionUrls.add(actionUrl); } return collectDataWithUrls(actionUrls); } RemoteCollector(String application, List<URL> urls); String collectDataIncludingCurrentRequests(); String executeActionAndCollectData(Action action, String counterName, String sessionId,
			String threadId, String jobId, String cacheId); List<SessionInformations> collectSessionInformations(String sessionId); List<SampledMethod> collectHotspots(); HeapHistogram collectHeapHistogram(); DatabaseInformations collectDatabaseInformations(int requestIndex); List<List<ConnectionInformations>> collectConnectionInformations(); Map<String, List<ProcessInformations>> collectProcessInformations(); List<JndiBinding> collectJndiBindings(String path); Map<String, List<MBeanNode>> collectMBeans(); Map<String, MavenArtifact> collectWebappDependencies(); Map<String, Date> collectWebappVersions(); Map<JavaInformations, List<CounterRequestContext>> collectCurrentRequests(); Map<String, byte[]> collectJRobins(int width, int height); Map<String, byte[]> collectOtherJRobins(int width, int height); byte[] collectJRobin(String graphName, int width, int height); String collectSqlRequestExplainPlan(String sqlRequest); static String getHostAndPort(URL url); String getApplication(); List<URL> getURLs(); Collector getCollector(); List<JavaInformations> getJavaInformationsList(); Map<JavaInformations, List<CounterRequestContext>> getCurrentRequests(); void setURLs(List<URL> newURLs); void setCookies(String cookies); void disableAggregation();  }
@Test public void testExecute() throws IOException { remoteCollector.executeActionAndCollectData(Action.CLEAR_COUNTER, "all", null, null, null, null); remoteCollector.executeActionAndCollectData(Action.INVALIDATE_SESSION, null, "nothing", null, null, null); remoteCollector.executeActionAndCollectData(Action.KILL_THREAD, null, null, "nothing", null, null); remoteCollector.executeActionAndCollectData(Action.PAUSE_JOB, null, null, null, "nothing", null); remoteCollector.executeActionAndCollectData(Action.CLEAR_CACHE, null, null, null, null, "nothing"); }