.classpath | 3 etc/eclipse-tools/maven/RHQ | 2 modules/enterprise/gui/coregui/pom.xml | 7 modules/enterprise/gui/portal-war/pom.xml | 7 modules/enterprise/remoting/ant-run.xml | 7 modules/enterprise/remoting/cli/src/etc/build.xml | 6 modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java | 1 modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMainWebServices.java | 379 -- modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/utility/Utility.java | 81 modules/enterprise/remoting/cli/src/test/java/org/rhq/enterprise/client/ClientMainTest.java | 786 ------ modules/enterprise/remoting/client-api/pom.xml | 7 modules/enterprise/remoting/pom.xml | 15 modules/enterprise/remoting/webservices/pom.xml | 256 - modules/enterprise/remoting/webservices/src/main/java/org/rhq/enterprise/server/ws/utility/WsUtility.java | 59 modules/enterprise/remoting/webservices/src/main/scripts/rhq-client.build.xml | 224 - modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/JaxbUtilities.java | 35 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestPropertiesInterface.java | 16 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestRemoteInterface.java | 666 ----- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertDefinitionManagerTest.java | 406 --- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertManagerTest.java | 393 --- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java | 378 -- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsDataAccessManagerTest.java | 97 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsEventManagerTest.java | 294 -- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementDefinitionManagerTest.java | 118 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementScheduleManagerTest.java | 144 - modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsOperationManagerTest.java | 323 -- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRepoManagerTest.java | 577 ---- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceGroupManagerTest.java | 210 - modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceManagerTest.java | 312 -- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceTypeManagerTest.java | 126 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRoleManagerTest.java | 123 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSubjectTest.java | 398 --- modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSupportManagerTest.java | 92 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSystemManagerTest.java | 62 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsAdvisoryManagerTest.java | 112 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsDistributionManagerTest.java | 88 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsUnitTestBase.java | 72 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsResourceUtility.java | 115 modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsSubjectUtility.java | 153 - modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml | 3 modules/enterprise/server/container/pom.xml | 9 modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/ejb3.deployer/META-INF/jboss-service.xml | 3 modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws-management.war/WEB-INF/web.xml | 78 modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml | 504 --- modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml | 109 modules/enterprise/server/jar/pom.xml | 29 modules/enterprise/server/jar/src/main/filtered-sources/java/org/rhq/enterprise/server/system/ServerVersion.java | 80 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java | 33 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerRemote.java | 32 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerRemote.java | 60 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java | 112 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java | 203 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java | 130 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java | 103 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java | 112 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java | 109 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java | 1 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerRemote.java | 108 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java | 8 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossRemote.java | 29 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerRemote.java | 39 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java | 49 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceMapAdapter.java | 51 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceTypeAdapter.java | 51 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ConfigurationAdapter.java | 189 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/MeasurementDataNumericHighLowCompositeAdapter.java | 67 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceGroupAdapter.java | 144 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceListAdapter.java | 182 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/WsResource.java | 138 - modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/AvailabilityManagerRemote.java | 23 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerRemote.java | 33 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerRemote.java | 12 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java | 5 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java | 73 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerRemote.java | 16 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerRemote.java | 13 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerRemote.java | 94 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java | 42 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java | 93 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java | 1 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteWsInvocationHandler.java | 656 ----- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerLocal.java | 12 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerRemote.java | 16 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java | 94 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerRemote.java | 85 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java | 5 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java | 80 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerRemote.java | 24 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java | 12 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java | 70 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java | 37 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerRemote.java | 13 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/SynchronizationManagerRemote.java | 3 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java | 35 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestBean.java | 81 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestLocal.java | 34 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestRemote.java | 113 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/RemoteAPIValidator.java | 30 modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java | 1297 ---------- modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesRemote.java | 72 modules/enterprise/server/safe-invoker/pom.xml | 16 modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvoker.java | 58 modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvokerDeploymentAspect.java | 59 pom.xml | 8 104 files changed, 488 insertions(+), 12742 deletions(-)
New commits: commit e2839dca4a89d30d297dd0f57f6737a73fd7c21e Author: Jay Shaughnessy jshaughn@jshaughn.csb Date: Mon Aug 27 16:18:52 2012 -0400
Fix issue in eclipse I18N launcher
diff --git a/etc/eclipse-tools/maven/RHQ Maven Build - Generate GWT I18N Messages.launch b/etc/eclipse-tools/maven/RHQ Maven Build - Generate GWT I18N Messages.launch index ba390ec..0b86a8f 100644 --- a/etc/eclipse-tools/maven/RHQ Maven Build - Generate GWT I18N Messages.launch +++ b/etc/eclipse-tools/maven/RHQ Maven Build - Generate GWT I18N Messages.launch @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType"> <stringAttribute key="bad_container_name" value="\rhq\etc\eclipse-tools\maven"/> -<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <launchConfigurationWorkingSet factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1289934079470_4" label="working set" name="working set"> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/rhq/modules/enterprise/gui/coregui/pom.xml" type="1"/> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/rhq/modules/enterprise/gui/coregui/src" type="2"/> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/rhq/modules/enterprise/gui/coregui/target" type="2"/> </launchConfigurationWorkingSet>}"/> +<stringAttribute key="org.eclipse.debug.core.ATTR_REFRESH_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <resources> <item path="/rhq/modules/enterprise/gui/coregui/pom.xml" type="1"/> <item path="/rhq/modules/enterprise/gui/coregui/src" type="2"/> <item path="/rhq/modules/enterprise/gui/coregui/target" type="2"/> </resources>}"/> <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/> <listAttribute key="org.eclipse.debug.ui.favoriteGroups"> <listEntry value="org.eclipse.ui.externaltools.launchGroup"/>
commit 100c8067b04a063bf8672a1c900b44ee5a05ede7 Author: Jay Shaughnessy jshaughn@jshaughn.csb Date: Mon Aug 27 16:18:27 2012 -0400
Remove WebService support from RHQ.
diff --git a/.classpath b/.classpath index 5d58d06..5e879c9 100644 --- a/.classpath +++ b/.classpath @@ -41,7 +41,6 @@ <classpathentry kind="src" path="modules/enterprise/server/xml-schemas/target/generated-sources/xjc"/> <classpathentry kind="src" path="modules/enterprise/server/jar/src/main/java"/> <classpathentry kind="src" path="modules/enterprise/server/jar/src/test/java"/> - <classpathentry kind="src" path="modules/enterprise/server/jar/src/main/filtered-sources/java"/> <classpathentry kind="src" path="modules/enterprise/server/jar/target/generated-sources/antlr3"/> <classpathentry kind="src" path="modules/enterprise/binding/src/main/java"/> <classpathentry kind="src" path="modules/enterprise/binding/src/test/java"/> @@ -243,8 +242,6 @@ <classpathentry exported="true" kind="var" path="M2_REPO/org/hyperic/sigar/1.6.5.132/sigar-1.6.5.132.jar" sourcepath="/M2_REPO/org/hyperic/sigar/1.6.3.82/sigar-1.6.3.82-sources.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/transaction/jboss-jta/4.2.3.SP5/jboss-jta-4.2.3.SP5.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/transaction/jboss-jts-common/4.2.3.SP5/jboss-jts-common-4.2.3.SP5.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/jbossws-spi/1.1.1.GA/jbossws-spi-1.1.1.GA.jar"/> - <classpathentry exported="true" kind="var" path="M2_REPO/org/jboss/jbossws/jbossws-native-core/3.1.1.GA/jbossws-native-core-3.1.1.GA.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0.8/maven-project-2.0.8.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/apache/maven/maven-plugin-api/2.0.8/maven-plugin-api-2.0.8.jar"/> <classpathentry exported="true" kind="var" path="M2_REPO/org/codehaus/swizzle/swizzle-confluence/1.6.1/swizzle-confluence-1.6.1.jar"/> diff --git a/modules/enterprise/gui/coregui/pom.xml b/modules/enterprise/gui/coregui/pom.xml index 52e1616..74cac97 100644 --- a/modules/enterprise/gui/coregui/pom.xml +++ b/modules/enterprise/gui/coregui/pom.xml @@ -223,13 +223,6 @@ </dependency>
<dependency> - <groupId>jboss.jbossws</groupId> - <artifactId>jboss-jaxws</artifactId> - <version>3.0.1-native-2.0.4.GA</version> - <scope>provided</scope> <!-- by JBossAS --> - </dependency> - - <dependency> <groupId>org.jboss.resteasy</groupId> <artifactId>resteasy-jaxrs</artifactId> <version>${resteasy.version}</version> diff --git a/modules/enterprise/gui/portal-war/pom.xml b/modules/enterprise/gui/portal-war/pom.xml index 1456342..cd7fe4e 100644 --- a/modules/enterprise/gui/portal-war/pom.xml +++ b/modules/enterprise/gui/portal-war/pom.xml @@ -367,13 +367,6 @@ </dependency>
<dependency> - <groupId>jboss.jbossws</groupId> - <artifactId>jboss-jaxws</artifactId> - <version>3.0.1-native-2.0.4.GA</version> - <scope>provided</scope> <!-- by JBossAS --> - </dependency> - - <dependency> <groupId>xalan</groupId> <artifactId>xalan</artifactId> <version>2.5.1</version> diff --git a/modules/enterprise/remoting/ant-run.xml b/modules/enterprise/remoting/ant-run.xml index 163a01e..e2810a5 100644 --- a/modules/enterprise/remoting/ant-run.xml +++ b/modules/enterprise/remoting/ant-run.xml @@ -92,13 +92,6 @@ ANT Script that provides ways to package the agent. <fileset refid="run.classpath.fileset" /> </copy>
- <!-- only used for the webservices flavor - <copy todir="${client.distro.dir}/lib/endorsed" - flatten="true"> - <fileset refid="endorsed.classpath.fileset" /> - </copy> - --> - <mkdir dir="${client.distro.dir}/bin"/> <copy todir="${client.distro.dir}/bin"> <fileset dir="${basedir}/src/etc" diff --git a/modules/enterprise/remoting/cli/src/etc/build.xml b/modules/enterprise/remoting/cli/src/etc/build.xml index 6775709..6aa91c1 100644 --- a/modules/enterprise/remoting/cli/src/etc/build.xml +++ b/modules/enterprise/remoting/cli/src/etc/build.xml @@ -23,10 +23,6 @@ <property name="i18-jar" location="${repo}/i18nlog/i18nlog/1.0.10/i18nlog-1.0.10.jar"/>
- <property name="jbossws" - location="C:/installers/Jboss/jbossws-native-3.1.2.GA.zip"/> - - <property name="runLocation" value="${basedir}/run"/>
<path id="project.class.path"> @@ -34,7 +30,6 @@ <pathelement location="${runLocation}/remoting.jar"/> <pathelement location="${runLocation}/jline-0.9.94.jar"/> <pathelement location="${runLocation}/i18nlog-1.0.10.jar"/> - <pathelement location="${runLocation}/jbossws-native-3.1.2.GA.zip"/> <!-- <pathelement path="${java.class.path}/"/> <pathelement path="${additional.path}"/> --> </path> @@ -55,7 +50,6 @@ <copy tofile="${runLocation}/jline-0.9.94.jar" file="${jline-jar}"/> <copy tofile="${runLocation}/getopt-1.0.13.jar" file="${gnu-jar}"/> <copy tofile="${runLocation}/i18nlog-1.0.10.jar" file="${i18-jar}"/> - <copy tofile="${runLocation}/jbossws-native-3.1.2.GA.zip" file="${jbossws}"/> <copy tofile="${runLocation}/toRun.txt" file="${basedir}/toRun.txt"/> <!-- <copy todir="${runLocation}"> <fileset dir="src_dir" excludes="**/*.java"/> diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java index e068272..3194108 100644 --- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java +++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMain.java @@ -96,7 +96,6 @@ public class ClientMain { private String language; private ArrayList<String> notes = new ArrayList<String>();
- // reference to the webservice reference factory private RemoteClient remoteClient;
// The subject that will be used to carry out all requested actions diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMainWebServices.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMainWebServices.java deleted file mode 100644 index 6bc0fc0..0000000 --- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/ClientMainWebServices.java +++ /dev/null @@ -1,379 +0,0 @@ -///* -// * JBoss, a division of Red Hat. -// * Copyright 2008, Red Hat Middleware, LLC. All rights reserved. -// */ -// -//package org.rhq.enterprise.client; -// -//import gnu.getopt.LongOpt; -//import gnu.getopt.Getopt; -// -//import java.io.File; -//import java.io.BufferedReader; -//import java.io.FileReader; -//import java.io.PrintWriter; -//import java.io.FileWriter; -//import java.io.IOException; -//import java.io.InputStreamReader; -//import java.io.ByteArrayInputStream; -//import java.io.StreamTokenizer; -//import java.net.URL; -//import java.net.MalformedURLException; -//import java.util.List; -//import java.util.ArrayList; -// -//import mazz.i18n.Msg; -// -//import javax.xml.namespace.QName; -//import javax.xml.ws.Service; -//import javax.security.auth.login.LoginException; -// -//import org.rhq.enterprise.server.auth.SubjectManagerRemote; -//import org.rhq.core.domain.auth.Subject; -// -///** -// * @author Greg Hinkle -// */ -//public class ClientMainWebServices { -// -// private static final Msg MSG = ClientI18NFactory.getMsg(); -// public static final String SERVICE_NAME_BASE = ".server.enterprise.rhq.org/"; -// public static final String WSDL_BASE = "http://localhost:7080/rhq-rhq-enterprise-server-ejb3/"; -// -// /** -// * This is the thread that is running the input loop; it accepts prompt commands from the user. -// */ -// private Thread inputLoopThread; -// -// private BufferedReader inputReader; -// -// private boolean stdinInput = true; -// -// -// private PrintWriter outputWriter; -// -// private String host; -// private String port; -// private String user; -// private String pass; -// -// -// public static void main(String[] args) { -//// ClientMain main = new ClientMain(); -//// main.processArguments(args); -//// main.start(); -// } -// -// public void start() { -// outputWriter = new PrintWriter(System.out); -// inputReader = new BufferedReader(new InputStreamReader(System.in)); -// -// } -// -// -// public void login() throws MalformedURLException, LoginException { -// -// -// URL url = new URL(WSDL_BASE + "SubjectManagerBean?wsdl"); -// QName qname = new QName("http://auth" + SERVICE_NAME_BASE, "SubjectManagerBeanService"); -// -// Service s = Service.create(url, qname); -// //s.setHandlerResolver(new ClientConsole.MyHandlerResolver(s.getHandlerResolver())); -// -// -// SubjectManagerRemote sm = s.getPort(SubjectManagerRemote.class); -// Subject subject = sm.login("jonadmin", "jonadmin"); -// -// -// } -// -// -// public String getUserInput(String prompt) { -// String input_string = ""; -// boolean use_default_prompt = (prompt == null); -// -// while ((input_string != null) && (input_string.trim().length() == 0)) { -// prompt = host + ":" + port + " "; -// -// outputWriter.print(prompt); -// -// try { -// outputWriter.flush(); -// input_string = inputReader.readLine(); -// } catch (Exception e) { -// input_string = null; -// } -// } -// -// if (input_string != null) { -// // if we are processing a script, show the input that was just read in -// if (!stdinInput) { -// outputWriter.println(input_string); -// } -// } else if (!stdinInput) { -// // if we are processing a script, we hit the EOF, so close the input stream -// try { -// inputReader.close(); -// } catch (IOException e1) { -// } -// -// // if we are not in daemon mode, let's now start processing prompt commands coming in via stdin -//// if (!m_daemonMode) { -//// inputReader = new BufferedReader(new InputStreamReader(System.in)); -//// stdinInput = true; -//// input_string = ""; -//// } else { -//// inputReader = null; -//// } -// } -// -// return input_string; -// } -// -// /** -// * This enters in an infinite loop. Because this never returns, the current thread never dies and hence the agent -// * stays up and running. The user can enter agent commands at the prompt - the commands are sent to the agent as if -// * the user is a remote client. -// */ -// private void inputLoop() { -// // we need to start a new thread and run our loop in it; otherwise, our shutdown hook doesn't work -// Runnable loop_runnable = new Runnable() { -// public void run() { -// while (true) { -// // get a command from the user -// // if in daemon mode, only get input if reading from an input file; ignore stdin -// String cmd; -//// if ((m_daemonMode == false) || (stdinInput == false)) { -// cmd = getUserInput(null); -//// } else { -//// cmd = null; -//// } -// -// try { -// // parse the command into separate arguments and execute it -// String[] cmd_args = parseCommandLine(cmd); -// boolean can_continue = executePromptCommand(cmd_args); -// -// // break the input loop if the prompt command told us to exit -// // if we are not in daemon mode, this really will end up killing the agent -// if (!can_continue) { -// break; -// } -// } catch (Throwable t) { -// //outputWriter.println(MSG.getMsg(ClientI18NResourceKeys.COMMAND_FAILURE, cmd, ThrowableUtil.getAllMessages(t))); -// //LOG.debug(t, AgentI18NResourceKeys.COMMAND_FAILURE_STACK_TRACE); -// } -// } -// -// return; -// } -// }; -// -// // start the thread -// inputLoopThread = new Thread(loop_runnable); -// inputLoopThread.setName("RHQ Agent Prompt Input Thread"); -// inputLoopThread.setDaemon(false); -// inputLoopThread.start(); -// -// return; -// } -// -// -// private boolean executePromptCommand(String[] args) { -// String cmd = args[0]; -// if (cmd.equals("findResource")) { -// -// } else if (cmd.equals("quit")) { -// return false; -// } -// return true; -// } -// -// -// /** -// * Given a command line, this will parse each argument and return the argument array. -// * -// * @param cmdLine the command line -// * @return the array of command line arguments -// */ -// private String[] parseCommandLine(String cmdLine) { -// ByteArrayInputStream in = new ByteArrayInputStream(cmdLine.getBytes()); -// StreamTokenizer strtok = new StreamTokenizer(new InputStreamReader(in)); -// List<String> args = new ArrayList<String>(); -// boolean keep_going = true; -// -// // we don't want to parse numbers and we want ' to be a normal word character -// strtok.ordinaryChars('0', '9'); -// strtok.ordinaryChar('.'); -// strtok.ordinaryChar('-'); -// strtok.ordinaryChar('''); -// strtok.wordChars(33, 127); -// strtok.quoteChar('"'); -// -// // parse the command line -// while (keep_going) { -// int nextToken; -// -// try { -// nextToken = strtok.nextToken(); -// } catch (IOException e) { -// nextToken = StreamTokenizer.TT_EOF; -// } -// -// if (nextToken == StreamTokenizer.TT_WORD) { -// args.add(strtok.sval); -// } else if (nextToken == '"') { -// args.add(strtok.sval); -// } else if ((nextToken == StreamTokenizer.TT_EOF) || (nextToken == StreamTokenizer.TT_EOL)) { -// keep_going = false; -// } -// } -// -// return args.toArray(new String[args.size()]); -// } -// -// -// private void displayUsage() { -// outputWriter.println(MSG.getMsg(ClientI18NResourceKeys.USAGE, this.getClass().getName())); -// } -// -// -// private void processArguments(String[] args) throws IllegalArgumentException { -// -// String sopts = "-:hu:p:s:t:f:"; -// LongOpt[] lopts = { -// new LongOpt("help", LongOpt.NO_ARGUMENT, null, 'h'), -// new LongOpt("user", LongOpt.REQUIRED_ARGUMENT, null, 'u'), -// new LongOpt("password", LongOpt.REQUIRED_ARGUMENT, null, 'p'), -// new LongOpt("host", LongOpt.REQUIRED_ARGUMENT, null, 's'), -// new LongOpt("port", LongOpt.REQUIRED_ARGUMENT, null, 't'), -// new LongOpt("file", LongOpt.NO_ARGUMENT, null, 'f') -// }; -// -// String config_file_name = null; -// boolean clean_config = false; -// boolean purge_data = false; -// -// Getopt getopt = new Getopt("agent", args, sopts, lopts); -// int code; -// -// while ((code = getopt.getopt()) != -1) { -// switch (code) { -// case ':': -// case '?': { -// // for now both of these should exit -// displayUsage(); -// throw new IllegalArgumentException("mm");//MSG.getMsg(ClientI18NResourceKeys.BAD_ARGS,null)); -// } -// -// case 1: { -// // this will catch non-option arguments (which we don't currently care about) -// System.err.println(MSG.getMsg(ClientI18NResourceKeys.USAGE, getopt.getOptarg())); -// break; -// } -// -// case 'h': { -// displayUsage(); -//// throw new HelpException(MSG.getMsg(ClientI18NResourceKeys.HELP_SHOWN)); -// } -// -// case 'D': { -// // set a system property -// String sysprop = getopt.getOptarg(); -// int i = sysprop.indexOf("="); -// String name; -// String value; -// -// if (i == -1) { -// name = sysprop; -// value = "true"; -// } else { -// name = sysprop.substring(0, i); -// value = sysprop.substring(i + 1, sysprop.length()); -// } -// -// System.setProperty(name, value); -// // LOG.debug(ClientI18NResourceKeys.SYSPROP_SET, name, value); -// -// break; -// } -// -// case 'c': { -// config_file_name = getopt.getOptarg(); -// break; -// } -// -// case 'l': { -// clean_config = true; -// purge_data = true; -// break; -// } -// -// case 'u': { -// purge_data = true; -// break; -// } -// -// case 'a': { -// ///m_advancedSetup = true; -// break; -// } -// -// case 's': { -// //m_forcedSetup = true; -// break; -// } -// -// case 'n': { -// //m_startAtBoot = false; -// break; -// } -// -// case 'p': { -// //se//tConfigurationPreferencesNode(getopt.getOptarg()); -// break; -// } -// -// case 'd': { -// //m_daemonMode = true; -// break; -// } -// -// case 'i': { -// File script = new File(getopt.getOptarg()); -// -// try { -// inputReader = new BufferedReader(new FileReader(script)); -// stdinInput = false; -// } catch (Exception e) { -// //throw new IllegalArgumentException(MSG.getMsg(ClientI18NResourceKeys.BAD_INPUT_FILE, script, e)); -// } -// -// break; -// } -// -// case 'o': { -// File output = new File(getopt.getOptarg()); -// -// try { -// File parentDir = output.getParentFile(); -// if ((parentDir != null) && (!parentDir.exists())) { -// parentDir.mkdirs(); -// } -// -// outputWriter = new PrintWriter(new FileWriter(output), true); -// } catch (Exception e) { -// //throw new IllegalArgumentException(MSG.getMsg(ClientI18NResourceKeys.BAD_OUTPUT_FILE, output, e)); -// } -// -// break; -// } -// -// case 't': { -// // SystemInfoFactory.disableNativeSystemInfo(); -// // LOG.info(ClientI18NResourceKeys.NATIVE_SYSTEM_DISABLED); -// } -// } -// } -// } -//} \ No newline at end of file diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/utility/Utility.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/utility/Utility.java deleted file mode 100644 index 58690b0..0000000 --- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/utility/Utility.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2009 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.enterprise.client.utility; - -import java.lang.annotation.Annotation; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.xml.namespace.QName; -import javax.xml.ws.WebServiceClient; - -public class Utility { - - /**Dynamically builds the WSDL URL to connect to a remote server. - * - * @param remote class correctly annotated with Webservice reference. - * @return valid URL - * @throws MalformedURLException - */ - public static URL generateRhqRemoteWebserviceURL(Class remote, String host, int port, boolean useHttps) - throws MalformedURLException { - - URL wsdlLocation = null; - //TODO: what to do about exceptions/messaging? throw illegalArgs? - //insert checks for host, port - if ((host == null) || (host.trim().length() == 0) || (port <= 0)) { - return wsdlLocation; - } - - //check for reference for right annotations - if ((remote != null) && remote.isAnnotationPresent(WebServiceClient.class)) { - String beanName = remote.getSimpleName(); - String protocol = "https://"; - if (!useHttps) { - protocol = "http://"; - } - wsdlLocation = new URL(protocol + host + ":" + port + "/rhq-rhq-enterprise-server-ejb3/" - + beanName.substring(0, beanName.length() - "Service".length()) + "?wsdl"); - } - return wsdlLocation; - - } - - public static QName generateRhqRemoteWebserviceQName(Class remote) { - - QName generated = null; - //check for reference with right annotation - if ((remote != null) && (remote.isAnnotationPresent(WebServiceClient.class))) { - String annotatedQnameValue = ""; - Annotation annot = remote.getAnnotation(WebServiceClient.class); - WebServiceClient annotated = (WebServiceClient) annot; - annotatedQnameValue = annotated.targetNamespace(); - String beanName = remote.getSimpleName(); - - generated = new QName(annotatedQnameValue, beanName); - } - return generated; - - } - -} diff --git a/modules/enterprise/remoting/cli/src/test/java/org/rhq/enterprise/client/ClientMainTest.java b/modules/enterprise/remoting/cli/src/test/java/org/rhq/enterprise/client/ClientMainTest.java deleted file mode 100644 index 98549fd..0000000 --- a/modules/enterprise/remoting/cli/src/test/java/org/rhq/enterprise/client/ClientMainTest.java +++ /dev/null @@ -1,786 +0,0 @@ -package org.rhq.enterprise.client; - -import org.testng.AssertJUnit; -import org.testng.annotations.Test; - -/** - * These tests can not be executed in our standard unit test fashion as they require a running RHQ - * Server with our web services deployed. - * - * This is still in development and has the current restrictions: - * - Server running on localhost. - * - ws-test user defined in database with full permissions - * - Non RHQ Server JBossAS in inventory. - * - The jbossws-native-home env variable must be set to a jbossws native stack install (e.g. jbossws-native-3.0.4.GA.zip) - * - The ws.test.package-path and ws.test.package-version environment variables must be defined to a test .war file. - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class ClientMainTest extends AssertJUnit { -/* - - static private final boolean TESTS_ENABLED = true; - - //test constants - private static String credentials = "ws-test"; - - //TODO: figure out if there is a way to use just JAXB. One less dependency. Also will be more picky - //private static XStream XS = new XStream(); - public static PageControl pagecontrol_unlimited = null; - private static boolean isWstestUserCreated = false; - private static String host = "127.0.0.1"; - private static int port = 7080; - private static RemoteClient remoteClientRef = null; - - @BeforeMethod - protected void beforeMethod() throws Exception { - if (pagecontrol_unlimited != null) { - pagecontrol_unlimited = new PageControl(); - pagecontrol_unlimited.setPageSize(-1); - } - if (remoteClientRef == null) { - remoteClientRef = new RemoteClient(host, port); - } - // //Checks for Ws-test user and creates it if it doesn't exist - // if(!isWstestUserCreated){ - // //assumes default rhqadmin details are in effect - //// SubjectManagerBeanService smService = new SubjectManagerBeanService(); - // URL sUrl = Utility.generateRhqRemoteWebserviceURL(SubjectManagerBeanService.class, - // host, port, false); - // QName sQName = Utility.generateRhqRemoteWebserviceQName(SubjectManagerBeanService.class); - // SubjectManagerBeanService smService = new SubjectManagerBeanService(sUrl,sQName); - // SubjectManagerRemote subjectManager = smService.getSubjectManagerBeanPort(); - // Subject user = subjectManager.login("rhqadmin", "rhqadmin"); - // Subject wsTestUser = subjectManager.findSubjectByName(user, credentials); - // if((wsTestUser!=null) &&(wsTestUser.getId()>0)){ - // isWstestUserCreated = true; - // } - // //Create ws-test user - // if(!isWstestUserCreated){ - // Subject newUser = new Subject(); - // // if(logXmlToScreen){displayXml(newUser);} - // - // String fName = "WS"; - // String lName = "Test"; - // newUser.setName(credentials); - // newUser.setFirstName(fName); - // newUser.setLastName(lName); - // newUser.setFactive(true); - // - // //Send command to create the new user - // subjectManager.createSubject(user, newUser); - // - // //Now locate role and attach - // //make connection to Role Bean - //// RoleManagerBeanService rmService = new RoleManagerBeanService(); - // URL rUrl = Utility.generateRhqRemoteWebserviceURL(RoleManagerBeanService.class, - // host, port, false); - // QName rQName = Utility.generateRhqRemoteWebserviceQName(RoleManagerBeanService.class); - // RoleManagerBeanService rmService = new RoleManagerBeanService(rUrl,rQName); - // RoleManagerRemote roleManager = rmService.getRoleManagerBeanPort(); - // List<Integer> emptyList = null; - // List<Role> roles = null; - // roles = roleManager.getAvailableRolesForSubject(user, Integer.valueOf(newUser.getId()), - // emptyList, pagecontrol_unlimited); - // - // //locate 'All Role Id' - // int roleId = 0; - // for (Role role : roles) { - // if ("all resources role".equalsIgnoreCase(role.getName())) { - // roleId = role.getId(); - // break; - // } - // } - // - // //assign that role to the subject - // List<Integer> roleBag = new ArrayList<Integer>(); - // roleBag.add(roleId); - // roleManager.assignRolesToSubject(user, newUser.getId(), roleBag); - // - // isWstestUserCreated = true; - // } - // } - - } - - @AfterMethod - protected void afterMethod() throws Exception { - } - - //Create and use SubjectManagerBean - @Test(enabled = TESTS_ENABLED) - public void testSubject() throws Exception { - - SubjectManagerRemote subjectManager = remoteClientRef.getSubjectManagerRemote(); - Subject user = subjectManager.login(credentials, credentials); - - //test ref - assertNotNull(user); - - //test isLoggedIn meth: Custom Method - assertTrue(subjectManager.isLoggedIn(credentials)); - - //test subject details: CREATE - assertEquals(credentials, user.getName()); - - //test session Id : CREATE - assertNotNull(user.getSessionId()); - - //test for invalid data in session id : CREATE - assertTrue(user.getSessionId() != 0); - - //SUBJECT TESTING - //check for user that shouldn't be there. Incomplete cleanups do occur and leave db debris - String testUserName = "ws-test-user"; - //Use Case # 7. : SEARCH - Subject newUser = subjectManager.findSubjectByName(user, testUserName); - - //if there, must have been from previous failed test... clean up. - if (null != newUser) { - Integer[] list = new Integer[newUser.getId()]; - subjectManager.deleteUsers(user, list); - } - - //test adding a new user with details. - newUser = new Subject(); - // if(logXmlToScreen){displayXml(newUser);} - - String fName = "first-name"; - String lName = "last-name"; - newUser.setName(testUserName); - newUser.setFirstName(fName); - newUser.setLastName(lName); - newUser.setFactive(true); - // displayXml(newUser); - - //Send command to create the new user - subjectManager.createSubject(user, newUser); - - //locate the previously created user and test values - newUser = subjectManager.findSubjectByName(user, testUserName); - // displayXml(newUser); - - assertNotNull(newUser); - assertTrue(testUserName.equals(newUser.getName())); - assertTrue(fName.equals(newUser.getFirstName())); - assertTrue(lName.equals(newUser.getLastName())); - - //PRINCIPAL TESTING - //create principal - String testUserPass = "ws-test-password"; - - //create principal - subjectManager.createPrincipal(user, testUserName, testUserPass); - //attempt login - newUser = subjectManager.login(testUserName, testUserPass); - - //verify login - assertTrue(subjectManager.isLoggedIn(testUserName)); - subjectManager.logout(newUser.getSessionId()); - //verify logout - assertFalse(subjectManager.isLoggedIn(testUserName)); - - //test password change methods - subjectManager.changePassword(user, testUserName, "updated-ws-test-password"); - newUser = subjectManager.login(testUserName, "updated-ws-test-password"); - - assertTrue(subjectManager.isLoggedIn(testUserName)); - subjectManager.logout(newUser.getSessionId()); - assertFalse(subjectManager.isLoggedIn(testUserName)); - - //locate subject - newUser = subjectManager.findSubjectByName(user, testUserName); - //more subject modification testing .. this time using update() - newUser.setFirstName("updated-first-name"); - newUser.setLastName("updated-last-name"); - subjectManager.updateSubject(user, newUser); - - //checking for successful update - newUser = subjectManager.findSubjectByName(user, testUserName); - - assertTrue("ws-test-user".equals(newUser.getName())); - assertTrue("updated-first-name".equals(newUser.getFirstName())); - assertTrue("updated-last-name".equals(newUser.getLastName())); - - //ROLE testing - //make connection to Role Bean - - RoleManagerRemote roleManager = remoteClientRef.getRoleManagerRemote(); - - //locate roles available for subject - //need to tell the bean how many roles to return for this enumeration - //TODO:?? is there a smarter way to do this for remote clients? Maybe rec #? Smart Default? - // Expose additional method to page through using int value? Like the last one. - // Hmmm.. I'm thinking two methods - // i)getAvailableValuesWindow and returns range and chunk sizes available - // ii)Get values[in bookmark range] and response could be empty with first not being status of req. - PageControl pageControl = new PageControl(); - pageControl.setPageSize(10); - Integer[] emptyList = null; - - //Find roles possible to add. Ex. lay users cannot elevate another account to SYS ADM - // Access controls for Use Case #7 - List<Role> roles = null; - roles = roleManager.getAvailableRolesForSubject(user, newUser.getId(), emptyList, pageControl); - // displayXml(roles); - - //locate 'All Role Id' - int roleId = 0; - for (Role role : roles) { - //displayXml(role); - if ("all resources role".equalsIgnoreCase(role.getName())) { - roleId = role.getId(); - break; - } - } - - //assign that role to the subject - Integer[] roleBag = new Integer[] { roleId }; - roleManager.assignRolesToSubject(user, Integer.valueOf(newUser.getId()), roleBag); - - //check that assignment occurred - List<Subject> attachedSubjects = roleManager.getRoleSubjects(user, roleId, pageControl); - boolean found = false; - for (Subject subject : attachedSubjects) { - if (subject.getId() == newUser.getId()) { - found = true; - } - } - assertTrue(found); - - //now cleanup the user and association we just created. - Integer[] cleanup = new Integer[] { newUser.getId() }; - subjectManager.deleteUsers(user, cleanup); - assertNull(subjectManager.findSubjectByName(user, "ws-test-user")); - - } - - @Test(enabled = TESTS_ENABLED) - public void testOperation() throws Exception { - - SubjectManagerRemote subjectManager = remoteClientRef.getSubjectManagerRemote(); - Subject user = subjectManager.login(credentials, credentials); - - ResourceManagerRemote resourceManager = remoteClientRef.getResourceManagerRemote(); - - PageControl pageControl = new PageControl(); - //displayXml(pageControl); - pageControl.setPageSize(10); - String s = null; - List<ResourceComposite> resources = resourceManager.findResourceComposites(user, ResourceCategory.PLATFORM, s, - 0, s, pageControl); - //displayXml(resources); - assertNotNull(resources); - assertTrue(resources.size() >= 1); - - //Should only be one platform - ResourceComposite testPlatform = resources.get(0); - //displayXml(testPlatform); - - OperationManagerRemote opManager = remoteClientRef.getOperationManagerRemote(); - - List<ResourceOperationHistory> history = opManager.getPendingResourceOperationHistories(user, testPlatform - .getResource().getId(), pageControl); - displayXml(history); - //check for previous dirty bits from last test and clean up - if (!history.isEmpty()) { - for (ResourceOperationHistory roh : history) { - opManager.deleteOperationHistory(user, roh.getId(), true); - } - - history = opManager.getPendingResourceOperationHistories(user, testPlatform.getResource().getId(), - pageControl); - assertTrue(history.isEmpty()); - } - - System.out.println("PlatformOpId:" + testPlatform.getResource().getId()); - pageControl.setPageNumber(10); - // remove any completed histories - history = opManager.getCompletedResourceOperationHistories(user, testPlatform.getResource().getId(), null, - null, pageControl); - displayXml(history); - if (!history.isEmpty()) { - for (ResourceOperationHistory roh : history) { - opManager.deleteOperationHistory(user, roh.getId(), true); - } - - history = opManager.getCompletedResourceOperationHistories(user, testPlatform.getResource().getId(), null, - null, pageControl); - assertTrue(history.isEmpty()); - } - - Configuration cf = new Configuration(); - ResourceOperationSchedule schedule = opManager.scheduleResourceOperation(user, testPlatform.getResource() - .getId(), "viewProcessList", 0L, 0L, 0, 0, cf, "ws unit test - platform process list"); - assertNotNull(schedule); - - // wait to finish, or try to cancel after a minute. - history = opManager.getPendingResourceOperationHistories(user, testPlatform.getResource().getId(), pageControl); - assertTrue(history.isEmpty() || history.size() == 1); - - long now = System.currentTimeMillis(); - do { - history = opManager.getPendingResourceOperationHistories(user, testPlatform.getResource().getId(), - pageControl); - } while (!history.isEmpty() && (System.currentTimeMillis() < (now + 60000L))); - if (!history.isEmpty()) { - opManager.cancelOperationHistory(user, history.get(0).getId(), true); - } - - history = opManager.getCompletedResourceOperationHistories(user, testPlatform.getResource().getId(), null, - null, pageControl); - assertEquals(1, history.size()); - - // remove scheduled operations - List<ResourceOperationSchedule> schedules = opManager.getScheduledResourceOperations(user, testPlatform - .getResource().getId()); - assertEquals(1, history.size()); - - if (!schedules.isEmpty()) { - for (ResourceOperationSchedule ros : schedules) { - //?? opManager.unscheduleResourceOperation(user, ros.getJobId(), testPlatform - opManager.unscheduleResourceOperation(user, ros.getJobName(), testPlatform.getResource().getId()); - } - - schedules = opManager.getScheduledResourceOperations(user, testPlatform.getResource().getId()); - assertTrue(schedules.isEmpty()); - } - - // schedule an operation for delayed process list fetch (we won't let it complete) - schedule = opManager.scheduleResourceOperation(user, testPlatform.getResource().getId(), "viewProcessList", - 300000L, 0L, 0, 0, null, "unit test - shutdown operation"); - - schedules = opManager.getScheduledResourceOperations(user, testPlatform.getResource().getId()); - assertEquals(1, schedules.size()); - //?? assertEquals(schedule.getJobId(), schedules.get(0).getJobId()); - assertEquals(schedule.getJobName(), schedules.get(0).getJobName()); - - // opManager.unscheduleResourceOperation(user, schedules.get(0).getJobId().toString(), testPlatform - opManager.unscheduleResourceOperation(user, schedules.get(0).getJobName().toString(), testPlatform - .getResource().getId()); - schedules = opManager.getScheduledResourceOperations(user, testPlatform.getResource().getId()); - assertTrue(schedules.isEmpty()); - } - - @Test(enabled = TESTS_ENABLED) - public void testJBossAS() throws Exception { - - //instantiate SLSB - SubjectManagerRemote subjectManager = remoteClientRef.getSubjectManagerRemote(); - Subject user = subjectManager.login("ws-test", "ws-test"); - - //RemoteManagerBean - ResourceManagerRemote resourceManager = remoteClientRef.getResourceManagerRemote(); - - ResourceType rt = new ResourceType(); - ResourceSubCategory subCat = new ResourceSubCategory(); - subCat.setDescription("JBoss Application Server"); - rt.setSubCategory(subCat); - - // PageList<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "JBossAS Server", 0, - List<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "JBossAS Server", 0, - null, pagecontrol_unlimited); - // null, PageControl.getUnlimitedInstance()); - - assertNotNull(resources); - assertTrue(resources.size() >= 1); - - ResourceComposite testAS = null; - for (ResourceComposite resource : resources) { - if (!resource.getResource().getName().contains("RHQ Server")) { - testAS = resource; - break; - } - } - - assertNotNull("Test requires a Non-RHQ AS Server, please start and import a JBoss AS", testAS); - - OperationManagerRemote operationManager = remoteClientRef.getOperationManagerRemote(); - - // Remove any pending histories - List<ResourceOperationHistory> history = operationManager.getPendingResourceOperationHistories(user, testAS - .getResource().getId(), pagecontrol_unlimited); - - if (!history.isEmpty()) { - for (ResourceOperationHistory roh : history) { - operationManager.deleteOperationHistory(user, roh.getId(), true); - } - - history = operationManager.getPendingResourceOperationHistories(user, testAS.getResource().getId(), - // PageControl.getUnlimitedInstance()); - pagecontrol_unlimited); - assertTrue(history.isEmpty()); - } - - // remove any completed histories - history = operationManager.getCompletedResourceOperationHistories(user, testAS.getResource().getId(), null, - null, pagecontrol_unlimited); - // null, PageControl.getUnlimitedInstance()); - - if (!history.isEmpty()) { - for (ResourceOperationHistory roh : history) { - operationManager.deleteOperationHistory(user, roh.getId(), true); - } - - history = operationManager.getCompletedResourceOperationHistories(user, testAS.getResource().getId(), null, - // null, PageControl.getUnlimitedInstance()); - null, pagecontrol_unlimited); - assertTrue(history.isEmpty()); - } - - // schedule an operation for immediate shutdown of AS instance - ResourceOperationSchedule schedule = operationManager.scheduleResourceOperation(user, testAS.getResource() - .getId(), "shutdown", 0L, 0L, 0, 0, null, "unit test - shutdown operation"); - - // wait to finish, or try to cancel after a minute. - history = operationManager.getPendingResourceOperationHistories(user, testAS.getResource().getId(), - pagecontrol_unlimited); - // PageControl.getUnlimitedInstance()); - assertTrue(history.isEmpty() || history.size() == 1); - - long now = System.currentTimeMillis(); - do { - history = operationManager.getPendingResourceOperationHistories(user, testAS.getResource().getId(), - pagecontrol_unlimited); - // PageControl.getUnlimitedInstance()); - } while (!history.isEmpty() && (System.currentTimeMillis() < (now + 60000L))); - if (!history.isEmpty()) { - operationManager.cancelOperationHistory(user, history.get(0).getId(), true); - } - - history = operationManager.getCompletedResourceOperationHistories(user, testAS.getResource().getId(), null, - null, pagecontrol_unlimited); - // null, PageControl.getUnlimitedInstance()); - assertEquals(1, history.size()); - - // remove scheduled operations - List<ResourceOperationSchedule> schedules = operationManager.getScheduledResourceOperations(user, testAS - .getResource().getId()); - assertEquals(1, history.size()); - - if (!schedules.isEmpty()) { - for (ResourceOperationSchedule ros : schedules) { - // operationManager.unscheduleResourceOperation(user, ros.getJobId().toString(), testAS.getResource() - operationManager.unscheduleResourceOperation(user, ros.getJobName(), testAS.getResource().getId()); - } - - schedules = operationManager.getScheduledResourceOperations(user, testAS.getResource().getId()); - assertTrue(schedules.isEmpty()); - } - - // schedule an operation for delayed shutdown of AS instance (we won't let it complete) - schedule = operationManager.scheduleResourceOperation(user, testAS.getResource().getId(), "shutdown", 300000L, - 0L, 0, 0, null, "unit test - shutdown operation"); - - schedules = operationManager.getScheduledResourceOperations(user, testAS.getResource().getId()); - assertEquals(1, schedules.size()); - // assertEquals(schedule.getJobId(), schedules.get(0).getJobId()); - assertEquals(schedule.getJobName(), schedules.get(0).getJobName()); - - // operationManager.unscheduleResourceOperation(user, schedules.get(0).getJobId().toString(), testAS.getResource() - operationManager.unscheduleResourceOperation(user, schedules.get(0).getJobName(), testAS.getResource().getId()); - schedules = operationManager.getScheduledResourceOperations(user, testAS.getResource().getId()); - assertTrue(schedules.isEmpty()); - } - - @Test(enabled = TESTS_ENABLED) - public void testUpdateResourceConfiguration() throws Exception { - - SubjectManagerRemote subjectManager = remoteClientRef.getSubjectManagerRemote(); - - Subject user = subjectManager.login("ws-test", "ws-test"); - - ResourceManagerRemote resourceManager = remoteClientRef.getResourceManagerRemote(); - - List<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "RHQ Agent", 0, null, - pagecontrol_unlimited); - - assertNotNull(resources); - assertTrue(resources.size() >= 1); - - ResourceComposite testAgent = null; - for (ResourceComposite resource : resources) { - if (resource.getAvailability().equals(AvailabilityType.UP)) { - testAgent = resource; - break; - } - } - - assertNotNull("Test requires an available RHQ Agent, please start an RHQ Agent", testAgent); - - //instantiate SLSB - ConfigurationManagerRemote configManager = remoteClientRef.getConfigurationManagerRemote(); - - Configuration config = configManager.getCurrentResourceConfiguration(user, testAgent.getResource().getId()); - assertNotNull(config); - //TODO: the following is NOT yet converted. Not immediately apparent what needs to be changed. - // assertEquals("plugins", config.getSimpleProperties().get("rhq.agent.plugins.directory").getStringValue()); - // assertEquals("plugins", config.getSimpleProperties().get("rhq.agent.plugins.directory").getStringValue()); - // - // config.getSimpleProperties().get("rhq.agent.plugins.directory").setStringValue("plugins/../plugins"); - // configManager.updateResourceConfiguration(user, testAgent.getResource().getId(), config); - // - // long now = System.currentTimeMillis(); - // do { - // } while (configManager.isResourceConfigurationUpdateInProgress(user, testAgent.getResource().getId()) - // && (System.currentTimeMillis() < (now + 60000L))); - // if (configManager.isResourceConfigurationUpdateInProgress(user, testAgent.getResource().getId())) { - // fail("Config Update not completed, may need to fix property manually"); - // } - // - // config = configManager.getCurrentResourceConfiguration(user, testAgent.getResource().getId()); - // assertNotNull(config); - // assertEquals("plugins/../plugins", config.getSimpleProperties().get("rhq.agent.plugins.directory") - // .getStringValue()); - // - // config.getSimpleProperties().get("rhq.agent.plugins.directory").setStringValue("plugins"); - // configManager.updateResourceConfiguration(user, testAgent.getResource().getId(), config); - } - - @Test(enabled = TESTS_ENABLED) - public void testUpdatePluginConfiguration() throws Exception { - - //instantiate SLSB - SubjectManagerRemote subjectManager = remoteClientRef.getSubjectManagerRemote(); - Subject user = subjectManager.login("ws-test", "ws-test"); - - //instantiate SLSB - ResourceManagerRemote rmManager = remoteClientRef.getResourceManagerRemote(); - - List<ResourceComposite> resources = rmManager.findResourceComposites(user, null, "JBossAS Server", 0, null, - pagecontrol_unlimited); - - assertNotNull(resources); - assertTrue(resources.size() >= 1); - - ResourceComposite testAS = null; - for (ResourceComposite resource : resources) { - if (resource.getResource().getName().contains("RHQ Server")) { - testAS = resource; - break; - } - } - - assertNotNull("Could not find RHQ Server, that's not good...", testAS); - - ConfigurationManagerRemote configManager = remoteClientRef.getConfigurationManagerRemote(); - - Configuration config = configManager.getCurrentPluginConfiguration(user, testAS.getResource().getId()); - assertNotNull(config); - //TODO: Fix below references. not immediately apparent what needs to be changed to. - // assertTrue(config.getSimpleProperties().get("startScript").getStringValue().endsWith("run.bat")); - // - // String newString = config.getSimpleProperties().get("startScript").getStringValue().replace("run.bat", - // "batter.run"); - // config.getSimpleProperties().get("startScript").setStringValue(newString); - // configManager.updatePluginConfiguration(user, testAS.getResource().getId(), config); - // - // config = configManager.getCurrentPluginConfiguration(user, testAS.getResource().getId()); - // assertNotNull(config); - // assertTrue(config.getSimpleProperties().get("startScript").getStringValue().endsWith("batter.run")); - // - // newString = config.getSimpleProperties().get("startScript").getStringValue().replace("batter.run", "run.bat"); - // config.getSimpleProperties().get("startScript").setStringValue(newString); - // configManager.updatePluginConfiguration(user, testAS.getResource().getId(), config); - } - - // public void testDeployment() throws Exception, ResourceTypeNotFoundException { - @Test(enabled = TESTS_ENABLED) - public void testDeployment() throws Exception { - - reportHeap("start"); - - SubjectManagerRemote subjectManager = remoteClientRef.getSubjectManagerRemote(); - - reportHeap("subjectManager"); - - Subject user = subjectManager.login("ws-test", "ws-test"); - - reportHeap("login"); - - ResourceManagerRemote resourceManager = remoteClientRef.getResourceManagerRemote(); - - reportHeap("resourceManager"); - - List<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "Web Application (WAR)", - 0, null, pagecontrol_unlimited); - - assertNotNull(resources); - assertTrue(resources.size() >= 1); - - ResourceComposite testWar = null; - for (ResourceComposite resource : resources) { - // if (!resource.getResource().getName().contains("RHQ Server")) { - if (resource.getResource().getName().contains("servlets-examples1.war")) { - testWar = resource; - break; - } - } - - assertNotNull("Test requires a Non-RHQ AS Server, please start and import a JBoss AS", testWar); - - RepoManagerRemote repoManager = remoteClientRef.getRepoManagerRemote(); - - reportHeap("repoManager"); - - List<Repo> repos = repoManager.getAllRepos(user, pagecontrol_unlimited); - - for (Repo repo : repos) { - if ("ws-test-repo".equals(repo.getName())) { - repoManager.deleteRepo(user, repo.getId()); - } - } - - Repo ch = new Repo(); - ch.setName("ws-test-repo"); - Repo testRepo = repoManager.createRepo(user, ch); - assertNotNull(testRepo); - assertEquals("ws-test-repo", testRepo.getName()); - - repos = repoManager.getAllRepos(user, pagecontrol_unlimited); - - testRepo = null; - for (Repo repo : repos) { - if ("ws-test-repo".equals(repo.getName())) { - testRepo = repo; - break; - } - } - assertNotNull(testRepo); - - int[] bag = new int[] { testRepo.getId() }; - repoManager.subscribeResourceToRepos(user, testWar.getResource().getId(), bag); - - List<Resource> repoResources = repoManager.getSubscribedResources(user, testRepo.getId(), - pagecontrol_unlimited); - - assertNotNull(repoResources); - assertEquals(1, repoResources.size()); - assertTrue(repoResources.get(0).equals(testWar.getResource())); - - ContentManagerRemote contentManager = remoteClientRef.getContentManagerRemote(); - - reportHeap("contentManager"); - - List<PackageType> packageTypes = contentManager.getPackageTypes(user, "Web Application (WAR)", "JBossAS"); - assertNotNull(packageTypes); - assertEquals(1, packageTypes.size()); - PackageType testPackageType = null; - for (PackageType pt : packageTypes) { - if ("file".equals(pt.getName())) { - testPackageType = pt; - break; - } - } - assertNotNull(testPackageType); - - List<Architecture> architectures = contentManager.getArchitectures(user); - assertNotNull(architectures); - Architecture testArch = null; - for (Architecture arch : architectures) { - if ("noarch".equalsIgnoreCase(arch.getName())) { - testArch = arch; - break; - } - } - assertNotNull(testArch); - - String packagePath = System.getProperty("ws.test.package-path"); - assertNotNull(packagePath); - packagePath = packagePath.trim(); - assertTrue(!"".equals(packagePath)); - File file = new File(packagePath); - assertTrue(file.exists()); - String packageVersion = System.getProperty("ws.test.package-version"); - assertNotNull(packageVersion); - packageVersion = packageVersion.trim(); - assertTrue(!"".equals(packageVersion)); - - PackageVersion testPackageVersion = contentManager.createPackageVersion(user, "servlets-examples1.war", - testPackageType.getId(), packageVersion, testArch.getId(), getBytesFromFile(file)); - assertNotNull(testPackageVersion); - assertTrue(testPackageVersion.getId() > 0); - - int[] bag2 = new int[] { testPackageVersion.getId() }; - repoManager.addPackageVersionsToRepo(user, testRepo.getId(), bag2); - - Set<Integer> resourceSet = new HashSet<Integer>(1); - Set<Integer> packageVersionSet = new HashSet<Integer>(1); - - resourceSet.add(testWar.getResource().getId()); - packageVersionSet.add(testPackageVersion.getId()); - - contentManager.deployPackages(user, resourceSet, packageVersionSet); - - int[] chBag = new int[] { testRepo.getId() }; - repoManager.unsubscribeResourceFromRepos(user, testWar.getResource().getId(), chBag); - - repoResources = repoManager.getSubscribedResources(user, testRepo.getId(), pagecontrol_unlimited); - - assertNotNull(repoResources); - assertEquals(0, repoResources.size()); - - // this will force a purge of testPackageVersion - repoManager.deleteRepo(user, testRepo.getId()); - } - - private void reportHeap(String description) { - Runtime runtime = Runtime.getRuntime(); - long mbConst = 1024 * 1024L; - - System.out.println(description); - - // Get current size of heap in bytes - System.out.print(" totalMb=" + ((runtime.totalMemory() / mbConst))); - - // Get maximum size of heap in bytes. The heap cannot grow beyond this size. - // Any attempt will result in an OutOfMemoryException. - System.out.print(", maxMb=" + ((runtime.maxMemory() / mbConst))); - - // Get amount of free memory within the heap in bytes. This size will increase - // after garbage collection and decrease as new objects are created. - System.out.println(", freeMb=" + ((runtime.freeMemory() / mbConst))); - } - - public static byte[] getBytesFromFile(File file) throws IOException { - InputStream is = new FileInputStream(file); - - // Get the size of the file - long length = file.length(); - - if (length > Integer.MAX_VALUE) { - // File is too large - } - - // Create the byte array to hold the data - byte[] bytes = new byte[(int) length]; - - // Read in the bytes - int offset = 0; - int numRead = 0; - while (offset < bytes.length && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) { - offset += numRead; - } - - // Ensure all the bytes have been read in - if (offset < bytes.length) { - throw new IOException("Could not completely read file " + file.getName()); - } - - // Close the input stream and return bytes - is.close(); - return bytes; - } - - private void displayXml(Object... elements) { - for (Object element : elements) { - //String xml = XS.toXML(element); - String xml = element.toString(); - - System.out.println("------- NOT JAXB XML: (XStream) ----:" + Object.class.getCanonicalName()); - System.out.println(xml + "\n\n"); - } - } -*/ -} diff --git a/modules/enterprise/remoting/client-api/pom.xml b/modules/enterprise/remoting/client-api/pom.xml index 530add9..a87907e 100644 --- a/modules/enterprise/remoting/client-api/pom.xml +++ b/modules/enterprise/remoting/client-api/pom.xml @@ -109,13 +109,6 @@ <artifactId>hibernate-annotations</artifactId> </dependency>
- <dependency> - <groupId>jboss.jbossws</groupId> - <artifactId>jboss-jaxws</artifactId> - <version>3.0.1-native-2.0.4.GA</version> - <scope>provided</scope> <!-- by JBossAS --> - </dependency> - </dependencies>
<profiles> diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml index 8da6180..5a8aeb7 100644 --- a/modules/enterprise/remoting/pom.xml +++ b/modules/enterprise/remoting/pom.xml @@ -34,21 +34,6 @@ </modules> </profile>
- <profile> - <id>enterprise</id> - - <activation> - <property> - <name>enterprise</name> - </property> - </activation> - - <modules> - <module>webservices</module> - </modules> - </profile> - - </profiles>
</project> diff --git a/modules/enterprise/remoting/webservices/pom.xml b/modules/enterprise/remoting/webservices/pom.xml deleted file mode 100644 index fe1c3e7..0000000 --- a/modules/enterprise/remoting/webservices/pom.xml +++ /dev/null @@ -1,256 +0,0 @@ -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - - <parent> - <groupId>org.rhq</groupId> - <artifactId>rhq-parent</artifactId> - <version>4.5.0-SNAPSHOT</version> - <relativePath>../../../../pom.xml</relativePath> - </parent> - - <artifactId>rhq-remoting-webservices</artifactId> - <name>RHQ Remoting Web Services Client</name> - - <properties> - <persistence-api.version>1.0</persistence-api.version> - </properties> - - <dependencies> - - <dependency> - <groupId>org.jboss.jbossas</groupId> - <artifactId>jboss-as-dist</artifactId> - <type>zip</type> - </dependency> - - <dependency> - <groupId>org.jboss.jbossws</groupId> - <artifactId>jbossws-native-dist</artifactId> - <type>zip</type> - </dependency> - - <dependency> - <groupId>org.rhq</groupId> - <artifactId>rhq-enterprise-server</artifactId> - <version>${project.version}</version> - <type>ejb</type> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>org.rhq</groupId> - <artifactId>rhq-core-domain</artifactId> - <version>${project.version}</version> - <type>ejb</type> - <scope>compile</scope> - </dependency> - - <dependency> - <groupId>javax.persistence</groupId> - <artifactId>persistence-api</artifactId> - <version>1.0</version> - <scope>compile</scope> - </dependency> - - <!-- TODO This can probably go away after we stop using EJB Exception classes in the remote API --> - <dependency> - <groupId>jboss</groupId> - <artifactId>jboss-j2ee</artifactId> - <scope>provided</scope> - </dependency> - - <dependency> - <groupId>org.testng</groupId> - <artifactId>testng</artifactId> - <version>${testng.version}</version> - </dependency> - - </dependencies> - - <build> - <outputDirectory>target/${project.build.finalName}</outputDirectory> - - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.6</source> - <target>1.6</target> - </configuration> - <executions> - <execution> - <id>default-testCompile</id> - <phase>test-compile</phase> - <configuration> - <testExcludes> - <exclude>**/Ws*.java</exclude> - <exclude>**/ws/JaxbUtilities.java</exclude> - </testExcludes> - </configuration> - <goals> - <goal>testCompile</goal> - </goals> - </execution> - </executions> - </plugin> - - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - - <execution> - <id>client-distribution</id> - <phase>compile</phase> - <configuration> - <target> - <echo>ant.version=${ant.version}</echo> - - <ant antfile="${basedir}/src/main/scripts/rhq-client.build.xml" dir="${basedir}" target="prepare-dist" inheritAll="false" inheritRefs="false"> - <property name="buildNumber" value="${buildNumber}" /> - <property name="java.jre.home" value="${java.home}" /> - <property name="maven.compile.classpath" refid="maven.compile.classpath" /> - <property name="maven.runtime.classpath" refid="maven.runtime.classpath" /> - <property name="project.build.outputDirectory" value="${project.build.outputDirectory}" /> - <property name="project.name" value="${project.name}" /> - <property name="project.groupId" value="${project.groupId}" /> - <property name="project.version" value="${project.version}" /> - <property name="settings.localRepository" value="${settings.localRepository}" /> - <property name="persistence-api.version" value="${persistence-api.version}" /> - <property name="jboss.version" value="${jboss.version}" /> - <property name="jbossws-native-dist.version" value="${jbossws-native-dist.version}" /> - <property name="rhq.client.build.exclude.cli.jar" value="${rhq.client.build.exclude.cli.jar}" /> - <property name="rhq.client.build.include.client.jar" value="${rhq.client.build.include.client.jar}" /> - <property name="quartz.version" value="${quartz.version}" /> - <property name="ant.contrib.version" value="${ant.contrib.version}" /> - <property name="webservice.version" value="${project.version}" /> - </ant> - </target> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - - </executions> - </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <configuration> - <classesDirectory>${project.build.directory}/rhq-remoting-webservices-${project.version} - </classesDirectory> - - <includes> - <include>org/rhq/**</include> - </includes> - <archive> - <index>true</index> - <manifestEntries> - <Implementation-Title>${rhq.product.name} - ${project.name}</Implementation-Title> - <Implementation-Version>${project.version}</Implementation-Version> - <Specification-Vendor>org.jboss</Specification-Vendor> - <Specification-Title>JBossWS</Specification-Title> - <Specification-Version>${jbossws-native-dist.version}</Specification-Version> - <Build-Number>${buildNumber}</Build-Number> - </manifestEntries> - </archive> - </configuration> - </plugin> - - <!-- - run the standard tests by default (if any) but exclude ws tests requiring a running server. - --> - <!--Commenting out as test suite(like cli tests) depend upon running server data. --> - <plugin> - <artifactId>maven-surefire-plugin</artifactId> - <!-- Everything but the web service tests, this is the standard test execution --> - <configuration> - <skip>true</skip> - <excludes> - <exclude>com/**/*.java</exclude> - </excludes> - <excludedGroups>${rhq.testng.excludedGroups},ws</excludedGroups> - <systemProperties> - <property> - <name>deploymentDirectory</name> - <value>target/classes</value> - </property> - </systemProperties> - </configuration> - </plugin> - - </plugins> - </build> - - <profiles> - <!-- <profile> - <id>test-ws</id> - <activation> - <property> - <name>test-ws</name> - </property> - </activation> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <executions> - <execution> - <id>web-service-tests</id> - <phase>test</phase> - <configuration> - <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups> - <groups>ws</groups> - <forkMode>pertest</forkMode> - <argLine>-Xmx512m -Xms128m</argLine> - <systemProperties> - <property> - <name>deploymentDirectory</name> - <value>target/classes</value> - </property> - </systemProperties> - <additionalClasspathElements> - <additionalClasspathElement> - ${project.build.directory}/rhq-remoting-webservices-${project.version}.jar - </additionalClasspathElement> - </additionalClasspathElements> - </configuration> - <goals> - <goal>test</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> --> - - <!-- Add dependencies need for jdk5 builds. Remove when we stop supporting jdk5 --> - <profile> - <id>java-5-dependencies</id> - <activation> - <jdk>1.5</jdk> - <property> - <name>java5.home</name> - </property> - </activation> - - <dependencies> - <dependency> - <groupId>jboss.jbossws</groupId> - <artifactId>jboss-jaxws</artifactId> - <!-- NOTE: This version is old but is good enough to resolve the build dependency. --> - <version>3.0.1-native-2.0.4.GA</version> - <scope>provided</scope> - </dependency> - </dependencies> - </profile> - - </profiles> - -</project> diff --git a/modules/enterprise/remoting/webservices/src/main/java/org/rhq/enterprise/server/ws/utility/WsUtility.java b/modules/enterprise/remoting/webservices/src/main/java/org/rhq/enterprise/server/ws/utility/WsUtility.java deleted file mode 100644 index 1f9dcd2..0000000 --- a/modules/enterprise/remoting/webservices/src/main/java/org/rhq/enterprise/server/ws/utility/WsUtility.java +++ /dev/null @@ -1,59 +0,0 @@ -package org.rhq.enterprise.server.ws.utility; - -import java.lang.annotation.Annotation; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.xml.namespace.QName; -import javax.xml.ws.WebServiceClient; - -public class WsUtility { - - /**Dynamically builds the WSDL URL to connect to a remote server. - * - * @param remote class correctly annotated with Webservice reference. - * @return valid URL - * @throws MalformedURLException - */ - public static URL generateRemoteWebserviceURL(Class remote, String host, int port, boolean useHttps) - throws MalformedURLException { - - URL wsdlLocation = null; - //TODO: what to do about exceptions/messaging? throw illegalArgs? - //insert checks for host, port - if ((host == null) || (host.trim().length() == 0) || (port <= 0)) { - return wsdlLocation; - } - - //check for reference for right annotations - if ((remote != null) && remote.isAnnotationPresent(WebServiceClient.class)) { - String beanName = remote.getSimpleName(); - String protocol = "https://"; - if (!useHttps) { - protocol = "http://"; - } - wsdlLocation = new URL(protocol + host + ":" + port + "/rhq-rhq-enterprise-server-ejb3/" - + beanName.substring(0, beanName.length() - "Service".length()) + "?wsdl"); - } - return wsdlLocation; - - } - - public static QName generateRemoteWebserviceQName(Class remote) { - - QName generated = null; - //check for reference with right annotation - if ((remote != null) && (remote.isAnnotationPresent(WebServiceClient.class))) { - String annotatedQnameValue = ""; - Annotation annot = remote.getAnnotation(WebServiceClient.class); - WebServiceClient annotated = (WebServiceClient) annot; - annotatedQnameValue = annotated.targetNamespace(); - String beanName = remote.getSimpleName(); - - generated = new QName(annotatedQnameValue, beanName); - } - return generated; - - } - -} diff --git a/modules/enterprise/remoting/webservices/src/main/scripts/rhq-client.build.xml b/modules/enterprise/remoting/webservices/src/main/scripts/rhq-client.build.xml deleted file mode 100644 index c963e27..0000000 --- a/modules/enterprise/remoting/webservices/src/main/scripts/rhq-client.build.xml +++ /dev/null @@ -1,224 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project name="rhq-client" basedir="."> - - <property name="jboss.home" location="${basedir}/target/jboss-${jboss.version}" /> - <property name="jbossws.home" location="${basedir}/target/jbossws-native-bin-dist" /> - <property name="wsdl.home" location="${project.build.outputDirectory}/wsdl" /> - <property name="wsconsume.home" location="${project.build.outputDirectory}/wsconsume-output" /> - <property name="wsprovide.home" location="${project.build.outputDirectory}/wsprovide-output" /> - <property name="include.client.jar" value="true" /> - - <!-- load all the Stateless Session Bean for WS exposure as properties. Must add bean as separate - property AND in the "ws-list" below for successful inclusion. ##TODO SP: collapse these to one list. --> - <property name="PropertyBagManager" value="org.rhq.enterprise.server.jaxb.PropertyBagManagerBean" /> - <property name="AdvisoryManager" value="org.rhq.enterprise.server.content.AdvisoryManagerBean"/> - <property name="AlertManager" value="org.rhq.enterprise.server.alert.AlertManagerBean" /> - <property name="AlertDefinitionManager" value="org.rhq.enterprise.server.alert.AlertDefinitionManagerBean" /> - <property name="AvailabilityManager" value="org.rhq.enterprise.server.measurement.AvailabilityManagerBean" /> - <property name="BundleManager" value="org.rhq.enterprise.server.bunde.BundleManagerBean" /> - <property name="CallTimeDataManager" value="org.rhq.enterprise.server.measurement.CallTimeDataManagerBean" /> - <property name="ConfigurationManager" value="org.rhq.enterprise.server.configuration.ConfigurationManagerBean" /> - <property name="ContentManager" value="org.rhq.enterprise.server.content.ContentManagerBean" /> - <property name="DataAccessManager" value="org.rhq.enterprise.server.report.DataAccessManagerBean" /> - <property name="DistributionManager" value="org.rhq.enterprise.server.content.DistributionManagerBean"/> - <property name="EventManager" value="org.rhq.enterprise.server.event.EventManagerBean" /> - <property name="MeasurementDefinitionManager" value="org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerBean" /> - <property name="MeasurementBaselineManager" value="org.rhq.enterprise.server.measurement.MeasurementBaselineManagerBean" /> - <property name="MeasurementDataManager" value="org.rhq.enterprise.server.measurement.MeasurementDataManagerBean" /> - <property name="MeasurementProblemManager" value="org.rhq.enterprise.server.measurement.MeasurementProblemManagerBean" /> - <property name="MeasurementScheduleManager" value="org.rhq.enterprise.server.measurement.MeasurementScheduleManagerBean" /> - <property name="OperationManager" value="org.rhq.enterprise.server.operation.OperationManagerBean" /> - <property name="RepoManager" value="org.rhq.enterprise.server.content.RepoManagerBean" /> - <property name="ResourceGroupManager" value="org.rhq.enterprise.server.resource.group.ResourceGroupManagerBean" /> - <property name="ResourceManager" value="org.rhq.enterprise.server.resource.ResourceManagerBean" /> - <property name="RoleManager" value="org.rhq.enterprise.server.authz.RoleManagerBean" /> - <property name="SubjectManager" value="org.rhq.enterprise.server.auth.SubjectManagerBean" /> - <property name="SupportManager" value="org.rhq.enterprise.server.support.SupportManagerBean" /> - <property name="SystemManager" value="org.rhq.enterprise.server.system.SystemManagerBean" /> - <property name="WebservicesManager" value="org.rhq.enterprise.server.webservices.WebservicesManagerBean" /> - - <!-- List of all the simple bean names(Alert for AlertManagerBean, etc.) in alphabetical order. List used by wsprovide/wsconsume --> - <!-- <property name="ws-list" value="Subject,Role" /> --> - <property name="ws-list" value="Webservices" /> - <!-- <property name="ws-list" value="Alert,AlertDefinition,Availability,CallTimeData,Repo,Configuration,Content,DataAccess,Event,MeasurementBaseline,MeasurementData,MeasurementDefinition,MeasurementProblem,MeasurementSchedule,Operation,Resource,ResourceGroup,Role,Subject,Support,System" /> --> - - <target name="prepare-dist"> - <condition property="exclude.cli.jar" value="true"> - <equals arg1="${rhq.client.build.exclude.cli.jar}" arg2="true" /> - </condition> - <condition property="include.client.jar" value="true"> - <equals arg1="${rhq.client.build.include.client.jar}" arg2="true" /> - </condition> - - <antcall target="prepare-jbossws" /> - <antcall target="prepare-wsdl" /> - </target> - - - <!-- To generate the client service classes we need portions of an AS distribution that provide - jbossws. We can't use the enterprise container build zip as it is built last (it needs to contain - the results of thie build). So, we'll have to download and update a vanilla AS with WS --> - <target name="prepare-jbossws"> - <property name="jboss.zip" location="${settings.localRepository}/org/jboss/jbossas/jboss-as-dist/${jboss.version}/jboss-as-dist-${jboss.version}.zip" /> - <condition property="jboss.uptodate"> - <and> - <uptodate srcfile="${jboss.zip}" targetfile="${jboss.home}" /> - <available file="${jboss.home}/bin/wsprovide.bat" type="file" /> - </and> - </condition> - <antcall target="unzip-jboss" /> - </target> - - <target name="unzip-jboss" unless="jboss.uptodate"> - <!-- No need to unzip everything, just what we need for jbossws (and the jbossws upgrade script) --> - <unzip src="${settings.localRepository}/org/jboss/jbossas/jboss-as-dist/${jboss.version}/jboss-as-dist-${jboss.version}.zip" dest="${basedir}/target"> - <patternset> - <include name="jboss-${jboss.version}/bin/ws*.*" /> - <include name="jboss-${jboss.version}/lib/*.jar" /> - <include name="jboss-${jboss.version}/lib/endorsed/*.jar" /> - <include name="jboss-${jboss.version}/client/*.jar" /> - <include name="jboss-${jboss.version}/server/default" /> - </patternset> - </unzip> - - <!-- Run JBossWS 3.1.1 upgrade script on the JBossAS: - i) pull upgrade bundle - ii) unzip - iii) run it on JBossAS instance (4.2.3) to 3.1.1. - These upgrade steps should be revisited when moving JBossAS version beyond 4.2.3 --> - - <echo>...Upgrading JBossWS version from bundled version...</echo> - - <!-- Unzip JBossWS dist zipfile... if necessary --> - <unzip src="${settings.localRepository}/org/jboss/jbossws/jbossws-native-dist/${jbossws-native-dist.version}/jbossws-native-dist-${jbossws-native-dist.version}.zip" dest="${basedir}/target" /> - - <!-- Modify the properties file for upgrade --> - <copy file="${jbossws.home}/ant.properties.example" tofile="${jbossws.home}/ant.properties" filtering="true"> - <!-- modify properties appropriately --> - <filterset> - <filter token="jboss423.home" value="${jboss.home}" /> - </filterset> - </copy> - <replace file="${jbossws.home}/ant.properties" token="jbossws.integration.target=jboss500" value="jbossws.integration.target=jboss423" /> - - <!-- This line added to convert the \ in Window's paths to /. Should have no effect on non-Windows --> - <replace file="${jbossws.home}/ant.properties" token="\" value="/" /> - - <!-- Call the upgrade script --> - <ant antfile="${jbossws.home}/build.xml" target="deploy-jboss423" dir="${jbossws.home}" /> - </target> - - <target name="prepare-wsdl" if="include.client.jar" depends="prepare-jbossws"> - <echo>*** Creating new wsdl</echo> - <mkdir dir="${wsconsume.home}" /> - <mkdir dir="${wsprovide.home}" /> - - <echo>The JAVA HOME being used: ${java.jre.home}</echo> - <echo /> - - <!-- Classpath for WSConsume/WSProvide. Defined globally so that custom task defs can reference. --> - <!-- So,it's JBossws version specific (and assumes compatibility between JBossws and AS --> - <mkdir dir="${java.jre.home}/lib" /> - <mkdir dir="${java.jre.home}/../lib" /> - <path id="jbossws.native.classpath"> - <fileset dir="${java.jre.home}/lib/" includes="*.jar" /> - <fileset dir="${java.jre.home}/../lib/" includes="*.jar" /> - - <!-- AS dependencies --> - <fileset dir="${jboss.home}/lib/endorsed/" includes="*.jar" /> - <fileset dir="${jboss.home}/lib/" includes="*.jar" /> - - <!-- JBossws/AS client dependencies --> - <fileset dir="${jboss.home}/client"> - <include name="jbossws-spi.jar" /> - <include name="jbossws-common.jar" /> - <include name="jbossws-framework.jar" /> - - <include name="activation.jar" /> - <include name="getopt.jar" /> - <include name="jbossall-client.jar" /> - <include name="log4j.jar" /> - <include name="mail.jar" /> - - <include name="jaxb-api.jar" /> - <include name="jaxb-impl.jar" /> - <include name="jaxb-xjc.jar" /> - <include name="jaxws-tools.jar" /> - <include name="jaxws-rt.jar" /> - <include name="streambuffer.jar" /> - <include name="stax-ex.jar" /> - - <include name="jboss-xml-binding.jar" /> - <include name="javassist.jar" /> - <include name="jbossws-native-client.jar" /> - <include name="jbossws-native-core.jar" /> - <include name="jbossws-native-jaxws.jar" /> - <include name="jbossws-native-jaxws-ext.jar" /> - <include name="jbossws-native-jaxrpc.jar" /> - <include name="jbossws-native-saaj.jar" /> - - <include name="policy.jar" /> - <include name="wsdl4j.jar" /> - - <!--Required for wsconsume --> - <include name="wstx.jar" /> - </fileset> - - <!-- not sure why not in the maven.runtime.classpath --> - <fileset dir="${settings.localRepository}/org/opensymphony/quartz/quartz/${quartz.version}/"> - <include name="quartz-${quartz.version}.jar" /> - </fileset> - - </path> - - <!-- Include the WSProved/WSConsume ant task definitions from JBossWS --> - <taskdef name="wsprovide" classname="org.jboss.wsf.spi.tools.ant.WSProvideTask" classpathref="jbossws.native.classpath" /> - <taskdef name="wsconsume" classname="org.jboss.wsf.spi.tools.ant.WSConsumeTask" classpathref="jbossws.native.classpath" /> - - <!-- Include Ant-Contrib for looping --> - <taskdef resource="net/sf/antcontrib/antcontrib.properties"> - <classpath> - <pathelement location="${settings.localRepository}/ant-contrib/ant-contrib/${ant.contrib.version}/ant-contrib-${ant.contrib.version}.jar" /> - </classpath> - </taskdef> - - <echo>List of Stateless Session Beans passed into WSProvide/WSConsume :${ws-list}</echo> - <!-- Call WS-Provide in loop --> - <foreach list="${ws-list}" target="iterate-wsprovide" param="bean" delimiter=","> - </foreach> - - <!-- Call WS-Consume in loop --> - <foreach list="${ws-list}" target="iterate-wsconsume" param="bean" delimiter=","> - </foreach> - - <echo>Copying generated content to the build output directory</echo> - <!-- Copy the Webservice specific classes over as well. --> - <copy todir="${project.build.outputDirectory}"> - <fileset dir="${project.build.outputDirectory}/wsconsume-output" includes="**/*.class"> - </fileset> - </copy> - - </target> - - <!-- Target for looping over wsconsume with each bean --> - <target name="iterate-wsconsume"> - <echo>*** Consuming ${bean}ManagerRemote wsdl...</echo> - <wsconsume fork="true" package="org.rhq.enterprise.server.ws" destdir="${wsconsume.home}" wsdl="${wsdl.home}/${bean}ManagerBeanService.wsdl" keep="true" target="2.1" /> - </target> - - <!-- Target for looping over wsconsume with each bean --> - <target name="iterate-wsprovide"> - <!-- Look up the full bean package and name stored as property --> - <propertycopy name="full-bean-name" from="${bean}Manager" override="true" /> - - <echo>*** Providing ${bean}ManagerRemote wsdl...</echo> - <wsprovide fork="true" destdir="${wsprovide.home}" resourcedestdir="${wsdl.home}" genwsdl="true" sei="${full-bean-name}"> - <classpath> - <pathelement path="${maven.runtime.classpath}" /> - </classpath> - </wsprovide> - </target> - -</project> - diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/JaxbUtilities.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/JaxbUtilities.java deleted file mode 100644 index b0ada63..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/JaxbUtilities.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.rhq.enterprise.server.ws; - -public class JaxbUtilities { - - /**A utility method to handle Property instances as bundled in Map instances and HashMap with JAXB. - * Initial syntax is unintuitive due to JAXB specification change that is needed. See following link. - * https://jaxb.dev.java.net/guide/Mapping_your_favorite_class.html - * @param configuration - * @param property - * @return boolean flag indicating success. - */ - public static boolean addProperty(WsConfiguration configuration, - Property property) { - boolean success = false; - if ((configuration != null) && (property != null)) {//null checking - if (property instanceof PropertySimple) { - configuration.getPropertySimpleContainer().add((PropertySimple) property); - success=true; - } - else if (property instanceof PropertyList) { - configuration.getPropertyListContainer().add((PropertyList) property); - success=true; - } - else if (property instanceof PropertyMap) { - configuration.getPropertyMapContainer().add((PropertyMap) property); - success=true; - } - } else { - throw new IllegalArgumentException( - "Configuration or Property objects passed in cannot be null."); - } - return success; - } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestPropertiesInterface.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestPropertiesInterface.java deleted file mode 100644 index e1c4c2f..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestPropertiesInterface.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.rhq.enterprise.server.ws; - -/**Only point of this file is to set testing properties for all instances. - * - * @author spinder - * - */ -public interface TestPropertiesInterface { - - static final boolean TESTS_ENABLED = true; - static String credentials = "ws-test"; - static String host = "127.0.0.1"; - static int port = 7080; - static boolean useSSL = false; - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestRemoteInterface.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestRemoteInterface.java deleted file mode 100644 index af1fc45..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/TestRemoteInterface.java +++ /dev/null @@ -1,666 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import org.testng.AssertJUnit; -import org.testng.annotations.Test; - -// JUST HERE FOR REFERENCE IN BUILDING THE NEW UNIT TESTS. KILL WHEN NO LONGER NEEDED - jay - -/** - * These tests can not be executed in our standard unit test fashion as they require a running RHQ - * Server with our web services deployed. - * - * This is still in development and has the current restrictions: - * - Server running on localhost. - * - ws-test user defined in database with full permissions - * - Non RHQ Server JBossAS in inventory. - * - The jbossws-native-home env variable must be set to a jbossws native stack install (e.g. jbossws-native-3.0.4.GA.zip) - * - The ws.test.package-path and ws.test.package-version environment variables must be defined to a test .war file. - * - * @author Jay Shaughnessy - */ - -@Test(groups = "ws") -public class TestRemoteInterface extends AssertJUnit { - - // static private final boolean TESTS_ENABLED = false; - // - // static private final String WSDL_URL_PREFIX = "http://127.0.0.1:7080/rhq-rhq-enterprise-server-ejb3/"; - // static private final String TARGET_NS_REPO_MANAGER = "http://content.server.enterprise.rhq.org/"; - // static private final String TARGET_NS_CONFIGURATION_MANAGER = "http://configuration.server.enterprise.rhq.org/"; - // static private final String TARGET_NS_CONTENT_MANAGER = "http://content.server.enterprise.rhq.org/"; - // static private final String TARGET_NS_OPERATION_MANAGER = "http://operation.server.enterprise.rhq.org/"; - // static private final String TARGET_NS_RESOURCE_MANAGER = "http://resource.server.enterprise.rhq.org/"; - // static private final String TARGET_NS_ROLE_MANAGER = "http://authz.server.enterprise.rhq.org/"; - // static private final String TARGET_NS_SUBJECT_MANAGER = "http://auth.server.enterprise.rhq.org/"; - // - // private SubjectManagerRemote subjectManager; - // private Subject user; - // - // @BeforeMethod - // public void beforeMethod() throws Exception { - // } - // - // @AfterMethod - // public void afterMethod() throws Exception { - // if (null != user) { - // subjectManager.logout(user); - // } - // user = null; - // } - // - // @Test(enabled = TESTS_ENABLED) - // public void testUserManagement() throws Exception { - // URL wsdlURL = new URL(WSDL_URL_PREFIX + "SubjectManagerBean?wsdl"); - // QName serviceName = new QName(TARGET_NS_SUBJECT_MANAGER, "SubjectManagerBeanService"); - // Service service = Service.create(wsdlURL, serviceName); - // subjectManager = service.getPort(SubjectManagerRemote.class); - // - // user = subjectManager.login("ws-test", "ws-test"); - // - // assertNotNull(user); - // - // assertEquals("ws-test", user.getName()); - // - // assertNotNull(user.getSessionId()); - // - // assertTrue(user.getSessionId() != 0); - // - // Subject newUser = subjectManager.getSubjectByName("ws-test-user"); - // - // if (null != newUser) { - // subjectManager.deleteSubjects(user, new int[] { newUser.getId() }); - // } - // - // newUser = new Subject(); - // newUser.setName("ws-test-user"); - // newUser.setFirstName("first-name"); - // newUser.setLastName("last-name"); - // newUser.setFactive(true); - // subjectManager.createSubject(user, newUser); - // - // newUser = subjectManager.getSubjectByName("ws-test-user"); - // assertNotNull(newUser); - // assertTrue("ws-test-user".equals(newUser.getName())); - // assertTrue("first-name".equals(newUser.getFirstName())); - // assertTrue("last-name".equals(newUser.getLastName())); - // - // subjectManager.createPrincipal(user, "ws-test-user", "ws-test-password"); - // newUser = subjectManager.login("ws-test-user", "ws-test-password"); - // subjectManager.logout(newUser); - // - // subjectManager.changePassword(user, "ws-test-user", "updated-ws-test-password"); - // newUser = subjectManager.login("ws-test-user", "updated-ws-test-password"); - // subjectManager.logout(newUser); - // - // newUser = subjectManager.getSubjectByName("ws-test-user"); - // newUser.setFirstName("updated-first-name"); - // newUser.setLastName("updated-last-name"); - // subjectManager.updateSubject(user, newUser); - // - // newUser = subjectManager.getSubjectByName("ws-test-user"); - // assertTrue("ws-test-user".equals(newUser.getName())); - // assertTrue("updated-first-name".equals(newUser.getFirstName())); - // assertTrue("updated-last-name".equals(newUser.getLastName())); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "RoleManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_ROLE_MANAGER, "RoleManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // RoleManagerRemote roleManager = service.getPort(RoleManagerRemote.class); - // - // PageList<Role> roles = roleManager.findSubjectUnassignedRoles(user, newUser.getId(), PageControl - // .getUnlimitedInstance()); - // Integer roleId = 0; - // for (Role role : roles) { - // if ("all resources role".equalsIgnoreCase(role.getName())) { - // roleId = role.getId(); - // break; - // } - // } - // roleManager.addRolesToSubject(user, newUser.getId(), new int[] { roleId }); - // - // subjectManager.deleteSubjects(user, new int[] { newUser.getId() }); - // assertNull(subjectManager.getSubjectByName("ws-test-user")); - // } - // - // /* remote interface for operations has changed a lot - // @Test(enabled = TESTS_ENABLED) - // public void testOperation() throws Exception { - // - // URL wsdlURL = new URL(WSDL_URL_PREFIX + "SubjectManagerBean?wsdl"); - // QName serviceName = new QName(TARGET_NS_SUBJECT_MANAGER, "SubjectManagerBeanService"); - // Service service = Service.create(wsdlURL, serviceName); - // subjectManager = service.getPort(SubjectManagerRemote.class); - // - // user = subjectManager.login("ws-test", "ws-test"); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ResourceManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_RESOURCE_MANAGER, "ResourceManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ResourceManagerRemote resourceManager = service.getPort(ResourceManagerRemote.class); - // - // PageList<ResourceComposite> resources = resourceManager.findResourceComposites(user, ResourceCategory.PLATFORM, - // null, 0, null, PageControl.getUnlimitedInstance()); - // - // assertNotNull(resources); - // assertTrue(resources.size() >= 1); - // - // ResourceComposite testPlatform = resources.get(0); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "OperationManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_OPERATION_MANAGER, "OperationManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // OperationManagerRemote operationManager = service.getPort(OperationManagerRemote.class); - // - // // Remove any pending histories - // PageList<ResourceOperationHistory> history = operationManager.findPendingResourceOperationHistories(user, - // testPlatform.getResource().getId(), PageControl.getUnlimitedInstance()); - // - // if (!history.isEmpty()) { - // for (ResourceOperationHistory roh : history) { - // operationManager.deleteOperationHistory(user, roh.getId(), true); - // } - // - // history = operationManager.findPendingResourceOperationHistories(user, testPlatform.getResource().getId(), - // PageControl.getUnlimitedInstance()); - // assertTrue(history.isEmpty()); - // } - // - // // remove any completed histories - // history = operationManager.findCompletedResourceOperationHistories(user, testPlatform.getResource().getId(), - // null, null, PageControl.getUnlimitedInstance()); - // - // if (!history.isEmpty()) { - // for (ResourceOperationHistory roh : history) { - // operationManager.deleteOperationHistory(user, roh.getId(), true); - // } - // - // history = operationManager.findCompletedResourceOperationHistories(user, - // testPlatform.getResource().getId(), null, null, PageControl.getUnlimitedInstance()); - // assertTrue(history.isEmpty()); - // } - // - // // schedule an operation for process list fetch - // ResourceOperationSchedule schedule = operationManager.scheduleResourceOperation(user, testPlatform - // .getResource().getId(), "viewProcessList", 0L, 0L, 0, 0, null, "ws unit test - platform process list"); - // assertNotNull(schedule); - // - // // wait to finish, or try to cancel after a minute. - // history = operationManager.findPendingResourceOperationHistories(user, testPlatform.getResource().getId(), - // PageControl.getUnlimitedInstance()); - // assertTrue(history.isEmpty() || history.size() == 1); - // - // long now = System.currentTimeMillis(); - // do { - // history = operationManager.findPendingResourceOperationHistories(user, testPlatform.getResource().getId(), - // PageControl.getUnlimitedInstance()); - // } while (!history.isEmpty() && (System.currentTimeMillis() < (now + 60000L))); - // if (!history.isEmpty()) { - // operationManager.cancelOperationHistory(user, history.get(0).getId(), true); - // } - // - // history = operationManager.findCompletedResourceOperationHistories(user, testPlatform.getResource().getId(), - // null, null, PageControl.getUnlimitedInstance()); - // assertEquals(1, history.size()); - // - // // remove scheduled operations - // List<ResourceOperationSchedule> schedules = operationManager.findScheduledResourceOperations(user, testPlatform - // .getResource().getId()); - // assertEquals(1, history.size()); - // - // if (!schedules.isEmpty()) { - // for (ResourceOperationSchedule ros : schedules) { - // operationManager.unscheduleResourceOperation(user, ros.getJobId().toString(), testPlatform - // .getResource().getId()); - // } - // - // schedules = operationManager.findScheduledResourceOperations(user, testPlatform.getResource().getId()); - // assertTrue(schedules.isEmpty()); - // } - // - // // schedule an operation for delayed process list fetch (we won't let it complete) - // schedule = operationManager.scheduleResourceOperation(user, testPlatform.getResource().getId(), - // "viewProcessList", 300000L, 0L, 0, 0, null, "unit test - shutdown operation"); - // - // schedules = operationManager.findScheduledResourceOperations(user, testPlatform.getResource().getId()); - // assertEquals(1, schedules.size()); - // assertEquals(schedule.getJobId(), schedules.get(0).getJobId()); - // - // operationManager.unscheduleResourceOperation(user, schedules.get(0).getJobId().toString(), testPlatform - // .getResource().getId()); - // schedules = operationManager.findScheduledResourceOperations(user, testPlatform.getResource().getId()); - // assertTrue(schedules.isEmpty()); - // } - // */ - // - // // disabled by default because this tests in not repeatable, it currently tests the ability to shutdown an AS. - // // Once it's down it's down and has to be started manually at the moment. - // // The testOperation test is similar but repeatable. This is here only because it maps directly to a use case - // /* remote interface for operations has changed a lot - // @Test(enabled = false) - // public void testJBossAS() throws Exception { - // - // URL wsdlURL = new URL(WSDL_URL_PREFIX + "SubjectManagerBean?wsdl"); - // QName serviceName = new QName(TARGET_NS_SUBJECT_MANAGER, "SubjectManagerBeanService"); - // Service service = Service.create(wsdlURL, serviceName); - // subjectManager = service.getPort(SubjectManagerRemote.class); - // - // user = subjectManager.login("ws-test", "ws-test"); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ResourceManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_RESOURCE_MANAGER, "ResourceManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ResourceManagerRemote resourceManager = service.getPort(ResourceManagerRemote.class); - // - // PageList<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "JBossAS Server", 0, - // null, PageControl.getUnlimitedInstance()); - // - // assertNotNull(resources); - // assertTrue(resources.size() >= 1); - // - // ResourceComposite testAS = null; - // for (ResourceComposite resource : resources) { - // if (!resource.getResource().getName().contains("RHQ Server")) { - // testAS = resource; - // break; - // } - // } - // - // assertNotNull("Test requires a Non-RHQ AS Server, please start and import a JBoss AS", testAS); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "OperationManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_OPERATION_MANAGER, "OperationManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // OperationManagerRemote operationManager = service.getPort(OperationManagerRemote.class); - // - // // Remove any pending histories - // PageList<ResourceOperationHistory> history = operationManager.findPendingResourceOperationHistories(user, - // testAS.getResource().getId(), PageControl.getUnlimitedInstance()); - // - // if (!history.isEmpty()) { - // for (ResourceOperationHistory roh : history) { - // operationManager.deleteOperationHistory(user, roh.getId(), true); - // } - // - // history = operationManager.findPendingResourceOperationHistories(user, testAS.getResource().getId(), - // PageControl.getUnlimitedInstance()); - // assertTrue(history.isEmpty()); - // } - // - // // remove any completed histories - // history = operationManager.findCompletedResourceOperationHistories(user, testAS.getResource().getId(), null, - // null, PageControl.getUnlimitedInstance()); - // - // if (!history.isEmpty()) { - // for (ResourceOperationHistory roh : history) { - // operationManager.deleteOperationHistory(user, roh.getId(), true); - // } - // - // history = operationManager.findCompletedResourceOperationHistories(user, testAS.getResource().getId(), - // null, null, PageControl.getUnlimitedInstance()); - // assertTrue(history.isEmpty()); - // } - // - // // schedule an operation for immediate shutdown of AS instance - // ResourceOperationSchedule schedule = operationManager.scheduleResourceOperation(user, testAS.getResource() - // .getId(), "shutdown", 0L, 0L, 0, 0, null, "unit test - shutdown operation"); - // - // // wait to finish, or try to cancel after a minute. - // history = operationManager.findPendingResourceOperationHistories(user, testAS.getResource().getId(), - // PageControl.getUnlimitedInstance()); - // assertTrue(history.isEmpty() || history.size() == 1); - // - // long now = System.currentTimeMillis(); - // do { - // history = operationManager.findPendingResourceOperationHistories(user, testAS.getResource().getId(), - // PageControl.getUnlimitedInstance()); - // } while (!history.isEmpty() && (System.currentTimeMillis() < (now + 60000L))); - // if (!history.isEmpty()) { - // operationManager.cancelOperationHistory(user, history.get(0).getId(), true); - // } - // - // history = operationManager.findCompletedResourceOperationHistories(user, testAS.getResource().getId(), null, - // null, PageControl.getUnlimitedInstance()); - // assertEquals(1, history.size()); - // - // // remove scheduled operations - // List<ResourceOperationSchedule> schedules = operationManager.findScheduledResourceOperations(user, testAS - // .getResource().getId()); - // assertEquals(1, history.size()); - // - // if (!schedules.isEmpty()) { - // for (ResourceOperationSchedule ros : schedules) { - // operationManager.unscheduleResourceOperation(user, ros.getJobId().toString(), testAS.getResource() - // .getId()); - // } - // - // schedules = operationManager.findScheduledResourceOperations(user, testAS.getResource().getId()); - // assertTrue(schedules.isEmpty()); - // } - // - // // schedule an operation for delayed shutdown of AS instance (we won't let it complete) - // schedule = operationManager.scheduleResourceOperation(user, testAS.getResource().getId(), "shutdown", 300000L, - // 0L, 0, 0, null, "unit test - shutdown operation"); - // - // schedules = operationManager.findScheduledResourceOperations(user, testAS.getResource().getId()); - // assertEquals(1, schedules.size()); - // assertEquals(schedule.getJobId(), schedules.get(0).getJobId()); - // - // operationManager.unscheduleResourceOperation(user, schedules.get(0).getJobId().toString(), testAS.getResource() - // .getId()); - // schedules = operationManager.findScheduledResourceOperations(user, testAS.getResource().getId()); - // assertTrue(schedules.isEmpty()); - // } - // */ - // - // @Test(enabled = TESTS_ENABLED) - // public void testUpdateResourceConfiguration() throws Exception { - // - // URL wsdlURL = new URL(WSDL_URL_PREFIX + "SubjectManagerBean?wsdl"); - // QName serviceName = new QName(TARGET_NS_SUBJECT_MANAGER, "SubjectManagerBeanService"); - // Service service = Service.create(wsdlURL, serviceName); - // subjectManager = service.getPort(SubjectManagerRemote.class); - // - // user = subjectManager.login("ws-test", "ws-test"); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ResourceManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_RESOURCE_MANAGER, "ResourceManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ResourceManagerRemote resourceManager = service.getPort(ResourceManagerRemote.class); - // - // PageList<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "RHQ Agent", 0, - // null, PageControl.getUnlimitedInstance()); - // - // assertNotNull(resources); - // assertTrue(resources.size() >= 1); - // - // ResourceComposite testAgent = null; - // for (ResourceComposite resource : resources) { - // if (resource.getAvailability().equals(AvailabilityType.UP)) { - // testAgent = resource; - // break; - // } - // } - // - // assertNotNull("Test requires an available RHQ Agent, please start an RHQ Agent", testAgent); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ConfigurationManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_CONFIGURATION_MANAGER, "ConfigurationManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ConfigurationManagerRemote configManager = service.getPort(ConfigurationManagerRemote.class); - // - // Configuration config = configManager.getResourceConfiguration(user, testAgent.getResource().getId()); - // assertNotNull(config); - // assertEquals("plugins", config.getSimpleProperties().get("rhq.agent.plugins.directory").getStringValue()); - // - // config.getSimpleProperties().get("rhq.agent.plugins.directory").setStringValue("plugins/../plugins"); - // configManager.updateResourceConfiguration(user, testAgent.getResource().getId(), config); - // - // long now = System.currentTimeMillis(); - // do { - // } while (configManager.isResourceConfigurationUpdateInProgress(user, testAgent.getResource().getId()) - // && (System.currentTimeMillis() < (now + 60000L))); - // if (configManager.isResourceConfigurationUpdateInProgress(user, testAgent.getResource().getId())) { - // fail("Config Update not completed, may need to fix property manually"); - // } - // - // config = configManager.getResourceConfiguration(user, testAgent.getResource().getId()); - // assertNotNull(config); - // assertEquals("plugins/../plugins", config.getSimpleProperties().get("rhq.agent.plugins.directory") - // .getStringValue()); - // - // config.getSimpleProperties().get("rhq.agent.plugins.directory").setStringValue("plugins"); - // configManager.updateResourceConfiguration(user, testAgent.getResource().getId(), config); - // } - // - // @Test(enabled = TESTS_ENABLED) - // public void testUpdatePluginConfiguration() throws Exception { - // - // URL wsdlURL = new URL(WSDL_URL_PREFIX + "SubjectManagerBean?wsdl"); - // QName serviceName = new QName(TARGET_NS_SUBJECT_MANAGER, "SubjectManagerBeanService"); - // Service service = Service.create(wsdlURL, serviceName); - // subjectManager = service.getPort(SubjectManagerRemote.class); - // - // user = subjectManager.login("ws-test", "ws-test"); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ResourceManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_RESOURCE_MANAGER, "ResourceManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ResourceManagerRemote resourceManager = service.getPort(ResourceManagerRemote.class); - // - // PageList<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "JBossAS Server", 0, - // null, PageControl.getUnlimitedInstance()); - // - // assertNotNull(resources); - // assertTrue(resources.size() >= 1); - // - // ResourceComposite testAS = null; - // for (ResourceComposite resource : resources) { - // if (resource.getResource().getName().contains("RHQ Server")) { - // testAS = resource; - // break; - // } - // } - // - // assertNotNull("Could not find RHQ Server, that's not good...", testAS); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ConfigurationManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_CONFIGURATION_MANAGER, "ConfigurationManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ConfigurationManagerRemote configManager = service.getPort(ConfigurationManagerRemote.class); - // - // Configuration config = configManager.getPluginConfiguration(user, testAS.getResource().getId()); - // assertNotNull(config); - // assertTrue(config.getSimpleProperties().get("startScript").getStringValue().endsWith("run.bat")); - // - // String newString = config.getSimpleProperties().get("startScript").getStringValue().replace("run.bat", - // "batter.run"); - // config.getSimpleProperties().get("startScript").setStringValue(newString); - // configManager.updatePluginConfiguration(user, testAS.getResource().getId(), config); - // - // config = configManager.getPluginConfiguration(user, testAS.getResource().getId()); - // assertNotNull(config); - // assertTrue(config.getSimpleProperties().get("startScript").getStringValue().endsWith("batter.run")); - // - // newString = config.getSimpleProperties().get("startScript").getStringValue().replace("batter.run", "run.bat"); - // config.getSimpleProperties().get("startScript").setStringValue(newString); - // configManager.updatePluginConfiguration(user, testAS.getResource().getId(), config); - // } - // - // @Test(enabled = TESTS_ENABLED) - // public void testDeployment() throws Exception { - // - // reportHeap("start"); - // - // URL wsdlURL = new URL(WSDL_URL_PREFIX + "SubjectManagerBean?wsdl"); - // QName serviceName = new QName(TARGET_NS_SUBJECT_MANAGER, "SubjectManagerBeanService"); - // Service service = Service.create(wsdlURL, serviceName); - // subjectManager = service.getPort(SubjectManagerRemote.class); - // - // reportHeap("subjectManager"); - // - // user = subjectManager.login("ws-test", "ws-test"); - // - // reportHeap("login"); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ResourceManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_RESOURCE_MANAGER, "ResourceManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ResourceManagerRemote resourceManager = service.getPort(ResourceManagerRemote.class); - // - // reportHeap("resourceManager"); - // - // // PageList<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, "JBossAS Server", 0, - // // null, PageControl.getUnlimitedInstance()); - // PageList<ResourceComposite> resources = resourceManager.findResourceComposites(user, null, - // "Web Application (WAR)", 0, null, PageControl.getUnlimitedInstance()); - // - // assertNotNull(resources); - // assertTrue(resources.size() >= 1); - // - // ResourceComposite testWar = null; - // for (ResourceComposite resource : resources) { - // // if (!resource.getResource().getName().contains("RHQ Server")) { - // if (resource.getResource().getName().contains("servlets-examples1.war")) { - // testWar = resource; - // break; - // } - // } - // - // assertNotNull("Test requires a Non-RHQ AS Server, please start and import a JBoss AS", testWar); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "RepoManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_REPO_MANAGER, "RepoManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // RepoManagerRemote repoManager = service.getPort(RepoManagerRemote.class); - // - // reportHeap("repoManager"); - // - // PageList<Repo> repos = repoManager.findRepos(user, PageControl.getUnlimitedInstance()); - // - // for (Repo repo : repos) { - // if ("ws-test-repo".equals(repo.getName())) { - // repoManager.deleteRepo(user, repo.getId()); - // } - // } - // - // Repo testRepo = repoManager.createRepo(user, new Repo("ws-test-repo")); - // assertNotNull(testRepo); - // assertEquals("ws-test-repo", testRepo.getName()); - // - // repos = repoManager.findRepos(user, PageControl.getUnlimitedInstance()); - // - // testRepo = null; - // for (Repo repo : repos) { - // if ("ws-test-repo".equals(repo.getName())) { - // testRepo = repo; - // break; - // } - // } - // assertNotNull(testRepo); - // - // repoManager.subscribeResourceToRepos(user, testWar.getResource().getId(), - // new int[] { testRepo.getId() }); - // - // PageList<Resource> repoResources = repoManager.findSubscribedResources(user, testRepo.getId(), - // PageControl.getUnlimitedInstance()); - // - // assertNotNull(repoResources); - // assertEquals(1, repoResources.size()); - // assertTrue(repoResources.get(0).equals(testWar.getResource())); - // - // wsdlURL = new URL(WSDL_URL_PREFIX + "ContentManagerBean?wsdl"); - // serviceName = new QName(TARGET_NS_CONTENT_MANAGER, "ContentManagerBeanService"); - // service = Service.create(wsdlURL, serviceName); - // ContentManagerRemote contentManager = service.getPort(ContentManagerRemote.class); - // - // reportHeap("contentManager"); - // - // List<PackageType> packageTypes = contentManager.findPackageTypes(user, "Web Application (WAR)", "JBossAS"); - // assertNotNull(packageTypes); - // assertEquals(1, packageTypes.size()); - // PackageType testPackageType = null; - // for (PackageType pt : packageTypes) { - // if ("file".equals(pt.getName())) { - // testPackageType = pt; - // break; - // } - // } - // assertNotNull(testPackageType); - // - // List<Architecture> architectures = contentManager.findArchitectures(user); - // assertNotNull(architectures); - // Architecture testArch = null; - // for (Architecture arch : architectures) { - // if ("noarch".equalsIgnoreCase(arch.getName())) { - // testArch = arch; - // break; - // } - // } - // assertNotNull(testArch); - // - // String packagePath = System.getProperty("ws.test.package-path"); - // assertNotNull(packagePath); - // packagePath = packagePath.trim(); - // assertTrue(!"".equals(packagePath)); - // File file = new File(packagePath); - // assertTrue(file.exists()); - // String packageVersion = System.getProperty("ws.test.package-version"); - // assertNotNull(packageVersion); - // packageVersion = packageVersion.trim(); - // assertTrue(!"".equals(packageVersion)); - // - // // PackageVersion testPackageVersion = contentManager.createPackageVersion(user, "ws-test-package", - // // testPackageType.getId(), "1.0", testArch.getId(), getBytesFromFile(file)); - // PackageVersion testPackageVersion = contentManager.createPackageVersion(user, "servlets-examples1.war", - // testPackageType.getId(), packageVersion, testArch.getId(), getBytesFromFile(file)); - // assertNotNull(testPackageVersion); - // assertTrue(testPackageVersion.getId() > 0); - // - // repoManager.addPackageVersionsToRepo(user, testRepo.getId(), new int[] { testPackageVersion.getId() }); - // - // int[] resourceIds = new int[] { testWar.getResource().getId() }; - // int[] packageVersionIds = new int[] { testPackageVersion.getId() }; - // - // contentManager.deployPackages(user, resourceIds, packageVersionIds); - // - // repoManager.unsubscribeResourceFromRepos(user, testWar.getResource().getId(), new int[] { testRepo - // .getId() }); - // - // repoResources = repoManager.findSubscribedResources(user, testRepo.getId(), PageControl - // .getUnlimitedInstance()); - // - // assertNotNull(repoResources); - // assertEquals(0, repoResources.size()); - // - // // this will force a purge of testPackageVersion - // repoManager.deleteRepo(user, testRepo.getId()); - // } - // - // private void reportHeap(String description) { - // Runtime runtime = Runtime.getRuntime(); - // long mbConst = 1024 * 1024L; - // - // System.out.println(description); - // - // // Get current size of heap in bytes - // System.out.print(" totalMb=" + ((runtime.totalMemory() / mbConst))); - // - // // Get maximum size of heap in bytes. The heap cannot grow beyond this size. - // // Any attempt will result in an OutOfMemoryException. - // System.out.print(", maxMb=" + ((runtime.maxMemory() / mbConst))); - // - // // Get amount of free memory within the heap in bytes. This size will increase - // // after garbage collection and decrease as new objects are created. - // System.out.println(", freeMb=" + ((runtime.freeMemory() / mbConst))); - // } - // - // public static byte[] getBytesFromFile(File file) throws IOException { - // InputStream is = new FileInputStream(file); - // - // // Get the size of the file - // long length = file.length(); - // - // if (length > Integer.MAX_VALUE) { - // // File is too large - // } - // - // // Create the byte array to hold the data - // byte[] bytes = new byte[(int) length]; - // - // // Read in the bytes - // int offset = 0; - // int numRead = 0; - // while (offset < bytes.length && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0) { - // offset += numRead; - // } - // - // // Ensure all the bytes have been read in - // if (offset < bytes.length) { - // throw new IOException("Could not completely read file " + file.getName()); - // } - // - // // Close the input stream and return bytes - // is.close(); - // return bytes; - // } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertDefinitionManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertDefinitionManagerTest.java deleted file mode 100644 index d1ac1e6..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertDefinitionManagerTest.java +++ /dev/null @@ -1,406 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.io.FileNotFoundException; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; -import javax.xml.ws.Binding; -import javax.xml.ws.BindingProvider; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsAlertDefinitionManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - private static ObjectFactory WS_OBJECT_FACTORY ; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, - SecurityException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertDefinitionsWithoutFiltering() { - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, WS_OBJECT_FACTORY - .createAlertDefinitionCriteria()); - - assertNotNull( - "Expected to get back non-null results when fetch alert definitions without filtering", - alertDefs); - } - - @Test(enabled = TESTS_ENABLED) - void testFindSingleAlertDefinitionWithFiltering() { - Resource service = findService("service-alpha-0", "server-omega-0"); - - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterName("service-alpha-0-alert-def-1"); - criteria - .setFilterDescription("Test alert definition 1 for service-alpha-0"); - criteria.setFilterPriority(AlertPriority.MEDIUM); - criteria.setFilterEnabled(true); - // criteria.addFilterResourceIds([service.id]); - List<Integer> filterResourceIds = new ArrayList<Integer>(); - filterResourceIds.add(service.getId()); - criteria.filterResourceIds = filterResourceIds; - criteria.setFilterDeleted(false); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals("Expected to get back one alert definition.", alertDefs - .size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testGetAlertDefinitionById() { - Resource service = findService("service-alpha-0", "server-omega-0"); - - AlertDefinitionCriteria criteria = new AlertDefinitionCriteria(); - criteria.setFilterName("service-alpha-0-alert-def-1"); - criteria - .setFilterDescription("Test alert definition 1 for service-alpha-0"); - criteria.setFilterPriority(AlertPriority.MEDIUM); - criteria.setFilterEnabled(true); - // criteria.addFilterResourceIds(service.getId()); - List<Integer> filterResourceIds = new ArrayList<Integer>(); - filterResourceIds.add(service.getId()); - criteria.filterResourceIds = filterResourceIds; - criteria.setFilterDeleted(false); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - assertTrue("Unable to locate alert definitions.", alertDefs.size() > 0); - AlertDefinition alertDef = alertDefs.get(0); - - assertNotNull("Expected to get back an alert " + "definition for id " - + alertDef.id, WEBSERVICE_REMOTE.getAlertDefinition(subject, - alertDef.id)); - } - - @Test(enabled = TESTS_ENABLED) - void testFindMultipleAlertDefinitionsWithFiltering() { - Resource serviceAlpha = findService("service-alpha-0", "server-omega-0"); - Resource serviceBeta = findService("service-alpha-1", "server-omega-0"); - - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterPriority(AlertPriority.MEDIUM); - List<Integer> filterResourceIds = new ArrayList<Integer>(); - filterResourceIds.add(serviceAlpha.getId()); - filterResourceIds.add(serviceBeta.getId()); - criteria.filterResourceIds = filterResourceIds; - criteria.setFilterDeleted(false); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals("Expected to get back two alert definitions but got " - + alertDefs.size(), alertDefs.size(), 2); - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertDefinitionWithFilteringAndFetchingAssociations() { - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterName("service-alpha-0"); - criteria - .setFilterDescription("Test alert definition 1 for service-alpha-0"); - - criteria.setFetchAlerts(true); - criteria.setFetchConditions(true); - criteria.setFetchAlertNotifications(true); - criteria.setFilterDeleted(false); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals( - "Expected to get back one alert when filtering and fetching associations", - alertDefs.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertDefinitionsWithFilteringAndSortingAndFetchingAssociations() { - Resource serviceAlpha = findService("service-alpha-0", "server-omega-0"); - Resource serviceBeta = findService("service-alpha-1", "server-omega-0"); - - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterPriority(AlertPriority.MEDIUM); - // criteria.addFilterResourceIds([serviceAlpha.id, serviceBeta.id]); - List<Integer> filterResourceIds = new ArrayList<Integer>(); - filterResourceIds.add(serviceAlpha.getId()); - filterResourceIds.add(serviceBeta.getId()); - criteria.filterResourceIds = filterResourceIds; - criteria.setFilterDeleted(false); - - criteria.setSortName(PageOrdering.ASC); - criteria.setSortPriority(PageOrdering.DESC); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals( - "Expected to get back two alert definitions when filtering, " - + "sorting, and fetching associations", alertDefs - .size(), 2); - - // TODO verify sort order - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertsWithoutFiltering() { - AlertCriteria criteria = WS_OBJECT_FACTORY.createAlertCriteria(); - - List<Alert> alerts = WEBSERVICE_REMOTE.findAlertsByCriteria(subject, - criteria); - - assertNotNull( - "Expected to get back non-null results when fetching alerts without filtering", - alerts); - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertsWithFiltering() throws InterruptedException, - MalformedURLException, SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception, FileNotFoundException { - - // find resource - Resource service = findService("service-alpha-0", "server-omega-0"); - assertNotNull("Specified resource was not located.", service); - String eventDetails = new java.util.Date() + " >> events created for " - + service.name; - String severity = "WARN"; - int numberOfEvents = 1; - - // opSchedule = fireEvents(service, severity, numberOfEvents, - // eventDetails); - // ResourceOperationSchedule opSchedule = fireEvents(service, severity, - // numberOfEvents); - ResourceOperationSchedule opSchedule = fireEvents(service, severity, - numberOfEvents, eventDetails); - - WsEventManagerTest.waitForScheduledOperationToComplete(opSchedule); - - int pauseLength = 1000; // in milliseconds - int numberOfIntervals = 30; - - EventCriteria eventCriteria = WS_OBJECT_FACTORY.createEventCriteria(); - eventCriteria.caseSensitive = true; - eventCriteria.setFilterResourceId(service.id); - eventCriteria.setFilterDetail(eventDetails); - eventCriteria.setFetchSource(true); - - List<Event> events = waitForEventsToBeCommitted(pauseLength, - numberOfIntervals, eventCriteria, numberOfEvents); - - assertEquals( - "Failed to find all fired events when finding alerts " - + "with filtering. This could just be a timeout. You may want to check your database and server logs to be sure though", - numberOfEvents,events.size()); - - String alertDef1Name = "service-alpha-0-alert-def-1"; - - AlertCriteria alertCriteria = WS_OBJECT_FACTORY.createAlertCriteria(); - alertCriteria.setFilterName(alertDef1Name); - alertCriteria - .setFilterDescription("Test alert definition 1 for service-alpha-0"); - alertCriteria.getFilterPriorities().add(AlertPriority.MEDIUM); - alertCriteria.setFilterResourceTypeName("service-alpha"); - - List<Alert> alerts = WEBSERVICE_REMOTE.findAlertsByCriteria(subject, - alertCriteria); - - assertEquals("Expected to get back one alert for alert definition '" - + alertDef1Name + "'", 1, alerts.size()); - } - - String[] getNames(List<OperationDefinition> list) { - String[] names = new String[list.size()]; - for (int i = 0; i < list.size(); ++i) { - names[i] = (list.get(i).getName()); - } - return names; - } - - Resource findService(String name, String parentName) { - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName(name); - criteria.setFilterParentResourceName(parentName); - - return WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria) - .get(0); - } - - ResourceOperationSchedule fireEvents(Resource resource, String severity, - int numberOfEvents) { -// SimpleDateFormat sdf = new SimpleDateFormat(); - String details = new java.util.Date() - + " >> events created for " + resource.name; - String operationName = "createEvents"; - int delay = 0; - int repeatInterval = 0; - int repeatCount = 0; - int timeout = 0; -// Configuration parameters = createParameters(resource, severity, -// numberOfEvents, details); - WsConfiguration parameters = createWsConfigurationParameters(resource, severity, - numberOfEvents, details); - - String description = "Test script event for " + resource.name; - - return WEBSERVICE_REMOTE.scheduleResourceOperation(subject, - resource.id, operationName, delay, repeatInterval, repeatCount, - timeout, parameters, description); - } - - ResourceOperationSchedule fireEvents(Resource resource, String severity, - int numberOfEvents, String details) throws MalformedURLException, SecurityException, IllegalArgumentException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, LoginException_Exception { - String operationName = "createEvents"; - int delay = 0; - int repeatInterval = 0; - int repeatCount = 0; - int timeout = 0; -// Configuration parameters = createParameters(resource, severity, -// numberOfEvents, details); - WsConfiguration parameters = createWsConfigurationParameters(resource, severity, - numberOfEvents, details); - String description = "Test script event for " + resource.name; - - return WEBSERVICE_REMOTE.scheduleResourceOperation(subject, - resource.id, operationName, delay, repeatInterval, repeatCount, - timeout, parameters, description); - } - - Configuration createParameters(Resource resource, String severity, - int numberOfEvents, String details) { - Configuration params = WS_OBJECT_FACTORY.createConfiguration(); - // params.propertyListOrPropertySimpleOrPropertyMap. - PropertySimple prop1 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("source"); - prop1.setStringValue(resource.getName()); - PropertySimple prop2 = WS_OBJECT_FACTORY.createPropertySimple(); - prop2.setName("details"); - prop2.setStringValue(details); - PropertySimple prop3 = WS_OBJECT_FACTORY.createPropertySimple(); - prop3.setName("severity"); - prop3.setStringValue(severity); - PropertySimple prop4 = WS_OBJECT_FACTORY.createPropertySimple(); - prop4.setName("count"); - prop4.setStringValue(Integer.valueOf(numberOfEvents) + ""); - List<Property> wsProps = new ArrayList<Property>(); - wsProps.add(prop1); - wsProps.add(prop2); - wsProps.add(prop3); - wsProps.add(prop4); - // params.propertyListOrPropertySimpleOrPropertyMap = wsProps; - params.propertyListOrPropertySimpleOrPropertyMap = params - .getPropertyListOrPropertySimpleOrPropertyMap(); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop1); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop2); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop3); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop4); - - return params; - } - - public static WsConfiguration createWsConfigurationParameters(Resource resource, - String severity, int numberOfEvents, String details) { - // Configuration params = WS_OBJECT_FACTORY.createConfiguration(); - WsConfiguration params = new WsConfiguration(); - // params.propertyListOrPropertySimpleOrPropertyMap. - PropertySimple prop1 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("source"); - prop1.setStringValue(resource.getName()); - PropertySimple prop2 = WS_OBJECT_FACTORY.createPropertySimple(); - prop2.setName("details"); - prop2.setStringValue(details); - PropertySimple prop3 = WS_OBJECT_FACTORY.createPropertySimple(); - prop3.setName("severity"); - prop3.setStringValue(severity); - PropertySimple prop4 = WS_OBJECT_FACTORY.createPropertySimple(); - prop4.setName("count"); - prop4.setStringValue(Integer.valueOf(numberOfEvents) + ""); -// params. - JaxbUtilities.addProperty(params, prop1); - JaxbUtilities.addProperty(params, prop2); - JaxbUtilities.addProperty(params, prop3); - JaxbUtilities.addProperty(params, prop4); - - - return params; - } - - List<Event> findEventsByResource(Resource resource) { - EventCriteria criteria = WS_OBJECT_FACTORY.createEventCriteria(); - criteria.setFilterResourceId(resource.id); - - return WEBSERVICE_REMOTE.findEventsByCriteria(subject, criteria); - } - - List<Event> waitForEventsToBeCommitted(int intervalLength, - int numberOfIntervals, EventCriteria eventCriteria, - int numberOfEvents) throws InterruptedException { - List<Event> events = null; - for (int i = 0; i < numberOfIntervals; ++i) { - events = WEBSERVICE_REMOTE.findEventsByCriteria(subject, - eventCriteria); - java.lang.System.out.println("SIZE = " + events.size() - + ", NUM_EVENTS = " + numberOfEvents); - if (events.size() == numberOfEvents) { - return events; - } - java.lang.Thread.sleep(intervalLength); - } - return events; - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertManagerTest.java deleted file mode 100644 index 82f4f2e..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsAlertManagerTest.java +++ /dev/null @@ -1,393 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsAlertManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public static void init() throws ClassNotFoundException, - MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertDefinitionsWithoutFiltering() { - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, WS_OBJECT_FACTORY - .createAlertDefinitionCriteria()); - - assertNotNull( - "Expected to get back non-null results when fetch alert definitions without filtering", - alertDefs); - } - - @Test(enabled = TESTS_ENABLED) - void testFindSingleAlertDefinitionWithFiltering() { - Resource service = findService("service-alpha-0", "server-omega-0"); - - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterName("service-alpha-0-alert-def-1"); - criteria - .setFilterDescription("Test alert definition 1 for service-alpha-0"); - criteria.setFilterPriority(AlertPriority.MEDIUM); - criteria.setFilterEnabled(true); - // criteria.addFilterResourceIds([service.id]); - List<Integer> filterResourceIds = new ArrayList<Integer>(); - filterResourceIds.add(service.getId()); - criteria.filterResourceIds = filterResourceIds; - criteria.setFilterDeleted(false); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals("Expected to get back one alert definition.", alertDefs - .size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindMultipleAlertDefinitionsWithFiltering() { - Resource serviceAlpha = findService("service-alpha-0", "server-omega-0"); - // Resource serviceBeta = findService("service-alpha-1", - // "server-omega-0"); - - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterPriority(AlertPriority.MEDIUM); - List<Integer> filterResourceIds = new ArrayList<Integer>(); - filterResourceIds.add(serviceAlpha.getId()); - // filterResourceIds.add(serviceBeta.getId()); - criteria.filterResourceIds = filterResourceIds; - criteria.setFilterDeleted(false); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals("Expected to get back two alert definitions but got " - + alertDefs.size(), alertDefs.size(), 2); - - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertDefinitionWithFilteringAndFetchingAssociations() { - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterName("service-alpha-0"); - criteria - .setFilterDescription("Test alert definition 1 for service-alpha-0"); - - criteria.setFetchAlerts(true); - criteria.setFetchConditions(true); - criteria.setFetchAlertNotifications(true); - criteria.setFilterDeleted(false); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals( - "Expected to get back one alert when filtering and fetching associations", - alertDefs.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertDefinitionsWithFilteringAndSortingAndFetchingAssociations() { - Resource serviceAlpha = findService("service-alpha-0", "server-omega-0"); - Resource serviceBeta = findService("service-alpha-1", "server-omega-0"); - - AlertDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createAlertDefinitionCriteria(); - criteria.setFilterPriority(AlertPriority.MEDIUM); - // criteria.addFilterResourceIds([serviceAlpha.id, serviceBeta.id]); - List<Integer> filterResourceIds = new ArrayList<Integer>(); - filterResourceIds.add(serviceAlpha.getId()); - filterResourceIds.add(serviceBeta.getId()); - criteria.filterResourceIds = filterResourceIds; - criteria.setFilterDeleted(false); - - criteria.setSortName(PageOrdering.ASC); - criteria.setSortPriority(PageOrdering.DESC); - - List<AlertDefinition> alertDefs = WEBSERVICE_REMOTE - .findAlertDefinitionsByCriteria(subject, criteria); - - assertEquals( - "Expected to get back two alert definitions when filtering, " - + "sorting, and fetching associations", alertDefs - .size(), 2); - - // check the getAlertDefinition method as well - AlertDefinition alertDef = alertDefs.get(0); - AlertDefinition alertDefRetrieved = WEBSERVICE_REMOTE - .getAlertDefinition(subject, alertDef.getId()); - assertEquals("Alert definition ids do not match.", alertDef.getId(), - alertDefRetrieved.getId()); - assertEquals("Alert definition desc do not match.", alertDef - .getDescription(), alertDefRetrieved.getDescription()); - - // TODO verify sort order - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertsWithoutFiltering() { - AlertCriteria criteria = WS_OBJECT_FACTORY.createAlertCriteria(); - - List<Alert> alerts = WEBSERVICE_REMOTE.findAlertsByCriteria(subject, - criteria); - - assertNotNull( - "Expected to get back non-null results when fetching alerts without filtering", - alerts); - } - - @Test(enabled = TESTS_ENABLED) - void testFindAlertsWithFiltering() throws InterruptedException, - MalformedURLException, SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - Resource service = findService("service-alpha-0", "server-omega-0"); - String eventDetails = new java.util.Date() + " >> events created for " - + service.name; - String severity = "WARN"; - int numberOfEvents = 1; - - long startDate = new java.util.Date().getTime(); - - ResourceOperationSchedule opSchedule = fireEvents(service, severity, - numberOfEvents, eventDetails); - - // scriptUtil.waitForScheduledOperationToComplete(opSchedule); - WsEventManagerTest.waitForScheduledOperationToComplete(opSchedule); - - int pauseLength = 1000; // in milliseconds - int numberOfIntervals = 30; - - EventCriteria eventCriteria = new EventCriteria(); - eventCriteria.caseSensitive = true; - eventCriteria.setFilterResourceId(service.id); - eventCriteria.setFilterDetail(eventDetails); - eventCriteria.setFetchSource(true); - - List<Event> events = waitForEventsToBeCommitted(pauseLength, - numberOfIntervals, eventCriteria, numberOfEvents); - - assertEquals( - "Failed to find all fired events when finding alerts " - + "with filtering. This could just be a timeout. You may want to check your database and server logs to be sure though", - events.size(), numberOfEvents); - - String alertDef1Name = "service-alpha-0-alert-def-1"; - - AlertCriteria alertCriteria = new AlertCriteria(); - alertCriteria.caseSensitive = true; - alertCriteria.strict = true; - alertCriteria.setFilterName(alertDef1Name); - alertCriteria - .setFilterDescription("Test alert definition 1 for service-alpha-0"); - alertCriteria.getFilterPriorities().add(AlertPriority.MEDIUM); - alertCriteria.setFilterResourceTypeName("service-alpha"); - alertCriteria.setFilterStartTime(startDate); - - List<Alert> alerts = WEBSERVICE_REMOTE.findAlertsByCriteria(subject, - alertCriteria); - - assertEquals("Expected to get back one alert for alert definition '" - + alertDef1Name + "'", alerts.size(), 1); - } - - String[] getNames(List<OperationDefinition> list) { - String[] names = new String[list.size()]; - for (int i = 0; i < list.size(); ++i) { - names[i] = (list.get(i).getName()); - } - return names; - } - - Resource findService(String name, String parentName) { - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName(name); - criteria.setFilterParentResourceName(parentName); - - return WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria) - .get(0); - } - - ResourceOperationSchedule fireEvents(Resource resource, String severity, - int numberOfEvents) throws MalformedURLException, - SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - // SimpleDateFormat sdf = new SimpleDateFormat(); - String details = new java.util.Date() + " >> events created for " - + resource.name; - String operationName = "createEvents"; - int delay = 0; - int repeatInterval = 0; - int repeatCount = 0; - int timeout = 0; - // Configuration parameters = createParameters(resource, severity, - // numberOfEvents, details); - WsConfiguration parameters = createWsConfigurationParameters(resource, - severity, numberOfEvents, details); - - String description = "Test script event for " + resource.name; - - return WEBSERVICE_REMOTE.scheduleResourceOperation(subject, - resource.id, operationName, delay, repeatInterval, repeatCount, - timeout, parameters, description); - } - - Configuration createParameters(Resource resource, String severity, - int numberOfEvents, String details) { - Configuration params = WS_OBJECT_FACTORY.createConfiguration(); - // params.propertyListOrPropertySimpleOrPropertyMap. - PropertySimple prop1 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("source"); - prop1.setStringValue(resource.getName()); - // params.put(WS_OBJECT_FACTORY.createPropertySimple("source", - // resource.name)); - // params.put(new PropertySimple("details", details)); - PropertySimple prop2 = WS_OBJECT_FACTORY.createPropertySimple(); - prop2.setName("details"); - prop2.setStringValue(details); - // params.put(new PropertySimple("severity", severity)); - PropertySimple prop3 = WS_OBJECT_FACTORY.createPropertySimple(); - prop3.setName("severity"); - prop3.setStringValue(severity); - // params.put(new PropertySimple("count", - // java.lang.Integer(numberOfEvents))); - PropertySimple prop4 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("count"); - prop4.setStringValue(Integer.valueOf(numberOfEvents).toString()); - List<Property> wsProps = new ArrayList<Property>(); - wsProps.add(prop1); - wsProps.add(prop2); - wsProps.add(prop3); - wsProps.add(prop4); - params.propertyListOrPropertySimpleOrPropertyMap = wsProps; - - return params; - } - - ResourceOperationSchedule fireEvents(Resource resource, String severity, - int numberOfEvents, String details) throws MalformedURLException, - SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - String operationName = "createEvents"; - int delay = 0; - int repeatInterval = 0; - int repeatCount = 0; - int timeout = 0; - // Configuration parameters = createParameters(resource, severity, - // numberOfEvents, details); - WsConfiguration parameters = createWsConfigurationParameters(resource, - severity, numberOfEvents, details); - String description = "Test script event for " + resource.name; - - return WEBSERVICE_REMOTE.scheduleResourceOperation(subject, - resource.id, operationName, delay, repeatInterval, repeatCount, - timeout, parameters, description); - } - - List<Event> waitForEventsToBeCommitted(int intervalLength, - int numberOfIntervals, EventCriteria eventCriteria, - int numberOfEvents) throws InterruptedException { - - List<Event> events = null; - for (int i = 0; i < numberOfIntervals; ++i) { - events = WEBSERVICE_REMOTE.findEventsByCriteria(subject, - eventCriteria); - java.lang.System.out.println("SIZE = " + events.size() - + ", NUM_EVENTS = " + numberOfEvents); - if (events.size() == numberOfEvents) { - return events; - } - java.lang.Thread.sleep(intervalLength); - } - return events; - - } - - public static WsConfiguration createWsConfigurationParameters( - Resource resource, String severity, int numberOfEvents, - String details) throws MalformedURLException, SecurityException, - IllegalArgumentException, ClassNotFoundException, - NoSuchMethodException, InstantiationException, - IllegalAccessException, InvocationTargetException, - LoginException_Exception { - init(); - WsConfiguration params = new WsConfiguration(); - PropertySimple prop1 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("source"); - prop1.setStringValue(resource.getName()); - PropertySimple prop2 = WS_OBJECT_FACTORY.createPropertySimple(); - prop2.setName("details"); - prop2.setStringValue(details); - PropertySimple prop3 = WS_OBJECT_FACTORY.createPropertySimple(); - prop3.setName("severity"); - prop3.setStringValue(severity); - PropertySimple prop4 = WS_OBJECT_FACTORY.createPropertySimple(); - prop4.setName("count"); - prop4.setStringValue(Integer.valueOf(numberOfEvents) + ""); - JaxbUtilities.addProperty(params, prop1); - JaxbUtilities.addProperty(params, prop2); - JaxbUtilities.addProperty(params, prop3); - JaxbUtilities.addProperty(params, prop4); - return params; - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java deleted file mode 100644 index 53b9c5f..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsConfigurationManagerTest.java +++ /dev/null @@ -1,378 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsConfigurationManagerTest extends AssertJUnit implements TestPropertiesInterface { - - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testConfigurationManager() { - // get config for JBossAS server - String desc = "JBoss Application Server"; - ResourceCriteria resourceCriteria = WS_OBJECT_FACTORY.createResourceCriteria(); - resourceCriteria.setFilterDescription(desc); - resourceCriteria.setFetchResourceConfiguration(true); - resourceCriteria.setFetchPluginConfiguration(true); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, resourceCriteria); - assertNotNull("Unable to locate JBoss AS instances reference.", resources); - assertTrue("Unable to find instances of JBoss AS.", resources.size() > 0); - - Resource resource = resources.get(0); - // Configuration configuration = WEBSERVICE_REMOTE - WsConfiguration configuration = WEBSERVICE_REMOTE - // JaxbConfiguration configuration = WEBSERVICE_REMOTE - .getResourceConfiguration(subject, resource.getId()); - assertNotNull("Configuration was not located.", configuration); - - // TODO: verify configuration details - - boolean isUpdating = WEBSERVICE_REMOTE.isResourceConfigurationUpdateInProgress(subject, resource.getId()); - assertFalse("Config should not be in process of modification.", isUpdating); - - // Get plugin configuration information - // Configuration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration( - WsConfiguration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration( - // JaxbConfiguration pluginConfig = - // WEBSERVICE_REMOTE.getPluginConfiguration( - subject, resource.getId()); - assertNotNull("Configuration was not located.", pluginConfig); - assertNotNull("The property definition map should not be null.", pluginConfig.getProperties()); - // pluginConfig.getPropertyListOrPropertySimpleOrPropertyMap()); - } - - Resource findResource(String name, String parentName) { - ResourceCriteria criteria = new ResourceCriteria(); - criteria.setFilterName(name); - criteria.setFilterParentResourceName(parentName); - - return WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria).get(0); - // WsResourceListWrapper ret = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - // ret. - } - - Resource findService(String name, String parentName) { - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName(name); - criteria.setFilterParentResourceName(parentName); - - return WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria).get(0); - } - - List<Resource> findBetaServices(String parentName) { - ResourceCriteria criteria = new ResourceCriteria(); - criteria.setFilterParentResourceName(parentName); - criteria.setFilterResourceTypeName("service-beta"); - criteria.caseSensitive = true; - criteria.strict = true; - - return WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - } - - private Property locateProperty(List<Property> properties, String name) { - Property located = null; - if ((properties != null) && (name != null) && (name.trim().length() > 0)) { - // List<Entry> list = properties.getEntry(); - for (int i = 0; (located == null) && i < properties.size(); i++) { - Property entry = properties.get(i); - if (entry.getName().equals(name)) { - located = entry; - } - } - - } - return located; - } - - private PropertySimple locatePropertySimple(List<PropertySimple> properties, String name) { - PropertySimple located = null; - if ((properties != null) && (name != null) && (name.trim().length() > 0)) { - // List<Entry> list = properties.getEntry(); - for (int i = 0; (located == null) && i < properties.size(); i++) { - PropertySimple entry = properties.get(i); - if (entry.getName().equals(name)) { - located = entry; - } - } - - } - return located; - } - - private PropertySimple getSimple(List<PropertySimple> list, String name) { - Property property = locatePropertySimple(list, name); - return (PropertySimple) property; - } - - private PropertySimple getSimpleConfig(List<Property> list, String name) { - Property property = locateProperty(list, name); - return (PropertySimple) property; - } - - @Test(enabled = TESTS_ENABLED) - void testUpdateResourceConfiguration() throws InterruptedException { - - Resource resource = findService("service-beta-1", "server-omega-1"); - // Configuration config = WEBSERVICE_REMOTE.getResourceConfiguration(subject, resource.id); - WsConfiguration config = WEBSERVICE_REMOTE.getResourceConfiguration(subject, resource.id); - - String propertyName = "beta-config0"; - String propertyValue = "updated property value -- " + new java.util.Date(); - - // property = config.getSimple(propertyName); - // PropertySimple property = getSimple(config.getPropertyListOrPropertySimpleOrPropertyMap(), propertyName); - PropertySimple property = getSimple(config.getPropertySimpleContainer(), propertyName); - - property.setStringValue(propertyValue); - // config.put(property); - // config.getPropertyListOrPropertySimpleOrPropertyMap().add(property); - config.getProperties().add(property); - config.getPropertySimpleContainer().add(property); - - ResourceConfigurationUpdate configUpdate = WEBSERVICE_REMOTE.updateResourceConfiguration(subject, resource.id, - config); - - while (WEBSERVICE_REMOTE.isResourceConfigurationUpdateInProgress(subject, resource.id)) { - java.lang.Thread.sleep(1000); - } - - config = WEBSERVICE_REMOTE.getResourceConfiguration(subject, resource.id); - // updatedProperty = config.getSimple(propertyName); - // PropertySimple updatedProperty = getSimple(config.getPropertyListOrPropertySimpleOrPropertyMap(), propertyName); - PropertySimple updatedProperty = getSimple(config.getPropertySimpleContainer(), propertyName); - - assertEquals("Failed to update resource configuration", updatedProperty.stringValue, propertyValue); - } - - private Configuration convert(WsConfiguration config) { - Configuration cfg = new Configuration(); - if (config != null) { - cfg.ctime = config.ctime; - cfg.id = config.id; - cfg.mtime = config.mtime; - cfg.notes = config.notes; - cfg.version = config.version; - cfg.propertyListOrPropertySimpleOrPropertyMap = new ArrayList<Property>(); - // for (Property p : config.properties) { - // cfg.propertyListOrPropertySimpleOrPropertyMap.add(p); - // } - if (config.propertySimpleContainer != null) { - for (PropertySimple p : config.propertySimpleContainer) { - cfg.propertyListOrPropertySimpleOrPropertyMap.add(p); - } - } - if (config.propertyListContainer != null) { - for (PropertyList p : config.propertyListContainer) { - cfg.propertyListOrPropertySimpleOrPropertyMap.add(p); - } - } - if (config.propertyMapContainer != null) { - for (PropertyMap p : config.propertyMapContainer) { - cfg.propertyListOrPropertySimpleOrPropertyMap.add(p); - } - } - - } else { - throw new IllegalArgumentException("WsConfiguration can not be null."); - } - return cfg; - } - - @Test(enabled = TESTS_ENABLED) - void testUpdatePluginConfiguration() { - - Resource resource = findService("service-beta-0", "server-omega-0"); - WsConfiguration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration(subject, resource.id); - // Configuration pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration(subject, resource.id); - - String propertyName = "beta-property0"; - String propertyValue = "updated property value -- " + new java.util.Date(); - - // property = pluginConfig.getSimple(propertyName); - // PropertySimple property = getSimple(pluginConfig.getPropertyListOrPropertySimpleOrPropertyMap(), propertyName); - // PropertySimple property = getSimple(pluginConfig.getProperties(), propertyName); - PropertySimple property = getSimple(pluginConfig.getPropertySimpleContainer(), propertyName); - - property.setStringValue(propertyValue); - pluginConfig.propertySimpleContainer.add(property); - pluginConfig.properties.add(property); - - PluginConfigurationUpdate configUpdate = WEBSERVICE_REMOTE.updatePluginConfiguration(subject, resource.id, - pluginConfig); - - pluginConfig = WEBSERVICE_REMOTE.getPluginConfiguration(subject, resource.id); - // updatedProperty = pluginConfig.getSimple(propertyName); - // PropertySimple updatedProperty = getSimple(pluginConfig.getPropertyListOrPropertySimpleOrPropertyMap(), - PropertySimple updatedProperty = getSimple(pluginConfig.getPropertySimpleContainer(), propertyName); - - assertEquals("Failed to update plugin configuration", updatedProperty.stringValue, propertyValue); - - } - - // This test is failing I think due to the asynchronous nature of the operations involved. I have verified through the - // web UI that the configuration updates are actually happening. I just need to figure out how to make the test wait - // so that it can (consistently) get the udpated values. - // - jsanda - @Test(enabled = TESTS_ENABLED) - void testUpdateResourceGroupConfiguration() { - String groupName = "service-beta-group -- " + new java.util.Date(); - ResourceGroup group = createResourceGroup(groupName); - - List<Resource> services = findBetaServices("server-omega-0"); - - assertEquals("Failed to find beta services", services.size(), 10); - - addServicesToGroup(services, group); - - List<Configuration> configs = loadConfigs(services); - - assertEquals("Failed to load all resource configurations", configs.size(), 10); - - String propertyName = "beta-config0"; - String propertyValue = "updated property value -- " + new java.util.Date(); - - updateResourceConfigs(configs, propertyValue); - - HashMap<Integer, Configuration> configMap = toMap(services, configs); - - // updateId = WEBSERVICE_REMOTE.scheduleGroupResourceConfigurationUpdate(group.id, configMap); - // - // while (WEBSERVICE_REMOTE.isGroupResourceConfigurationUpdateInProgress(updateId)) { - // java.lang.Thread.sleep(1000); - // } - // - // var updatedConfigs = loadConfigs(services); - // - // for (i in updatedConfigs) { - // var updatedProperty = updatedConfigs[i].getSimple(propertyName); - // - // Assert.assertEquals(updatedProperty.stringValue, propertyValue, "Failed to update resource group configuration"); - // } - } - - ResourceGroup createResourceGroup(String name) { - ResourceType resourceType = getResourceType("service-beta"); - assertNotNull("Failed to find resource type for new resource group.", resourceType); - - // return WEBSERVICE_REMOTE.createResourceGroup(ResourceGroup(name, resourceType)); - ResourceGroup rg = new ResourceGroup(); - rg.setName(name); - rg.setResourceType(resourceType); - WsResourceGroupWrapper wsRg = WS_OBJECT_FACTORY.createWsResourceGroupWrapper(); - wsRg.setName(name); - wsRg.setResourceType(resourceType); - ResourceGroup resGroup = WEBSERVICE_REMOTE.createResourceGroup(subject, wsRg); - return resGroup; - } - - void addServicesToGroup(List<Resource> services, ResourceGroup group) { - // var serviceIds = []; - List<Integer> serviceIds = new ArrayList<Integer>(); - - for (Resource resource : services) { - serviceIds.add(resource.getId()); - } - - WEBSERVICE_REMOTE.addResourcesToGroup(subject, group.id, serviceIds); - } - - ResourceType getResourceType(String resourceTypeName) { - String pluginName = "PerfTest"; - - return WEBSERVICE_REMOTE.getResourceTypeByNameAndPlugin(subject, resourceTypeName, pluginName); - } - - List<Configuration> loadConfigs(List<Resource> resources) { - List<Configuration> configs = new ArrayList<Configuration>(); - - for (Resource resource : resources) { - // configs.add(WEBSERVICE_REMOTE.getResourceConfiguration(subject, resource.id)); - WsConfiguration wsCfg = WEBSERVICE_REMOTE.getResourceConfiguration(subject, resource.id); - Configuration cfg = convert(wsCfg); - configs.add(cfg); - } - - return configs; - } - - void updateResourceConfigs(List<Configuration> configs, String propertyValue) { - String propertyName = "beta-config0"; - PropertySimple property = null; - - for (Configuration config : configs) { - // property = configs[i].getSimple(propertyName); - // property = locateProperty(config.getPropertyListOrPropertySimpleOrPropertyMap(), propertyName); - // config.propertyListOrPropertySimpleOrP - // property = getSimple(config.getPropertyListOrPropertySimpleOrPropertyMap(), propertyName); - property = getSimpleConfig(config.propertyListOrPropertySimpleOrPropertyMap, propertyName); - // property.stringValue = propertyValue; - assertNotNull("Retrieved property should not be null.", property); - property.stringValue = propertyValue; - // configs[i].put(property); - config.getPropertyListOrPropertySimpleOrPropertyMap().add(property); - } - } - - HashMap<Integer, Configuration> toMap(List<Resource> services, List<Configuration> configs) { - HashMap<Integer, Configuration> map = new java.util.HashMap<Integer, Configuration>(); - - // for (i = 0; i < services.size(); ++i) { - // map.put(java.lang.Integer(services.get(i).id), configs[i]); - // } - for (int i = 0; i < services.size(); ++i) { - map.put(services.get(i).id, configs.get(i)); - } - - return map; - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsDataAccessManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsDataAccessManagerTest.java deleted file mode 100644 index 38f0833..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsDataAccessManagerTest.java +++ /dev/null @@ -1,97 +0,0 @@ -//package org.rhq.enterprise.server.ws; -// -//import java.lang.reflect.InvocationTargetException; -//import java.net.MalformedURLException; -//import java.net.URL; -//import java.util.List; -// -//import javax.xml.namespace.QName; -// -//import org.testng.AssertJUnit; -//import org.testng.annotations.BeforeClass; -//import org.testng.annotations.Test; -// -//import org.rhq.enterprise.server.ws.utility.WsUtility; -// -///** -// * These tests can not be executed in our standard unit test fashion as they -// * require a running RHQ Server with our web services deployed. -// * -// * This is still in development and has the current restrictions: - add -// * [dev_root -// * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices -// * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need -// * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage -// * of type substitution correctly) - Server running on localhost. - ws-test user -// * defined in database with full permissions - Non RHQ Server JBossAS in -// * inventory. - The -Ptest-ws profile specified when running mvn test from -// * webservices dir - Perftest plugin installed and agent started as described in -// * modules/enterprise/remoting/scripts/README.txt -// * -// * @author Jay Shaughnessy, Simeon Pinder -// */ -//@Test(groups = "ws") -//public class WsDataAccessManagerTest extends AssertJUnit implements TestPropertiesInterface { -// -// // Test variables -// private static ObjectFactory WS_OBJECT_FACTORY; -// private static WebservicesRemote WEBSERVICE_REMOTE; -// private static Subject subject = null; -// -// @BeforeClass -// public void init() throws ClassNotFoundException, MalformedURLException, SecurityException, NoSuchMethodException, -// IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, -// LoginException_Exception { -// -// // build reference variable bits -// URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); -// QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); -// WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); -// -// WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); -// WS_OBJECT_FACTORY = new ObjectFactory(); -// WsSubjectTest.checkForWsTestUserAndRole(); -// subject = WEBSERVICE_REMOTE.login(credentials, credentials); -// } -// -// String query = "SELECT r " + "FROM Resource r " -// + "WHERE ( r.inventoryStatus = org.rhq.core.domain.resource.InventoryStatus.COMMITTED " -// + "AND LOWER( r.resourceType.name ) like 'service-alpha' " -// + "AND LOWER( r.parentResource.name ) like 'server-omega-0')"; -// -// @Test(enabled = TESTS_ENABLED) -// void testExecuteQuery() throws LoginException_Exception { -// Subject admin = WEBSERVICE_REMOTE.login("rhqadmin", "rhqadmin"); -// List<AnyTypeArray> resources = WEBSERVICE_REMOTE.executeQuery(admin, query); -// -// assertEquals("Expected to get back 10 resources", resources.size(), 10); -// } -// -// @Test(enabled = TESTS_ENABLED) -// void testExecuteQueryWithPaging() throws LoginException_Exception { -// PageControl pageControl = new PageControl(); -// pageControl.pageNumber = 0; -// pageControl.pageSize = 5; -// // pageControl.setPrimarySort("name", PageOrdering.ASC); -// pageControl.setPrimarySortOrder(PageOrdering.ASC); -// -// Subject admin = WEBSERVICE_REMOTE.login("rhqadmin", "rhqadmin"); -// List<AnyTypeArray> resources = WEBSERVICE_REMOTE.executeQueryWithPageControl(admin, query, pageControl); -// -// assertEquals("Failed to fetch first page of resources", resources.size(), 5); -// assertNotNull("Query result was null.", resources.get(0)); -// -// assertEquals("Failed to fetch first page of resources", resources.size(), 5); -// -// // assertEquals("service-alpha-0", "Failed to sort first page in ascending order", resources.get(0).name); -// // assertEquals("Failed to sort first page in ascending order", resources.get(4).name, "service-alpha-4"); -// // -// // pageControl.pageNumber = 1; -// // resources = WEBSERVICE_REMOTE.executeQueryWithPageControl(subject, query, pageControl); -// // -// // assertEquals("Failed to fetch second page of resources", resources.size(), 5); -// // assertEquals(resources.get(0).name, "service-alpha-5", "Failed to sort second page in ascending order"); -// // assertEquals(resources.get(4).name, "service-alpha-9", "Failed to sort second page in ascending order"); -// -// } -//} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsEventManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsEventManagerTest.java deleted file mode 100644 index e386279..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsEventManagerTest.java +++ /dev/null @@ -1,294 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsEventManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public static void init() throws ClassNotFoundException, - MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, - IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - static String alphaService0Details; - static String alphaService1Details; - static String betaService0Details; - static ResourceOperationSchedule operationSchedule; - static Resource alphaService0; - static Resource alphaService1; - static Resource betaService0; - - @BeforeClass - static void setUp() throws MalformedURLException, SecurityException, - IllegalArgumentException, ClassNotFoundException, - NoSuchMethodException, InstantiationException, - IllegalAccessException, InvocationTargetException, - LoginException_Exception { - init(); - Resource parentServer = findServer("server-omega-0"); - alphaService0 = findService("service-alpha-0", parentServer); - alphaService1 = findService("service-alpha-1", parentServer); - betaService0 = findService("service-beta-0", parentServer); - - alphaService0Details = new java.util.Date() + " >> events created for " - + alphaService0.name; - alphaService1Details = new java.util.Date() + " >> events created for " - + alphaService1.name; - betaService0Details = new java.util.Date() + " >> events created for " - + betaService0.name; - - operationSchedule = fireEvent(alphaService0, "WARN", 1, - alphaService0Details); - fireEvent(alphaService1, "ERROR", 1, alphaService1Details); - fireEvent(betaService0, "FATAL", 1, betaService0Details); - } - - @Test(enabled = TESTS_ENABLED) - void testFilterByResource() throws InterruptedException, JAXBException, - MalformedURLException, SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - EventCriteria criteria = WS_OBJECT_FACTORY.createEventCriteria(); - criteria.caseSensitive = true; - // criteria.addFilterResourceId(alphaService0.id); - // criteria.addFilterSeverity(EventSeverity.WARN); - criteria.setFilterDetail(alphaService0Details); - // criteria.addFilterSourceName(alphaService0.name); - criteria.setFilterSourceName("service-alpha-event"); - - ResourceOperationHistory result = waitForScheduledOperationToComplete(operationSchedule); - - assertNotNull("Failed to get result for scheduled operation", result); - - java.lang.Thread.sleep(30000); - - List<Event> events = WEBSERVICE_REMOTE.findEventsByCriteria(subject, - criteria); - // var events = findEventsByResource(alphaService0); - - assertEquals("Event count not correct.", 1, events.size()); - - events = findEventsByResource(alphaService1); - assertTrue("Expected to find events when filtering by resource id for " - + alphaService1, events.size() > 0); - - events = findEventsByResource(betaService0); - assertTrue("Expected to find events when filtering by resource id for " - + betaService0, events.size() > 0); - } - - static Resource findServer(String name) { - // if (WS_OBJECT_FACTORY == null) { - // setUp(); - // } - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName(name); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria( - subject, criteria); - - assertEquals("Expected to find only one resource named " + name + "'", - resources.size(), 1); - - return resources.get(0); - } - - static Resource findService(String name, Resource parentServer) { - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName(name); - criteria.setFilterParentResourceId(parentServer.id); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria( - subject, criteria); - - assertEquals("Expected to find only one service named '" + name - + "' having parent, '" + parentServer.name + "'", 1, resources - .size()); - - return resources.get(0); - } - - static ResourceOperationSchedule fireEvent(Resource resource, - String severity, int numberOfEvents, String details) - throws MalformedURLException, SecurityException, - IllegalArgumentException, ClassNotFoundException, - NoSuchMethodException, InstantiationException, - IllegalAccessException, InvocationTargetException, - LoginException_Exception { - String operationName = "createEvents"; - int delay = 0; - int repeatInterval = 0; - int repeatCount = 0; - int timeout = 0; - // Configuration parameters = createParameters(resource, severity, - // numberOfEvents, details); - WsConfiguration parameters = WsAlertManagerTest - .createWsConfigurationParameters(resource, severity, - numberOfEvents, details); - String description = "Test script event for " + resource.name; - - return WEBSERVICE_REMOTE.scheduleResourceOperation(subject, - resource.id, operationName, delay, repeatInterval, repeatCount, - timeout, parameters, description); - } - - static Configuration createParameters(Resource resource, String severity, - int numberOfEvents, String details) { - Configuration params = WS_OBJECT_FACTORY.createConfiguration(); - PropertySimple prop1 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("source"); - prop1.setStringValue(resource.getName()); - // params.put(WS_OBJECT_FACTORY.createPropertySimple("source", - // resource.name)); - // params.put(new PropertySimple("details", details)); - PropertySimple prop2 = WS_OBJECT_FACTORY.createPropertySimple(); - prop2.setName("details"); - prop2.setStringValue(details); - // params.put(new PropertySimple("severity", severity)); - PropertySimple prop3 = WS_OBJECT_FACTORY.createPropertySimple(); - prop3.setName("severity"); - prop3.setStringValue(severity); - // params.put(new PropertySimple("count", - // java.lang.Integer(numberOfEvents))); - PropertySimple prop4 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("count"); - prop4.setStringValue(Integer.valueOf(numberOfEvents).toString()); - - params.getPropertyListOrPropertySimpleOrPropertyMap().add(prop1); - params.getPropertyListOrPropertySimpleOrPropertyMap().add(prop2); - params.getPropertyListOrPropertySimpleOrPropertyMap().add(prop3); - params.getPropertyListOrPropertySimpleOrPropertyMap().add(prop4); - - return params; - } - - List<Event> findEventsByResource(Resource resource) { - EventCriteria criteria = WS_OBJECT_FACTORY.createEventCriteria(); - criteria.setFilterResourceId(resource.id); - - return WEBSERVICE_REMOTE.findEventsByCriteria(subject, criteria); - } - - public static ResourceOperationHistory waitForScheduledOperationToComplete( - ResourceOperationSchedule schedule) throws InterruptedException, - MalformedURLException, SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - return waitForScheduledOperationToComplete(schedule, 1000L, 10); - } - - public static ResourceOperationHistory waitForScheduledOperationToComplete( - ResourceOperationSchedule schedule, long intervalDuration, - int maxIntervals) throws InterruptedException, - MalformedURLException, SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - // ResourceOperationHistoryCriteria criteria = new - // ResourceOperationHistoryCriteria(); - if (WS_OBJECT_FACTORY == null) { - init(); - } - ResourceOperationHistoryCriteria criteria = WS_OBJECT_FACTORY - .createResourceOperationHistoryCriteria(); - // TODO: doc below on wiki - // criteria.setFilt - // criteria.addFilterJobId(schedule.getJobId()); - // ### same as setting jobId and Job Group - // criteria.addFilterJobId(schedule.getJobId()); - criteria.setFilterJobGroup(schedule.getJobGroup()); - criteria.setFilterJobName(schedule.getJobName()); - // ###?? criteria.addFilterResourceIds(schedule.getResource().getId()); - ArrayList<Integer> filterResIds = new ArrayList<Integer>(); - filterResIds.add(schedule.getResource().getId()); - // TODO: doc below for wiki - criteria.filterResourceIds = filterResIds; - criteria.setSortStartTime(PageOrdering.DESC); - // TODO: doc below for wiki. - // criteria.setPaging(0, 1); AKA. setPageNumber and setPageSize in that - // order - criteria.setPageNumber(0); - criteria.setPageSize(1); - criteria.setFetchOperationDefinition(true); - criteria.setFetchParameters(true); - criteria.setFetchResults(true); - - ResourceOperationHistory history = null; - - int i = 0; - - while (history == null && i < maxIntervals) { - Thread.sleep(intervalDuration); - List<ResourceOperationHistory> histories = WEBSERVICE_REMOTE - .findResourceOperationHistoriesByCriteria(subject, criteria); - if (histories.size() > 0 - && histories.get(0).getStatus() != OperationRequestStatus.INPROGRESS) { - history = histories.get(0); - } - ++i; - } - - return history; - } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementDefinitionManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementDefinitionManagerTest.java deleted file mode 100644 index 9712718..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementDefinitionManagerTest.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsMeasurementDefinitionManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, - SecurityException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFiltering() { - ResourceType resourceType = findResourceType(); - - MeasurementDefinitionCriteria criteria = new MeasurementDefinitionCriteria(); - criteria.setFilterName("alpha-metric0"); - criteria.setFilterDisplayName("Alpha Metric 0"); - criteria.setFilterDescription("Alpha Metric 0"); - criteria.setFilterResourceTypeName(resourceType.name); - criteria.setFilterResourceTypeId(resourceType.id); - criteria.setFilterCategory(MeasurementCategory.PERFORMANCE); - criteria.setFilterNumericType(NumericType.DYNAMIC); - criteria.setFilterDataType(DataType.MEASUREMENT); - criteria.setFilterDisplayType(DisplayType.DETAIL); - criteria.setFilterDefaultOn(false); - // criteria.setFilterDefaultInterval(1200000); - criteria.setFilterDefaultInterval(1200000L); - - List<MeasurementDefinition> measurementDefs = WEBSERVICE_REMOTE - .findMeasurementDefinitionsByCriteria(subject, criteria); - - assertEquals("Failed to find measurement definition when filtering", - measurementDefs.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithSorting() { - MeasurementDefinitionCriteria criteria = new MeasurementDefinitionCriteria(); - criteria.setFilterResourceTypeName("service-alpha"); - criteria.setSortName(PageOrdering.ASC); - criteria.setSortDisplayName(PageOrdering.DESC); - criteria.setSortResourceTypeName(PageOrdering.ASC); - criteria.setSortCategory(PageOrdering.DESC); - criteria.setSortUnits(PageOrdering.ASC); - criteria.setSortNumericType(PageOrdering.DESC); - criteria.setSortDataType(PageOrdering.ASC); - criteria.setSortDisplayType(PageOrdering.DESC); - criteria.setSortDefaultOn(PageOrdering.ASC); - criteria.setSortDefaultInterval(PageOrdering.DESC); - - List<MeasurementDefinition> measurementDefs = WEBSERVICE_REMOTE - .findMeasurementDefinitionsByCriteria(subject, criteria); - - assertTrue("Failed to find measurement definitions when sorting", - measurementDefs.size() > 0); - } - - ResourceType findResourceType() { - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.setFilterName("service-alpha"); - criteria.setFilterPluginName("PerfTest"); - - return WEBSERVICE_REMOTE.findResourceTypesByCriteria(subject, criteria) - .get(0); - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementScheduleManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementScheduleManagerTest.java deleted file mode 100644 index 4e55778..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsMeasurementScheduleManagerTest.java +++ /dev/null @@ -1,144 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.ListIterator; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsMeasurementScheduleManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, - SecurityException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFiltering() { - MeasurementDefinition measurementDef = findMeasurementDefinition(); - Resource resource = findAlphaService(); - - MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria(); - // criteria.addFilterDefinitionIds([measurementDef.id]); - List<Integer> filterDefinitionIds = new ArrayList<Integer>(); - filterDefinitionIds.add(measurementDef.getId()); - criteria.filterDefinitionIds = filterDefinitionIds; - - criteria.setFilterResourceId(resource.id); - - List<MeasurementSchedule> measurementSchedules = WEBSERVICE_REMOTE - .findSchedulesByCriteria(subject, criteria); - - assertEquals("Failed to find measurement schedules when filtering", - measurementSchedules.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFetchingAssociations() { - MeasurementDefinition measurementDef = findMeasurementDefinition(); - Resource resource = findAlphaService(); - - MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria(); - // criteria.addFilterDefinitionIds([measurementDef.id]) - List<Integer> filterDefinitionIds = new ArrayList<Integer>(); - filterDefinitionIds.add(measurementDef.getId()); - criteria.filterDefinitionIds = filterDefinitionIds; - - criteria.setFilterResourceId(resource.id); - criteria.setFetchBaseline(true); - criteria.setFetchDefinition(true); - criteria.setFetchResource(true); - - List<MeasurementSchedule> measurementSchedules = WEBSERVICE_REMOTE - .findSchedulesByCriteria(subject, criteria); - - assertEquals( - "Failed to find measurement schedules when fetching associations", - measurementSchedules.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithSorting() { - MeasurementDefinition measurementDef = findMeasurementDefinition(); - Resource resource = findAlphaService(); - - MeasurementScheduleCriteria criteria = new MeasurementScheduleCriteria(); - criteria.setSortName(PageOrdering.ASC); - - List<MeasurementSchedule> measurementSchedules = WEBSERVICE_REMOTE - .findSchedulesByCriteria(subject, criteria); - - assertTrue("Failed to find measurement schedules when sorting", - measurementSchedules.size() > 0); - } - - MeasurementDefinition findMeasurementDefinition() { - MeasurementDefinitionCriteria criteria = new MeasurementDefinitionCriteria(); - criteria.setFilterName("alpha-metric0"); - criteria.setFilterResourceTypeName("service-alpha"); - - List<MeasurementDefinition> measurementDefs = WEBSERVICE_REMOTE - .findMeasurementDefinitionsByCriteria(subject, criteria); - - return measurementDefs.get(0); - } - - Resource findAlphaService() { - ResourceCriteria criteria = new ResourceCriteria(); - criteria.setFilterName("service-alpha-0"); - criteria.setFilterParentResourceName("server-omega-0"); - - return WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria) - .get(0); - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsOperationManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsOperationManagerTest.java deleted file mode 100644 index 71cb120..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsOperationManagerTest.java +++ /dev/null @@ -1,323 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsOperationManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, - SecurityException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testFindOperationDefinitionsUnfiltered() { - OperationDefinitionCriteria opDefCrit = WS_OBJECT_FACTORY - .createOperationDefinitionCriteria(); - List<OperationDefinition> operationDefinitions = WEBSERVICE_REMOTE - .findOperationDefinitionsByCriteria(subject, opDefCrit); - - assertNotNull( - "Expected non-null results for criteria search of operation definitions", - operationDefinitions); - } - - @Test(enabled = TESTS_ENABLED) - void testFindSingleOperationDefinitionsWithFiltering() { - OperationDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createOperationDefinitionCriteria(); - criteria.strict = true; - criteria.setFilterName("start"); - criteria.setFilterDisplayName("Start"); - criteria - .setFilterDescription("Start this application server. The script used is specified in the Operations group of connection properties."); - criteria.setFilterPluginName("JBossAS"); - criteria.setFilterResourceTypeName("JBossAS Server"); - - List<OperationDefinition> opDefinitions = WEBSERVICE_REMOTE - .findOperationDefinitionsByCriteria(subject, criteria); - - assertEquals("Expected to get back a single operation definition that " - + "corresponds to the Start operation but got back, '" - + getNames(opDefinitions) + "'", opDefinitions.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindOperationDefinitionsWithOptionalFiltering() { - OperationDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createOperationDefinitionCriteria(); - criteria.filtersOptional = true; - - criteria.setFilterDisplayName("Start"); - criteria.setFilterDescription("_non-existent description_"); - criteria.setFilterPluginName("JBossAS"); - criteria.setFilterResourceTypeName("JBossAS Server"); - - List<OperationDefinition> opDefinitions = WEBSERVICE_REMOTE - .findOperationDefinitionsByCriteria(subject, criteria); - - assertTrue( - "Expected non-empty result list for criteria search with optional " - + "filters for operation definitions", opDefinitions - .size() > 0); - } - - @Test(enabled = TESTS_ENABLED) - void testFindSingleOperationDefinitionWithFilteringAndFetchingAssociations() { - OperationDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createOperationDefinitionCriteria(); - criteria.strict = true; - criteria.setFilterPluginName("JBossAS"); - criteria.setFilterName("start"); - criteria.setFilterDisplayName("Start"); - criteria.setFilterResourceTypeName("JBossAS Server"); - criteria.setFetchParametersConfigurationDefinition(true); - criteria.setFetchParametersConfigurationDefinition(true); - - List<OperationDefinition> opDefinitions = WEBSERVICE_REMOTE - .findOperationDefinitionsByCriteria(subject, criteria); - - assertEquals("Expected to get back one operation definition when " - + "filtering and fetching associations but got back, '" - + getNames(opDefinitions) + "'", opDefinitions.size(), 1); - - OperationDefinition opDefinition = opDefinitions.get(0); - } - - @Test(enabled = TESTS_ENABLED) - void testFindMultipleOperationDefinitionsWithFilteringAndFetchingAssociations() { - OperationDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createOperationDefinitionCriteria(); - criteria.strict = true; - criteria.setFilterPluginName("JBossAS"); - criteria.setFilterResourceTypeName("JBossAS Server"); - criteria.setFetchParametersConfigurationDefinition(true); - criteria.setFetchParametersConfigurationDefinition(true); - - List<OperationDefinition> opDefinitions = WEBSERVICE_REMOTE - .findOperationDefinitionsByCriteria(subject, criteria); - - assertEquals("Expected to get back three operation definitions when " - + "filtering and fetching associations but got back, '" - + getNames(opDefinitions) + "'", opDefinitions.size(), 3); - } - - @Test(enabled = TESTS_ENABLED) - void testFindMultipleOperationDefinitionsWithSorting() { - OperationDefinitionCriteria criteria = WS_OBJECT_FACTORY - .createOperationDefinitionCriteria(); - criteria.setFilterPluginName("JBossAS"); - criteria.setFilterResourceTypeName("JBossAS Server"); - criteria.setFetchParametersConfigurationDefinition(true); - criteria.setFetchResultsConfigurationDefinition(true); - criteria.setSortName(PageOrdering.DESC); - - List<OperationDefinition> opDefinitions = WEBSERVICE_REMOTE - .findOperationDefinitionsByCriteria(subject, criteria); - - assertTrue("Expected to get back operation definitions when sorting", - opDefinitions.size() > 0); - - // TODO verify sorting - } - - @Test(enabled = TESTS_ENABLED) - void testFindResourceOperationHistoriesUnfiltered() { - ResourceOperationHistoryCriteria resOpHisCrit = WS_OBJECT_FACTORY - .createResourceOperationHistoryCriteria(); - List<ResourceOperationHistory> histories = WEBSERVICE_REMOTE - .findResourceOperationHistoriesByCriteria(subject, resOpHisCrit); - - assertNotNull( - "Expected non-null results for criteria search of resource operation histories", - histories); - } - - @Test(enabled = TESTS_ENABLED) - void testFindResourceOperationHistoriesWithFiltering() - throws InterruptedException, MalformedURLException, - SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - Resource serviceAlpha = findResource("service-alpha-0", - "server-omega-0"); - Resource serviceBeta = findResource("service-beta-0", "server-omega-0"); - - assertNotNull("Failed to find service-alpha-0", serviceAlpha); - assertNotNull("Failed to find service-beta-0", serviceBeta); - - int numberOfEvents = 3; - - ResourceOperationSchedule serviceAlphaOperationSchedule = fireEvents( - serviceAlpha, "WARN", numberOfEvents); - ResourceOperationSchedule serviceBetaOperationSchedule = fireEvents( - serviceBeta, "DEBUG", numberOfEvents); - - ResourceOperationHistory serviceAlphaOpHistory = WsEventManagerTest - .waitForScheduledOperationToComplete(serviceAlphaOperationSchedule); - - assertNotNull("Expected to get back operation history for '" - + serviceAlphaOperationSchedule.operationDisplayName + "'", - serviceAlphaOpHistory); - - ResourceOperationHistory serviceBetaOpHistory = WsEventManagerTest - .waitForScheduledOperationToComplete(serviceBetaOperationSchedule); - - ResourceOperationHistoryCriteria criteria = WS_OBJECT_FACTORY - .createResourceOperationHistoryCriteria(); - criteria.setFilterOperationName("createEvents"); - - List<ResourceOperationHistory> histories = WEBSERVICE_REMOTE - .findResourceOperationHistoriesByCriteria(subject, criteria); - - assertTrue( - "Expected to find at least two resource operation histories for the " - + "createEvents operations that were executed for service-alpha-0 and for service-beta-0", - histories.size() > 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindGroupOperationHistoriesUnfiltered() { - List<GroupOperationHistory> histories = WEBSERVICE_REMOTE - .findGroupOperationHistoriesByCriteria(subject, - WS_OBJECT_FACTORY.createGroupOperationHistoryCriteria()); - - assertNotNull( - "Expected non-null results for criteria search of group operation histories", - histories); - } - - String[] getNames(List<OperationDefinition> list) { - String[] names = new String[list.size()]; - for (int i = 0; i < list.size(); ++i) { - names[i] = (list.get(i).getName()); - } - return names; - } - - Resource findResource(String name, String parentName) { - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName(name); - criteria.setFilterParentResourceName(parentName); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria( - subject, criteria); - - assertEquals("Expected to find only one '" + name - + "' having parent, '" + parentName + "'", 1, resources.size()); - - return resources.get(0); - } - - ResourceOperationSchedule fireEvents(Resource resource, String severity, - int numberOfEvents) throws MalformedURLException, - SecurityException, IllegalArgumentException, - ClassNotFoundException, NoSuchMethodException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - // SimpleDateFormat sdf = new SimpleDateFormat(); - String details = new java.util.Date() + " >> events created for " - + resource.name; - String operationName = "createEvents"; - int delay = 0; - int repeatInterval = 0; - int repeatCount = 0; - int timeout = 0; - // Configuration parameters = createParameters(resource, severity, - // numberOfEvents, details); - WsConfiguration parameters = WsAlertManagerTest - .createWsConfigurationParameters(resource, severity, - numberOfEvents, details); - - String description = "Test script event for " + resource.name; - - return WEBSERVICE_REMOTE.scheduleResourceOperation(subject, - resource.id, operationName, delay, repeatInterval, repeatCount, - timeout, parameters, description); - } - - Configuration createParameters(Resource resource, String severity, - int numberOfEvents, String details) { - Configuration params = WS_OBJECT_FACTORY.createConfiguration(); - // params.propertyListOrPropertySimpleOrPropertyMap. - PropertySimple prop1 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("source"); - prop1.setStringValue(resource.getName()); - // params.put(WS_OBJECT_FACTORY.createPropertySimple("source", - // resource.name)); - // params.put(new PropertySimple("details", details)); - PropertySimple prop2 = WS_OBJECT_FACTORY.createPropertySimple(); - prop2.setName("details"); - prop2.setStringValue(details); - // params.put(new PropertySimple("severity", severity)); - PropertySimple prop3 = WS_OBJECT_FACTORY.createPropertySimple(); - prop3.setName("severity"); - prop3.setStringValue(severity); - // params.put(new PropertySimple("count", - // java.lang.Integer(numberOfEvents))); - PropertySimple prop4 = WS_OBJECT_FACTORY.createPropertySimple(); - prop1.setName("count"); - prop4.setStringValue(Integer.valueOf(numberOfEvents).toString()); - - params.propertyListOrPropertySimpleOrPropertyMap = new ArrayList<Property>(); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop1); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop2); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop3); - params.propertyListOrPropertySimpleOrPropertyMap.add(prop4); - - return params; - } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRepoManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRepoManagerTest.java deleted file mode 100644 index b94e422..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRepoManagerTest.java +++ /dev/null @@ -1,577 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.Assert; -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.ConfigurationDefinition.PropertyDefinitions; -import org.rhq.enterprise.server.ws.ConfigurationDefinition.PropertyDefinitions.Entry; -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - * <ul> - * <li>add [dev_root]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices-{version}.jar to TOP of - * eclipse classpath to run from your IDE(actually need to use classpath setup from bin/jbossas/bin/wsrunclient.sh to - * take advantage of type substitution correctly)</li> - * <li>Server running on localhost</li> - * <li>ws-test user defined in database with full permissions</li> - * <li>Non RHQ Server JBossAS in inventory</li> - * <li>The -Ptest-ws profile specified when running mvn test from webservices dir</li> - * <li>Perftest plugin installed and agent started as described in modules/enterprise/remoting/scripts/README.txt</li> - * </ul> - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsRepoManagerTest extends AssertJUnit implements TestPropertiesInterface { - - private static final boolean TESTS_ENABLED = true; - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - private static PageControl pc_unlimited = null; - // In some cases testing is run outside of mvn project tree. following needs - // to be set to location of correct .war Ex. - // [jon_root]/modules/enterprise/remoting/scripts/src/test/resources - private static String HARDCODED_WAR_DIRECTORY = "/home/spinder/workspace/remoting/modules/enterprise/remoting/scripts/src/test/resources"; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - // create unlimited pageControl instance - pc_unlimited = WS_OBJECT_FACTORY.createPageControl(); - pc_unlimited.setPageNumber(0); - pc_unlimited.setPageSize(-1); - } - - @Test(enabled = TESTS_ENABLED) - void testCRUD() throws RepoException_Exception { - if (!TESTS_ENABLED) { - return; - } - - // delete any existing test channels in the db - List<Repo> channels = WEBSERVICE_REMOTE.findRepos(subject, pc_unlimited); - for (int i = 0; (i < channels.size()); ++i) { - Repo channel = channels.get(i); - if (channel.getName().startsWith("test-channel-")) { - WEBSERVICE_REMOTE.deleteRepo(subject, channel.getId()); - } - } - - // ensure test channel does not exist - RepoCriteria criteria = new RepoCriteria(); - criteria.caseSensitive = true; - criteria.setFilterName("test-channel-0"); - - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertTrue("test channel should not exist.", channels.size() == 0); - - // create a test channel - // newRepo = new Repo("test-channel-0"); - Repo newRepo = WS_OBJECT_FACTORY.createRepo(); - newRepo.setName("test-channel-0"); - newRepo.setDescription("description-0"); - Repo testRepo = WEBSERVICE_REMOTE.createRepo(subject, newRepo); - assertNotNull("test channel should exist.", testRepo); - assertEquals("test-channel-0", testRepo.getName()); - - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertTrue("test channel should exist.", channels.size() == 1); - - // test getter - testRepo = WEBSERVICE_REMOTE.getRepo(subject, 8888888); - assertNull("bogus channel should not exist.", testRepo); - testRepo = WEBSERVICE_REMOTE.getRepo(subject, channels.get(0).getId()); - assertNotNull("test channel should exist.", testRepo); - assertEquals("test-channel-0", testRepo.getName()); - assertEquals("description-0", testRepo.getDescription()); - - // test update - testRepo.setDescription("description-1"); - testRepo = WEBSERVICE_REMOTE.updateRepo(subject, testRepo); - assertEquals("description-1", testRepo.getDescription()); - testRepo = WEBSERVICE_REMOTE.getRepo(subject, testRepo.getId()); - assertNotNull("test channel should exist.", testRepo); - assertEquals("test-channel-0", testRepo.getName()); - assertEquals("description-1", testRepo.getDescription()); - - // test delete - WEBSERVICE_REMOTE.deleteRepo(subject, testRepo.getId()); - testRepo = WEBSERVICE_REMOTE.getRepo(subject, testRepo.getId()); - assertNull("channel should not exist.", testRepo); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertTrue("test channel should not exist.", channels.size() == 0); - } - - @Test(enabled = TESTS_ENABLED) - void testFindByCriteria() throws RepoException_Exception { - if (!TESTS_ENABLED) { - return; - } - - // delete any existing test channels in the db - List<Repo> channels = WEBSERVICE_REMOTE.findRepos(subject, pc_unlimited); - int numRealRepos = channels.size(); - Repo channel; - for (int i = 0; (i < channels.size()); ++i) { - channel = channels.get(i); - if (channel.getName().startsWith("test-channel-")) { - WEBSERVICE_REMOTE.deleteRepo(subject, channel.getId()); - --numRealRepos; - } - } - - Repo newRepo = WS_OBJECT_FACTORY.createRepo(); - newRepo.setName("test-channel-xxx"); - newRepo.setDescription("description-0"); - Repo testRepo = WEBSERVICE_REMOTE.createRepo(subject, newRepo); - - newRepo = WS_OBJECT_FACTORY.createRepo(); - newRepo.setName("test-channel-yyy"); - newRepo.setDescription("description-1"); - testRepo = WEBSERVICE_REMOTE.createRepo(subject, newRepo); - - newRepo = WS_OBJECT_FACTORY.createRepo(); - newRepo.setName("test-channel-xyz"); - newRepo.setDescription("description-2"); - testRepo = WEBSERVICE_REMOTE.createRepo(subject, newRepo); - - RepoCriteria criteria = new RepoCriteria(); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("empty criteria failed.", channels.size(), numRealRepos + 3); - - criteria.caseSensitive = true; - criteria.strict = true; - - criteria.setFilterName("test-channel-xyz"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name criteria failed.", channels.size(), 1); - - criteria.setFilterName("TEST-channel-xyz"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name criteria failed.", channels.size(), 0); - - criteria.caseSensitive = false; - criteria.strict = true; - - criteria.setFilterName("TEST-channel-xyz"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name criteria failed.", channels.size(), 1); - - criteria.caseSensitive = true; - criteria.strict = false; - - criteria.setFilterName("XXX"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name criteria failed.", channels.size(), 0); - - criteria.caseSensitive = false; - criteria.strict = false; - - criteria.setFilterName("XXX"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name criteria failed.", channels.size(), 1); - - criteria.setFilterName("test-channel-"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name criteria failed.", channels.size(), 3); - - criteria.setFilterName("-x"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name criteria failed.", channels.size(), 2); - - criteria.setFilterDescription("-2"); - channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteria); - assertEquals("CS/Strict name/descrip criteria failed.", channels.size(), 1); - - // delete any existing test channels in the db - channels = WEBSERVICE_REMOTE.findRepos(subject, pc_unlimited); - for (int i = 0; (i < channels.size()); ++i) { - channel = channels.get(i); - if (channel.getName().startsWith("test-channel-")) { - WEBSERVICE_REMOTE.deleteRepo(subject, channel.getId()); - } - } - } - - @Test(enabled = false) - void testDeploy() throws InterruptedException, IOException, ResourceTypeNotFoundException_Exception, - RepoException_Exception { - - // check prequisites - - // Available Tomcat Server - ResourceCriteria criteria = new ResourceCriteria(); - criteria.strict = true; - // criteria.setFilterName("Tomcat ("); -// criteria.setFilterName("Tomcat VHost (localhost)"); - criteria.setFilterName("Tomcat (8080)"); - criteria.setFilterCurrentAvailability(AvailabilityType.UP); - // criteria.setFilterCurrentAvailability(AvailabilityType.DOWN); - List<Resource> tomcatServers = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - - assertNotNull("Test requires and available Tomcat Server in inventory.", tomcatServers); - assertTrue("Test requires and available Tomcat Server in inventory.", (tomcatServers.size() > 0)); - Resource tomcatServer = tomcatServers.get(0); - - // delete test-channel-war if in inventory - criteria = new ResourceCriteria(); - criteria.strict = true; - criteria.setFilterName("test-channel-war"); - criteria.setFilterResourceTypeName("Tomcat Web Application (WAR)"); - List<Resource> wars = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - Resource war = null; - - if ((null != wars) && !wars.isEmpty()) { - System.out.println("\n Deleting existing test-channel-war in order to test create..."); - assertEquals("Found more than 1 test-channel-war", wars.size(), 1); - war = wars.get(0); - // ResourceFactoryManager.deleteResource(war.getId()); - WEBSERVICE_REMOTE.deleteResource(subject, war.getId()); - - // up to 60 seconds to get the job done. - for (int i = 0; (i < 60); ++i) { - Thread.sleep(1000); - - wars = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - if ((null == wars) || wars.isEmpty()) { - break; - } - } - - wars = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - assertTrue("test-channel-war should not exist", ((null == wars) || wars.isEmpty())); - System.out.println("\n Done deleting existing test-channel-war in order to test create..."); - - // Give Tomcat a few additional seconds to perform its cleanup of - // the app, just in case the resource is - // gone but TC is still mopping up, before we try and deploy the - // same exact app - Thread.sleep(10000); - } - - // Create the war resource - - // Get the parent - criteria = new ResourceCriteria(); - criteria.strict = true; - criteria.setFilterName("Tomcat VHost (localhost)"); - criteria.setFilterCurrentAvailability(AvailabilityType.UP); - List<Resource> vhosts = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - assertNotNull("Test requires Tomcat VHost (localhost) in inventory.", vhosts); - assertEquals("Test requires Tomcat VHost (localhost) in inventory.", 1, vhosts.size()); - Resource vhost = vhosts.get(0); - - // get the resource type - ResourceType warType = WEBSERVICE_REMOTE.getResourceTypeByNameAndPlugin(subject, - "Tomcat Web Application (WAR)", "Tomcat"); - assertNotNull("Test requires Tomcat WAR resource type.", warType); - - // read in the file - File file = new java.io.File("./src/test/resources/test-channel-war.war"); - if ((file == null) || (!file.exists())) { - file = new java.io.File("../scripts/src/test/resources/test-channel-war.war"); - } - if ((file == null) || (!file.exists())) { - // THE FOLLOWING IS BAD, but there are some test situations where - // mvn is NOT running from within project structure - file = new java.io.File(HARDCODED_WAR_DIRECTORY + "/test-channel-war.war"); - } - assertNotNull("Unable to locate .war file to continue with testing.", file); - FileInputStream inputStream = new java.io.FileInputStream(file); - long fileLength = file.length(); - // fileBytes = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, - // fileLength); - byte[] fileBytes = new byte[(int) fileLength]; - int offset = 0; - for (int numRead = 0; ((numRead >= 0) && (offset < fileBytes.length)); offset += numRead) { - numRead = inputStream.read(fileBytes, offset, fileBytes.length - offset); - } - assertEquals("Read bytes not equal to file length", offset, fileLength); - - inputStream.close(); - assertTrue("Could not completely read file " + file.getName(), (offset == fileBytes.length)); - - // get package type for both create and update - - List<PackageType> packageTypes = WEBSERVICE_REMOTE.findPackageTypes(subject, "Tomcat Web Application (WAR)", - "Tomcat"); - assertNotNull("missing package type", packageTypes); - assertEquals("unexpected package type", packageTypes.size(), 1); - PackageType packageType = packageTypes.get(0); - - // get package config def - ConfigurationDefinition deployConfigDef = WEBSERVICE_REMOTE.getPackageTypeConfigurationDefinition(subject, - packageType.getId()); - assertNotNull("deployConfigDef should exist.", deployConfigDef); - - // explodeOnDeploy = deployConfigDef.getPropertyDefinitionSimple( - // "explodeOnDeploy" ); - PropertyDefinitions propertyDefinitions = deployConfigDef.getPropertyDefinitions(); - assertNotNull("PropertyDefinitions have not been populated.", propertyDefinitions); - PropertyDefinition explodeOnDeploy = (PropertyDefinition) locateProperty(propertyDefinitions, "explodeOnDeploy"); - - assertNotNull("explodeOnDeploy prop should exist.", explodeOnDeploy); - Configuration deployConfig = new Configuration(); - // property = new PropertySimple(explodeOnDeploy.getName(), "true"); - PropertySimple propSimp = new PropertySimple(); - propSimp.setName(explodeOnDeploy.getName()); - propSimp.setStringValue("true"); - PropertySimple property = propSimp; - // deployConfig.put( property ); - List<Property> prop = deployConfig.getPropertyListOrPropertySimpleOrPropertyMap(); - assertNotNull("Could not located property container.", prop); - prop.add(property); - - WsConfiguration wsConfig = new WsConfiguration(); - wsConfig.propertySimpleContainer = new ArrayList<PropertySimple>(); - wsConfig.propertySimpleContainer.add(property); - - // null arch -> noarch - // no required plugin config for this resource type - // no required resource config for this resource type - // resource name defaults to war file name / context root - // WEBSERVICE_REMOTE.createResource( vhost.getId(), warType.getId(), - // null, null, file.getName(), "1.0", null, deployConfig, fileBytes); - WEBSERVICE_REMOTE.createPackageBackedResource(subject, vhost.getId(), warType.getId(), null, null, file - .getName(), "1.0", null, - // deployConfig, fileBytes); - wsConfig, fileBytes); - - criteria = new ResourceCriteria(); - criteria.strict = false; - criteria.setFilterName("test-channel-war"); - criteria.setFilterResourceTypeName("Tomcat Web Application (WAR)"); - criteria.setFilterCurrentAvailability(AvailabilityType.UP); - - // up to 60 seconds to get the job done. - for (int i = 0; (i < 60); ++i) { - Thread.sleep(1000); - - wars = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - if ((null != wars) && !wars.isEmpty()) { - break; - } - } - - wars = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - war = null; - if ((null != wars) && !wars.isEmpty()) { - assertEquals("Found more than 1 test-channel-war", wars.size(), 1); - war = wars.get(0); - } - assertNotNull("War should have been created", war); - Thread.sleep(15 * 1000); - - // The backing package (InstalledPackage) for a new PBR may not exist - // immediately. It - // requires an agent-side content discovery. Wait for up to 120 seconds - // (to take care of initial delay - // and schedule interval timing. - InstalledPackage backingPackage; - for (int i = 0; (i < 120); ++i) { - Thread.sleep(1000); - - backingPackage = WEBSERVICE_REMOTE.getBackingPackageForResource(subject, war.getId()); - if (null != backingPackage) { - break; - } - } - - backingPackage = WEBSERVICE_REMOTE.getBackingPackageForResource(subject, war.getId()); - assertNotNull("backing package should exist after create", backingPackage); - System.out.println("\n After Create: Backing Package=" + backingPackage.getId()); - - // delete existing test channel in the db, this will unsubscribe - // resources and remove orphaned pvs - RepoCriteria criteriaChan = new RepoCriteria(); - criteriaChan.caseSensitive = true; - criteriaChan.strict = true; - criteriaChan.setFilterName("test-channel-0"); - - List<Repo> channels = WEBSERVICE_REMOTE.findReposByCriteria(subject, criteriaChan); - Repo channel; - if (!channels.isEmpty()) { - channel = channels.get(0); - WEBSERVICE_REMOTE.deleteRepo(subject, channel.getId()); - } - - // create a test channel - // newRepo = new Repo("test-channel-0"); - Repo newRepo = new Repo(); - newRepo.setName("test-channel-0"); - newRepo.setDescription("description-0"); - channel = WEBSERVICE_REMOTE.createRepo(subject, newRepo); - - assertNotNull("channel should have existed or been created", channel); - assertTrue("channel should have existed or been created", (channel.getId() > 0)); - - // test channel subscription - // subscribedResources; - List<Resource> subscribedResources = WEBSERVICE_REMOTE.findSubscribedResources(subject, channel.getId(), - pc_unlimited); - assertTrue("test channel should not have resources", ((null == subscribedResources) || subscribedResources - .isEmpty())); - - // RepoManager.subscribeResourceToRepos( war.getId(), - // [channel.getId()] ); - List<Integer> bag = new ArrayList<Integer>(); - bag.add(channel.getId()); - WEBSERVICE_REMOTE.subscribeResourceToRepos(subject, war.getId(), bag); - - subscribedResources = WEBSERVICE_REMOTE.findSubscribedResources(subject, channel.getId(), pc_unlimited); - assertEquals("channel should have the test war", subscribedResources.size(), 1); - - // RepoManager.unsubscribeResourceFromRepos( war.getId(), - // [channel.getId()] ); - WEBSERVICE_REMOTE.unsubscribeResourceFromRepos(subject, war.getId(), bag); - - subscribedResources = WEBSERVICE_REMOTE.findSubscribedResources(subject, channel.getId(), pc_unlimited); - assertTrue("test channel should not have resources", ((null == subscribedResources) || subscribedResources - .isEmpty())); - - // Create packageVersion in an attempt to upgrade the web-app - - List<PackageVersion> pvsInRepo = WEBSERVICE_REMOTE.findPackageVersionsInRepo(subject, channel.getId(), null, - pc_unlimited); - assertTrue("test channel should not have pvs", ((null == pvsInRepo) || pvsInRepo.isEmpty())); - - List<Architecture> architectures = WEBSERVICE_REMOTE.findArchitectures(subject); - assertNotNull("missing architectures", architectures); - assertTrue("missing architectures", !architectures.isEmpty()); - - // read in the package file - file = new java.io.File("./src/test/resources/test-channel-war-2.0.war"); - if ((file == null) || (!file.exists())) { - file = new java.io.File("../scripts/src/test/resources/test-channel-war-2.0.war"); - } - if ((file == null) || (!file.exists())) { - // THE FOLLOWING IS BAD, but there are some test situations where - // mvn is NOT running from within project structure - file = new java.io.File(HARDCODED_WAR_DIRECTORY + "/test-channel-war-2.0.war"); - } - - inputStream = new java.io.FileInputStream(file); - fileLength = file.length(); - fileBytes = new byte[(int) fileLength]; - offset = 0; - for (int numRead = 0; ((numRead >= 0) && (offset < fileBytes.length)); offset += numRead) { - numRead = inputStream.read(fileBytes, offset, fileBytes.length - offset); - } - inputStream.close(); - assertTrue("Could not completely read file " + file.getName(), (offset == fileBytes.length)); - - PackageVersion pv = WEBSERVICE_REMOTE.createPackageVersion(subject, "test-channel-war-2.0.war", packageType - .getId(), "2.0", null, fileBytes); - assertNotNull("failed to create packageVersion", pv); - assertTrue(" Bad PV Id from createPV", (pv.getId() > 0)); - - // RepoManager.addPackageVersionsToRepo( channel.getId(), - // [pv.getId()] ); - List<Integer> pvBag = new ArrayList<Integer>(); - pvBag.add(pv.getId()); - WEBSERVICE_REMOTE.addPackageVersionsToRepo(subject, channel.getId(), pvBag); - - pvsInRepo = WEBSERVICE_REMOTE.findPackageVersionsInRepo(subject, channel.getId(), null, pc_unlimited); - assertNotNull("pv should be in channel", pvsInRepo); - assertEquals("unexpected pvs", pvsInRepo.size(), 1); - assertEquals("unexpected pv returned", pvsInRepo.get(0).getId(), pv.getId()); - - // do the update - // ContentManager.deployPackages( [war.getId()], [pv.getId()] ); - List<Integer> warBag = new ArrayList<Integer>(); - warBag.add(war.getId()); - WEBSERVICE_REMOTE.deployPackages(subject, warBag, pvBag, "Test Notes"); - - // Make sure things still look good - - criteria = new ResourceCriteria(); - criteria.strict = false; - criteria.setFilterName("test-channel-war"); - criteria.setFilterResourceTypeName("Tomcat Web Application (WAR)"); - criteria.setFilterCurrentAvailability(AvailabilityType.UP); - - // up to 60 seconds to get the job done. - for (int i = 0; (i < 60); ++i) { - Thread.sleep(1000); - - wars = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - if ((null != wars) && !wars.isEmpty()) { - break; - } - } - - wars = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - war = null; - if ((null != wars) && !wars.isEmpty()) { - assertEquals("Found more than 1 test-channel-war", wars.size(), 1); - war = wars.get(0); - } - assertNotNull("War should have been updated", war); - - InstalledPackage newBackingPackage = WEBSERVICE_REMOTE.getBackingPackageForResource(subject, war.getId()); - Assert.assertNotNull(newBackingPackage, "backing package should exist after update."); - System.out.println("\n After Update: BackingPackage=" + newBackingPackage.getId()); - - // TODO: This test may fail due to RHQ-2387, uncomment when fixed - // Assert.assertTrue( ( backingPackage,getId() != - // newBackingPackage.getId() ), - // "Backing ackage should differ after update" ); - - // delete any existing test channels in the db - channels = WEBSERVICE_REMOTE.findRepos(subject, pc_unlimited); - for (int i = 0; (i < channels.size()); ++i) { - channel = channels.get(i); - if (channel.getName().startsWith("test-channel-")) { - WEBSERVICE_REMOTE.deleteRepo(subject, channel.getId()); - } - } - - } - - private PropertyDefinition locateProperty(PropertyDefinitions propertyDefinitions, String name) { - PropertyDefinition located = null; - if ((propertyDefinitions != null) && (name != null) && (name.trim().length() > 0)) { - List<Entry> list = propertyDefinitions.getEntry(); - for (int i = 0; (located == null) && i < list.size(); i++) { - Entry entry = list.get(i); - if (entry.getKey().equals(name)) { - located = entry.getValue(); - } - } - - } - return located; - } -} \ No newline at end of file diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceGroupManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceGroupManagerTest.java deleted file mode 100644 index 58ae385..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceGroupManagerTest.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsResourceGroupManagerTest extends AssertJUnit implements TestPropertiesInterface { - - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testCreateAndDeleteResourceGroup() throws ResourceGroupDeleteException_Exception { - ResourceGroup resourceGroup = createResourceGroup(); - - assertFalse("Failed to create resource group", resourceGroup.id == 0); - - WEBSERVICE_REMOTE.deleteResourceGroup(subject, resourceGroup.id); - - java.lang.Exception exception = null; - try { - WEBSERVICE_REMOTE.getResourceGroup(subject, resourceGroup.id); - } catch (java.lang.Exception e) { - exception = e; - } - assertNotNull("Failed to delete resource group", exception); - } - - @Test(enabled = TESTS_ENABLED) - void testAddResourcesToGroup() { - ResourceGroup resourceGroup = createResourceGroup(); - - assertFalse("Cannot add resources to group. Failed to create resource group.", resourceGroup.id == 0); - - List<Resource> resources = findAlphaServices(); - assertEquals("Cannot add resources to group. Failed to find the correct number of resources.", - resources.size(), 10); - - addResourcesToGroup(resourceGroup, resources); - - ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.setFilterId(resourceGroup.id); - criteria.setFetchExplicitResources(true); - - resourceGroup = WEBSERVICE_REMOTE.findResourceGroupsByCriteria(subject, criteria).get(0); - - assertEquals("Failed to find resources in group. Resources may not have been added.", - resourceGroup.explicitResources.size(), 10); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFiltering() { - ResourceGroup resourceGroup = createResourceGroup(); - List<Resource> resources = findAlphaServices(); - Resource resource = resources.get(0); - - addResourcesToGroup(resourceGroup, resources); - - ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.setFilterId(resourceGroup.id); - criteria.setFilterPluginName("PerfTest"); - criteria.setFilterResourceTypeId(resource.resourceType.id); - criteria.setFilterResourceTypeName(resource.resourceType.name); - criteria.setFilterName(resourceGroup.name); - criteria.setFilterGroupCategory(GroupCategory.COMPATIBLE); - // criteria.addFilterExplicitResourceIds(getIds(resources)); - criteria.filterExplicitResourceIds = getIds(resources); - - List<ResourceGroup> resourceGroups = WEBSERVICE_REMOTE.findResourceGroupsByCriteria(subject, criteria); - - assertEquals("Failed to find resource groups when applying filters.", resourceGroups.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFetchingAssociations() { - ResourceGroup resourceGroup = createResourceGroup(); - List<Resource> resources = findAlphaServices(); - - addResourcesToGroup(resourceGroup, resources); - - ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.setFilterId(resourceGroup.id); - criteria.setFetchExplicitResources(true); - criteria.setFetchImplicitResources(true); - criteria.setFetchOperationHistories(true); - criteria.setFetchConfigurationUpdates(true); - criteria.setFetchGroupDefinition(true); - criteria.setFetchResourceType(true); - - List<ResourceGroup> resourceGroups = WEBSERVICE_REMOTE.findResourceGroupsByCriteria(subject, criteria); - - assertEquals("Failed to find resource groups when fetching associations.", resourceGroups.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithSorting() { - ResourceGroup resourceGroup = createResourceGroup(); - List<Resource> resources = findAlphaServices(); - - addResourcesToGroup(resourceGroup, resources); - - ResourceGroupCriteria criteria = new ResourceGroupCriteria(); - criteria.setSortName(PageOrdering.ASC); - criteria.setSortResourceTypeName(PageOrdering.DESC); - - List<ResourceGroup> resourceGroups = WEBSERVICE_REMOTE.findResourceGroupsByCriteria(subject, criteria); - - assertTrue("Failed to find resource groups when sorting", resourceGroups.size() > 0); - } - - ResourceGroup createResourceGroup() { - ResourceType resourceType = getResourceType(); - assertNotNull("Failed to find resource type for new resource group.", resourceType); - - String groupName = "test-group-" + new java.util.Date().getTime(); - // ResourceGroup resGroup = new ResourceGroup(); - WsResourceGroupWrapper resGroup = new WsResourceGroupWrapper(); - resGroup.setName(groupName); - resGroup.setResourceType(resourceType); - // WsResourceGroupWrapper rgw = new WsResourceGroupWrapper(); - - // if (resourceType == null) { - // resGroup.setGroupCategory(GroupCategory.MIXED); - // } else { - // resGroup.setGroupCategory(GroupCategory.COMPATIBLE); - // } - - return WEBSERVICE_REMOTE.createResourceGroup(subject, resGroup); - } - - ResourceType getResourceType() { - String resourceTypeName = "service-alpha"; - String pluginName = "PerfTest"; - - return WEBSERVICE_REMOTE.getResourceTypeByNameAndPlugin(subject, resourceTypeName, pluginName); - } - - List<Resource> findAlphaServices() { - ResourceCriteria criteria = new ResourceCriteria(); - criteria.caseSensitive = true; - criteria.strict = true; - criteria.setFilterParentResourceName("server-omega-0"); - criteria.setFilterResourceTypeName("service-alpha"); - criteria.setFetchResourceType(true); - - return WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - } - - void addResourcesToGroup(ResourceGroup group, List<Resource> resources) { - List<Integer> resourceIds = getIds(resources); - WEBSERVICE_REMOTE.addResourcesToGroup(subject, group.id, resourceIds); - } - - List<Integer> getIds(List<Resource> resources) { - // var ids = []; - List<Integer> ids = new ArrayList<Integer>(); - - for (int i = 0; i < resources.size(); ++i) { - // ids.push(resources.get(i).id); - ids.add(resources.get(i).getId()); - } - - return ids; - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceManagerTest.java deleted file mode 100644 index 0049cf3..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceManagerTest.java +++ /dev/null @@ -1,312 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.HashMap; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsResourceManagerTest extends AssertJUnit implements TestPropertiesInterface { - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - public void testResourceManager() throws java.lang.Exception { - // define search term - // String searchTerm = "RHQ AGENT"; - String searchTerm = "server-omega"; - - // build criteria - // Subject subject = WEBSERVICE_REMOTE.login(credentials, credentials); - ResourceCriteria resourceCriteria = WS_OBJECT_FACTORY.createResourceCriteria(); - List<Resource> results = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, resourceCriteria); - assertNotNull("Results not located correctly", results); - - // without filter term, should be get * - int totalResourcesLocated = results.size(); - // check for uninitialized server - assertTrue("Your server does not appear to be initialized. Resource count == 0.", (totalResourcesLocated > 0)); - - // add criterion .. and resubmit - resourceCriteria.setFilterName(searchTerm); - results = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, resourceCriteria); - assertNotNull("Results not located correctly", results); - assertTrue("Criteria did not filter properly.", (totalResourcesLocated > results.size())); - - // Test getResource - Resource resource = WEBSERVICE_REMOTE.getResource(subject, results.get(0).getId()); - assertNotNull("Resource by id was null.", resource); - assertEquals("Resource ids not matching.", resource.getId(), results.get(0).getId()); - assertEquals("Resource names not matching.", resource.getName(), results.get(0).getName()); - - } - - // function testFindUnfiltered() { - @Test(enabled = TESTS_ENABLED) - public void testUnfilteredFind() { - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, WS_OBJECT_FACTORY - .createResourceCriteria()); - - assertNotNull("Expected non-null results for criteria search.", resources); - assertTrue("Expected non-empty result list.", resources.size() > 0); - } - - // function testFindWithFiltering() { - @Test(enabled = TESTS_ENABLED) - public void testFindWithFiltering() throws SecurityException, IllegalArgumentException, NoSuchMethodException, - IllegalAccessException, InvocationTargetException { - ResourceCriteria criteria = createCriteria(); - // TODO: fix default criteria - criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName("service-alpha-0"); - criteria.setFilterParentResourceName("server-omega-2"); - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - - assertEquals("Expected to get back a single resource", 1, resources.size()); - - } - - // function testFindWithOptionalFiltering() { - @Test(enabled = TESTS_ENABLED) - public void testFindWithOptionalFiltering() throws SecurityException, IllegalArgumentException, - NoSuchMethodException, IllegalAccessException, InvocationTargetException { - - ResourceCriteria criteria = createCriteria(); - criteria.filtersOptional = true; - criteria.setFilterParentResourceName("_does_not_exist_"); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - - assertTrue("Expected to find resources when filtering made optional", resources.size() > 0); - - } - - // function testFindWithFilteringAndFetchingAssociations() { - public void testFindWithFilteringAndFetchingAssociations() { - // var criteria = createCriteria(); - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.strict = true; - criteria.setFilterParentResourceName("server-omega-0"); - criteria.setFilterResourceTypeName("service-beta"); - criteria.setFetchAgent(true); - criteria.setFetchAlertDefinitions(true); - criteria.setFetchResourceType(true); - criteria.setFetchChildResources(true); - criteria.setFetchParentResource(true); - criteria.setFetchResourceConfiguration(true); - criteria.setFetchResourceErrors(true); - criteria.setFetchPluginConfigurationUpdates(true); - criteria.setFetchImplicitGroups(true); - criteria.setFetchExplicitGroups(true); - criteria.setFetchOperationHistories(true); - - criteria.setSortName(PageOrdering.DESC); - criteria.setSortResourceTypeName(PageOrdering.ASC); - criteria.setSortInventoryStatus(PageOrdering.DESC); - criteria.setSortVersion(PageOrdering.DESC); - criteria.setSortResourceCategory(PageOrdering.ASC); - - // var resources = ResourceManager.findResourcesByCriteria(criteria); - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - - // assertEquals("Expected to get back a single resource", 1, resources.size()); - assertTrue("Expected to get back resource list", (resources.size() > 0)); - Resource resource = resources.get(0); - assertNotNull("resource.agent should have been loaded", resource.agent); - // assertNotNull("resource.alertDefinitions should have been loaded", resource.alertDefinitions); - assertNotNull("resource.resourceType should have been loaded", resource.resourceType); - // assertNotNull("resource.childResources should have been loaded", resource.childResources); - // TODO: following resource removed because it caused cycle, need to replace with wrapper approach - // assertNotNull("resource.parentResource should have been loaded", resource.parentResource); - assertNotNull("resource.resourceConfiguration should have been loaded", resource.resourceConfiguration); - // TODO: following resource removed because it caused cycle, need to replace with wrapper - // assertNotNull("resource.resourceErrors should have been loaded", resource.resourceErrors); - // assertNotNull("resource.pluginConfigurationUpdates should have been loaded", - // resource.pluginConfigurationUpdates); - // assertNotNull("resource.implicitGroups should have been loaded", resource.implicitGroups); - // assertNotNull("reosurce.explicitGroups should have been loaded", resource.explicitGroups); - // assertNotNull("resource.operationHistories should have been loaded", resource.operationHistories); - } - - // function testSortBySingleProperty() { - @Test(enabled = TESTS_ENABLED) - public void testSortBySingleProperty() { - - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.caseSensitive = true; - criteria.setFilterParentResourceName("server-omega-0"); - // criteria.setFilterResourceTypeName("service-beta"); - criteria.setSortName(PageOrdering.DESC); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - - assertTrue("Expected to get back resources when sorting by a single property, resource.name", - resources.size() > 0); - - // TODO verify resources are actually sorted - - } - - @Test(enabled = TESTS_ENABLED) - public void testSortByMultipleProperties() { - - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.caseSensitive = true; - criteria.setFilterParentResourceName("server-omega-0"); - // TODO: ?? why works when disabling resourceType? - // criteria.setFilterResourceTypeName("service-beta"); - - criteria.setSortName(PageOrdering.DESC); - criteria.setSortResourceTypeName(PageOrdering.DESC); - criteria.setSortInventoryStatus(PageOrdering.DESC); - criteria.setSortVersion(PageOrdering.DESC); - criteria.setSortResourceCategory(PageOrdering.DESC); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - - assertTrue("Expected to get resources when sorting by multiple proerties.", resources.size() > 0); - - } - - @Test(enabled = TESTS_ENABLED) - public void testFindResourceLineage2() { - - // create criteria - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName("RHQ AGENT JVM"); - criteria.setFilterParentResourceName("RHQ AGENT"); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - assertNotNull("Unable to locate resources.", resources); - assertTrue("Unable to locate correct number of resources.", resources.size() > 0); - Resource resource = resources.get(0); - - // resources = WEBSERVICE_REMOTE.findResourceLineage(subject, - // resource.id); - WsResourceListWrapper resourcesList = WEBSERVICE_REMOTE.findResourceLineage(subject, resource.id); - - // System.out.println("NAME:"+resources.get(0).getName()+":"+resources.get(0).getName()+":"+resources.get(0).getUuid()); - // System.out.println("NAME:"+resources.get(1).getName()+":"+resources.get(1).getName()+":"+resources.get(1).getUuid()); - // System.out.println("NAME:"+resources.get(2).getName()+":"+resources.get(2).getName()+":"+resources.get(2).getUuid()); - - } - - @Test(enabled = TESTS_ENABLED) - public void testFindResourceLineage() { - - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.setFilterName("service-alpha-0"); - criteria.setFilterParentResourceName("server-omega-0"); - - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, criteria); - Resource resource = resources.get(0); - - WsResourceListWrapper resourcesList = WEBSERVICE_REMOTE.findResourceLineage(subject, resource.id); - - resources = resourcesList.getLineageList(); - - assertEquals("The wrong resource lineage returned for resource " + resource, resources.size(), 3); - // assertEquals("The wrong root resource was returned", - // "localhost.localdomain", resources.get(0).name); - // assertEquals("The wrong root resource was returned", "Vital-AGENT", - // resources.get(0).name); - // lookup the first platform resource and use that name. More stable - // than hard coding. Almost always one. - ResourceCriteria platCriteria = new ResourceCriteria(); - platCriteria.getFilterResourceCategories().add(ResourceCategory.PLATFORM); - List<Resource> platformList = WEBSERVICE_REMOTE.findResourcesByCriteria(subject, platCriteria); - assertNotNull("Platform list should not be null.", platformList); - assertEquals("Should be only one in list for testing.", 1, platformList.size()); - assertEquals("The wrong root resource was returned", platformList.get(0).getName(), resources.get(0).name); - assertTrue("The root resource was null.", (resources.get(0).getName() != null)); - assertEquals("The wrong parent resource was returned", resources.get(1).name, "server-omega-0"); - assertEquals("The last resource in the lineage is wrong", resources.get(2).name, "service-alpha-0"); - - } - - ResourceCriteria createCriteria() throws SecurityException, IllegalArgumentException, NoSuchMethodException, - IllegalAccessException, InvocationTargetException { - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - criteria.caseSensitive = true; - addFilters(criteria); - - return criteria; - } - - void addFilters(ResourceCriteria criteria) throws SecurityException, NoSuchMethodException, - IllegalArgumentException, IllegalAccessException, InvocationTargetException { - HashMap<String, String> filters = getFilters(); - String[] keyArray = new String[filters.size()]; - keyArray = filters.keySet().toArray(keyArray); - for (int i = 0; i < filters.size(); ++i) { - String key = keyArray[i]; - Method method = criteria.getClass().getMethod("setFilter" + key, String.class); - method.invoke(criteria, filters.get(key)); - } - } - - HashMap<String, String> getFilters() { - String resourceName = "service-alpha-0"; - - HashMap<String, String> map = new HashMap<String, String>(); - map.put("Name", resourceName); - map.put("ParentResourceName", "server-omega-0"); - map.put("ResourceKey", resourceName); - map.put("Description", resourceName + " description"); - map.put("PluginName", "PerfTest"); - map.put("Version", "1.0"); - map.put("AgentName", "Vital-AGENT"); - // No setting agent name as this is too variable to put into a test - // setup? I set mine on agent startup. - // map.put("AgentName", "localhost.localdomain"); - return map; - } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceTypeManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceTypeManagerTest.java deleted file mode 100644 index a1a03e7..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsResourceTypeManagerTest.java +++ /dev/null @@ -1,126 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsResourceTypeManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, - SecurityException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFiltering() { - ResourceType resourceType = WEBSERVICE_REMOTE - .getResourceTypeByNameAndPlugin(subject, "service-alpha", - "PerfTest"); - - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.setFilterName("service-alpha"); - criteria.setFilterDescription(resourceType.description); - criteria.setFilterCategory(ResourceCategory.SERVICE); - criteria.setFilterPluginName("PerfTest"); - criteria - .setFilterCreationDataType(ResourceCreationDataType.CONFIGURATION); - criteria.setFilterCreateDeletePolicy(CreateDeletePolicy.NEITHER); - criteria.setFilterSupportsManualAdd(false); - - List<ResourceType> resourceTypes = WEBSERVICE_REMOTE - .findResourceTypesByCriteria(subject, criteria); - - assertEquals("Failed to find resource type when filtering", - resourceTypes.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFetchingAssociations() { - ResourceType resourceType = WEBSERVICE_REMOTE - .getResourceTypeByNameAndPlugin(subject, "service-alpha", - "PerfTest"); - - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.setFilterId(resourceType.id); - criteria.setFetchSubCategory(true); - criteria.setFetchChildResourceTypes(true); - criteria.setFetchParentResourceTypes(true); - criteria.setFetchPluginConfigurationDefinition(true); - criteria.setFetchResourceConfigurationDefinition(true); - criteria.setFetchMetricDefinitions(true); - criteria.setFetchEventDefinitions(true); - criteria.setFetchOperationDefinitions(true); - criteria.setFetchProcessScans(true); - criteria.setFetchPackageTypes(true); - criteria.setFetchSubCategories(true); - criteria.setFetchProductVersions(true); - - List<ResourceType> resourceTypes = WEBSERVICE_REMOTE - .findResourceTypesByCriteria(subject, criteria); - - assertEquals("Failed to find resource type when fetching associations", - resourceTypes.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithSorting() { - ResourceTypeCriteria criteria = new ResourceTypeCriteria(); - criteria.setSortName(PageOrdering.ASC); - criteria.setSortCategory(PageOrdering.DESC); - criteria.setSortPluginName(PageOrdering.ASC); - - List<ResourceType> resourceTypes = WEBSERVICE_REMOTE - .findResourceTypesByCriteria(subject, criteria); - - assertTrue("Failed to find resource types when sorting", resourceTypes - .size() > 0); - } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRoleManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRoleManagerTest.java deleted file mode 100644 index 116d23f..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsRoleManagerTest.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsRoleManagerTest extends AssertJUnit implements TestPropertiesInterface { - - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFiltering() { - RoleCriteria criteria = new RoleCriteria(); - criteria.setFilterName("Super User Role"); - criteria - .setFilterDescription("System superuser role that provides full access to everything. This role cannot be modified."); - - List<Role> roles = WEBSERVICE_REMOTE.findRolesByCriteria(subject, criteria); - - assertEquals("Failed to find role when filtering", roles.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFetchingAssociations() { - RoleCriteria criteria = new RoleCriteria(); - criteria.setFilterName("Super User Role"); - criteria.setFetchSubjects(true); - criteria.setFetchResourceGroups(true); - criteria.setFetchPermissions(true); - criteria.setFetchRoleNotifications(true); - - List<Role> roles = WEBSERVICE_REMOTE.findRolesByCriteria(subject, criteria); - - assertEquals("Failed to find role when fetching associations", roles.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithSorting() { - RoleCriteria criteria = new RoleCriteria(); - criteria.setFilterName("Super User Role"); - criteria.setSortName(PageOrdering.ASC); - - List<Role> roles = WEBSERVICE_REMOTE.findRolesByCriteria(subject, criteria); - - assertTrue("Failed to find roles when sorting", roles.size() > 0); - } - - @Test(enabled = TESTS_ENABLED) - void testCreateUpdateDelete() { - Role role = new Role(); - role.setName("Test Role - " + new java.util.Date()); - role.description = "This role is for testing only"; - role.permissions = new ArrayList<Permission>(); - role.permissions.add(Permission.MANAGE_INVENTORY); - role.permissions.add(Permission.MANAGE_ALERTS); - - Role savedRole = WEBSERVICE_REMOTE.createRole(subject, role); - - assertTrue("Failed to save/create role", savedRole.id > 0); - - savedRole.permissions.add(Permission.MANAGE_MEASUREMENTS); - - Role updatedRole = WEBSERVICE_REMOTE.updateRole(subject, savedRole); - - //Assert.assertEqualsNoOrder(updatedRole.permissions, savedRole.permissions, 'Failed to update role permissions'); - - // RoleManager.deleteRoles([updatedRole.id]); - List<Integer> roleList = new ArrayList<Integer>(); - roleList.add(updatedRole.getId()); - WEBSERVICE_REMOTE.deleteRoles(subject, roleList); - - Role deletedRole = WEBSERVICE_REMOTE.getRole(subject, updatedRole.id); - - assertNull("Failed to delete role", deletedRole); - } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSubjectTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSubjectTest.java deleted file mode 100644 index 568987a..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSubjectTest.java +++ /dev/null @@ -1,398 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.AfterTest; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsSubjectTest extends AssertJUnit implements - TestPropertiesInterface { - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, - SecurityException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - // insert ws-test user creation and role addition - checkForWsTestUserAndRole(); - - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - static void checkForWsTestUserAndRole() { - try { - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - - // login with rhqadmin creds - Subject adminSubject = null; - - adminSubject = WEBSERVICE_REMOTE.login("rhqadmin", "rhqadmin"); - // search for user ws-test - String name = "ws-test"; - Subject user = WEBSERVICE_REMOTE.getSubjectByName(name); - // if user exists, then bail - if (user == null) { - // else create user, find default roles and add them - Subject wstest = new Subject(); - wstest.setName(name); - wstest.setFirstName("WS"); - wstest.setLastName("Test"); - wstest.setEmailAddress("ws-test@test.org"); - wstest.setDepartment("test-department"); - wstest.setFactive(true); - Subject sub = WEBSERVICE_REMOTE.createSubject(adminSubject, - wstest); - - user = WEBSERVICE_REMOTE.getSubjectByName(name); - - // locate all available roles and assign them to the test user - RoleCriteria criteria = WS_OBJECT_FACTORY.createRoleCriteria(); - List<Role> allRoles = WEBSERVICE_REMOTE.findRolesByCriteria( - adminSubject, criteria); - List<Integer> roleIds = new ArrayList<Integer>(); - for (Role r : allRoles) { - roleIds.add(r.getId()); - } - WEBSERVICE_REMOTE.addRolesToSubject(adminSubject, user.getId(), - roleIds); - // WEBSERVICE_REMOTE.changePassword(adminSubject, - // user.getName(),"ws-test"); - WEBSERVICE_REMOTE.createPrincipal(adminSubject, user.getName(), - "ws-test"); - - // //Create perf test group for testing - // String groupName = "All Perf Test Servers"; - // ResourceGroup group = new ResourceGroup(); - // group.setName(groupName); - // group.setDescription(groupName); - // group.setRecursive(true); - // WEBSERVICE_REMOTE.createResourceGroup(adminSubject, group); - - // //Create AlertDefinitions - // String alName1 = "service-alpha-0-alert-def-1"; - // String alDesc1 = - // "Test alert definition 1 for service-alpha-0"; - // //Find resource 'service-alpha-0' - // ResourceCriteria perfCriteria = - // WS_OBJECT_FACTORY.createResourceCriteria(); - // perfCriteria.setFilterName("service-alpha-0"); - // List<Resource> resources = - // WEBSERVICE_REMOTE.findResourcesByCriteria(adminSubject, - // perfCriteria); - // if(resources.size()==1){//then able to proceed - // AlertDefinition alertDef1 = - // WS_OBJECT_FACTORY.createAlertDefinition(); - // alertDef1.setName(alName1); - // alertDef1.setDescription(alDesc1); - // alertDef1.setEnabled(true); - // //create Alert Definition Context - // //* If condition: select 'Event Severity' and choose 'WARN' - // OperationDefinition opDefinition = new OperationDefinition(); - // // opDefinition.set - // alertDef1.setConditionExpression(BooleanExpression.) - // } - - } - } catch (LoginException_Exception e) { - System.out - .println("Error trying to login to test/setup test environment."); - System.out - .println("You need to manually create the 'ws-test' user with all roles added."); - e.printStackTrace(); - } catch (MalformedURLException e) { - System.out.println("Problem detected with Url passed in."); - e.printStackTrace(); - } - } - - @BeforeTest - public void setup() { - } - - @AfterTest - public void teardown() { - } - - // Create and use SubjectManagerBean - @Test(enabled = TESTS_ENABLED) - public void testSubject() throws java.lang.Exception { - - // - Subject user = WEBSERVICE_REMOTE.login(credentials, credentials); - - // test ref - assertNotNull(user); - - // test subject details: CREATE - assertEquals(credentials, user.getName()); - - // test session Id : CREATE - assertNotNull(user.getSessionId()); - - // test for invalid data in session id : CREATE - assertTrue(user.getSessionId() != 0); - - // SUBJECT TESTING - // check for user that shouldn't be there. Incomplete cleanups do occur - // and leave db debris - String testUserName = "ws-test-user"; - - // Use Case # 7. : SEARCH - - Subject newUser = WEBSERVICE_REMOTE.getSubjectByName(testUserName); - - // if there, must have been from previous failed test... clean up. - if (null != newUser) { - // Integer[] list = new Integer[newUser.getId()]; - ArrayList<Integer> list = new ArrayList<Integer>(); - list.add(newUser.getId()); - - WEBSERVICE_REMOTE.deleteSubjects(user, list); - } - - // test adding a new user with details. - newUser = new Subject(); - - String fName = "first-name"; - String lName = "last-name"; - newUser.setName(testUserName); - newUser.setFirstName(fName); - newUser.setLastName(lName); - newUser.setFactive(true); - - // Send command to create the new user - WEBSERVICE_REMOTE.createSubject(user, newUser); - - // locate the previously created user and test values - newUser = WEBSERVICE_REMOTE.getSubjectByName(testUserName); - - assertNotNull(newUser); - assertTrue(testUserName.equals(newUser.getName())); - assertTrue(fName.equals(newUser.getFirstName())); - assertTrue(lName.equals(newUser.getLastName())); - - // PRINCIPAL TESTING - // create principal - String testUserPass = "ws-test-password"; - - // create principal - WEBSERVICE_REMOTE.createPrincipal(user, testUserName, testUserPass); - // attempt login - newUser = WEBSERVICE_REMOTE.login(testUserName, testUserPass); - - // verify login - WEBSERVICE_REMOTE.logout(newUser); - - // test password change methods - WEBSERVICE_REMOTE.changePassword(user, testUserName, - "updated-ws-test-password"); - newUser = WEBSERVICE_REMOTE.login(testUserName, - "updated-ws-test-password"); - - // assertTrue(subjectManager.isLoggedIn(testUserName)); - WEBSERVICE_REMOTE.logout(newUser); - - // locate subject - newUser = WEBSERVICE_REMOTE.getSubjectByName(testUserName); - // more subject modification testing .. this time using update() - newUser.setFirstName("updated-first-name"); - newUser.setLastName("updated-last-name"); - WEBSERVICE_REMOTE.updateSubject(user, newUser); - - // checking for successful update - newUser = WEBSERVICE_REMOTE.getSubjectByName(testUserName); - - assertTrue("ws-test-user".equals(newUser.getName())); - assertTrue("updated-first-name".equals(newUser.getFirstName())); - assertTrue("updated-last-name".equals(newUser.getLastName())); - - // ROLE testing - // locate roles available for subject - PageControl pageControl = new PageControl(); - pageControl.setPageSize(10); - Integer[] emptyList = null; - - // Find roles possible to add. Ex. lay users cannot elevate another - // account to SYS ADM - // Access controls for Use Case #7 - List<Role> roles = null; - roles = WEBSERVICE_REMOTE.findSubjectAssignedRoles(user, user.getId(), - pageControl); - // displayXml(roles); - - // locate 'All Role Id' - int roleId = -1; - for (Role role : roles) { - // displayXml(role); - if ("all resources role".equalsIgnoreCase(role.getName())) { - roleId = role.getId(); - break; - } - } - assertTrue("Role was not successfully located.", (roleId != -1)); - - // assign that role to the subject - List<Integer> roleBag = new ArrayList<Integer>(); - roleBag.add(roleId); - WEBSERVICE_REMOTE.addRolesToSubject(user, Integer.valueOf(newUser - .getId()), roleBag); - - // check that assignment occurred - List<Role> attachedSubjects = WEBSERVICE_REMOTE - .findSubjectAssignedRoles(user, newUser.getId(), pageControl); - boolean found = false; - for (Role subject : attachedSubjects) { - - if (subject.getId() == roleId) { - found = true; - } - } - assertTrue(found); - - // now cleanup the user and association we just created. - List<Integer> cleanup = new ArrayList<Integer>(); - cleanup.add(newUser.getId()); - WEBSERVICE_REMOTE.deleteSubjects(user, cleanup); - assertNull(WEBSERVICE_REMOTE.getSubjectByName("ws-test-user")); - - } - - // TODO: add tests/test condition for findSubjectsByCritera - // TODO: add test for getServerVersion - // TODO: ROLE test for: findSubjectUnassignedRoles, removeRolesFromSubject, - // addSubjectsToRole, - // removeSubjectsFromRole, addResourceGroupsToRole, addRolesToResourceGroup, - // removeResourceGroupsFromRole, - // removeRolesFromResourceGroup, findRolesByCriteria - - @Test(enabled = TESTS_ENABLED) - void testFindWithFiltering() { - // subject = WEBSERVICE_REMOTE.getSubjectByName("rhqadmin"); - Subject retrievedSubject = WEBSERVICE_REMOTE - .getSubjectByName("rhqadmin"); - - SubjectCriteria criteria = new SubjectCriteria(); - criteria.setFilterId(retrievedSubject.id); - criteria.setFilterName(retrievedSubject.name); - criteria.setFilterFirstName(retrievedSubject.firstName); - criteria.setFilterLastName(retrievedSubject.lastName); - criteria.setFilterEmailAddress(retrievedSubject.emailAddress); - criteria.setFilterSmsAddress(retrievedSubject.smsAddress); - criteria.setFilterPhoneNumber(retrievedSubject.phoneNumber); - criteria.setFilterDepartment(retrievedSubject.department); - criteria.setFilterFactive(retrievedSubject.factive); - - List<Subject> subjects = WEBSERVICE_REMOTE.findSubjectsByCriteria( - subject, criteria); - - assertEquals("Failed to find subjects when filtering", subjects.size(), - 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithFetchingAssociations() { - SubjectCriteria criteria = new SubjectCriteria(); - criteria.setFilterName("rhqadmin"); - criteria.setFetchConfiguration(true); - criteria.setFetchRoles(true); -// criteria.setFetchSubjectNotifications(true); - - List<Subject> subjects = WEBSERVICE_REMOTE.findSubjectsByCriteria( - subject, criteria); - - assertEquals("Failed to find subject when fetching associations", - subjects.size(), 1); - } - - @Test(enabled = TESTS_ENABLED) - void testFindWithSorting() { - SubjectCriteria criteria = new SubjectCriteria(); - criteria.setSortFirstName(PageOrdering.ASC); - criteria.setSortLastName(PageOrdering.DESC); - criteria.setSortEmailAddress(PageOrdering.ASC); - criteria.setSortSmsAddress(PageOrdering.DESC); - criteria.setSortPhoneNumber(PageOrdering.ASC); - criteria.setSortDepartment(PageOrdering.DESC); - - List<Subject> subjects = WEBSERVICE_REMOTE.findSubjectsByCriteria( - subject, criteria); - - assertTrue("Failed to find subjects when sorting", subjects.size() > 0); - - // TODO verify sort order - } - - @Test(enabled = TESTS_ENABLED) - void testLoginLogout() throws LoginException_Exception { - - assertNotNull("Should have returned a subject", subject); - assertEquals("Unexpected Subject name", subject.getName(), credentials); - Integer sessionId = subject.getSessionId(); - - // should return same sessionId - // rhq.login('rhqadmin', 'rhqadmin'); - assertNotNull("Should have returned a subject", subject); - assertEquals("Unexpected Subject name", subject.getName(), credentials); - assertEquals("Unexpected Subject session", subject.getSessionId(), - sessionId); - - WEBSERVICE_REMOTE.logout(subject); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - // Assert.assertNull( subject, "Should be no active subject" ); - - // should return new sessionId - // rhq.login('rhqadmin', 'rhqadmin'); - assertNotNull("Should have returned a subject", subject); - assertEquals("Unexpected Subject name", subject.getName(), credentials); - assertTrue("Unexpected Subject session", - (subject.getSessionId() != sessionId)); - - // rhq.logout(); - - // print( 'FOO!' ) - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSupportManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSupportManagerTest.java deleted file mode 100644 index 631c680..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSupportManagerTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.List; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root - * ]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need - * to use classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage - * of type substitution correctly) - Server running on localhost. - ws-test user - * defined in database with full permissions - Non RHQ Server JBossAS in - * inventory. - The -Ptest-ws profile specified when running mvn test from - * webservices dir - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsSupportManagerTest extends AssertJUnit implements - TestPropertiesInterface { - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, - SecurityException, NoSuchMethodException, IllegalArgumentException, - InstantiationException, IllegalAccessException, - InvocationTargetException, LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL( - WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility - .generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService( - gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - subject = WEBSERVICE_REMOTE.login(credentials, credentials); - } - - @Test(enabled = TESTS_ENABLED) - public void testSnapshotReport() throws java.lang.Exception { - // Locate a resource to get snapshot for - // ResourceCriteria criteria = createCriteria(); - // TODO: fix default criteria - ResourceCriteria criteria = WS_OBJECT_FACTORY.createResourceCriteria(); - // TODO: Figure out how to generically call this. Will only work for the - // resource that represents the AGENT itself. - // criteria.setFilterName("Vital-AGENT RHQ Agent"); - criteria.setFilterName("AGENT RHQ Agent"); - // criteria.setFilterName("service-alpha-0"); - // criteria.setFilterParentResourceName("server-omega-2"); - List<Resource> resources = WEBSERVICE_REMOTE.findResourcesByCriteria( - subject, criteria); - - // Test that we have a resource to use - assertNotNull("Resource list was null for some reason.", resources); - assertTrue("No resources were located. Unable to proceed.", resources - .size() > 0); - assertTrue("Resource id was invalid.", resources.get(0).getId() > -1); - - int resourceId = resources.get(0).getId(); - String name = "SupportSnapshot-Agent"; - String description = "Some Description"; - // locate resource to get resourceId - String snapshotReport = WEBSERVICE_REMOTE.getSnapshotReport(subject, - resourceId, name, description); - assertNotNull("Snapshot was not located.", snapshotReport); - // System.out.println("SNAPSHOTREPORT:" + snapshotReport + ":"); - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSystemManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSystemManagerTest.java deleted file mode 100644 index 23ba07e..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/WsSystemManagerTest.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.rhq.enterprise.server.ws; - -import java.lang.reflect.InvocationTargetException; -import java.net.MalformedURLException; -import java.net.URL; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * These tests can not be executed in our standard unit test fashion as they - * require a running RHQ Server with our web services deployed. - * - * This is still in development and has the current restrictions: - add - * [dev_root]/modules/enterprise/remoting/webservices/target/rhq-remoting-webservices - * -{version}.jar to TOP of eclipse classpath to run from your IDE(actually need to use - * classpath setup from bin/jbossas/bin/wsrunclient.sh to take advantage of type - * substitution correctly) - * - Server running on localhost. - * - ws-test user defined in database with full permissions - * - Non RHQ Server JBossAS in inventory. - * - The -Ptest-ws profile specified when running mvn test from webservices dir - * - Perftest plugin installed and agent started as described in - * modules/enterprise/remoting/scripts/README.txt - * - * @author Jay Shaughnessy, Simeon Pinder - */ -@Test(groups = "ws") -public class WsSystemManagerTest extends AssertJUnit implements TestPropertiesInterface { - - // Test variables - private static ObjectFactory WS_OBJECT_FACTORY; - private static WebservicesRemote WEBSERVICE_REMOTE; - private static Subject subject = null; - - @BeforeClass - public void init() throws ClassNotFoundException, MalformedURLException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, - LoginException_Exception { - - // build reference variable bits - URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); - - WEBSERVICE_REMOTE = jws.getWebservicesManagerBeanPort(); - WS_OBJECT_FACTORY = new ObjectFactory(); - WsSubjectTest.checkForWsTestUserAndRole(); - } - - @Test(enabled = TESTS_ENABLED) - public void testServerNameSpaceVersion() throws java.lang.Exception { - // Check the server version - ServerDetails version = WEBSERVICE_REMOTE.getServerDetails(subject); - assertNotNull("ServerVersion was not located.", version); - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsAdvisoryManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsAdvisoryManagerTest.java deleted file mode 100644 index 541d961..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsAdvisoryManagerTest.java +++ /dev/null @@ -1,112 +0,0 @@ -/* -* RHQ Management Platform -* Copyright (C) 2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.enterprise.server.ws.test; - -import org.testng.annotations.Test; - -/** - * Web service tests for the advisory manager services. - * - * @author Jason Dobies - */ -@Test(groups = "ws") -public class WsAdvisoryManagerTest extends WsUnitTestBase { - - // Currently no WS interface - - // private static final boolean TESTS_ENABLED = true; - // - // @Test(enabled = TESTS_ENABLED) - // public void createGetDeleteAdvisory() throws Exception { - // - // // Setup - // String label = "WsAdvisoryManagerTest.createGetDeleteAdvisory.label"; - // String synopsis = "WsAdvisoryManagerTest.createGetDeleteAdvisory.synopsis"; - // String type = "bugfix"; - // - // Subject admin = subjectUtil.admin(); - // - // // Test - // Advisory created = service.createAdvisory(admin, label, type, synopsis); - // - // assert created != null; - // - // Advisory retrieved = service.getAdvisoryByName(label); - // - // service.deleteAdvisoryByAdvId(admin, created.getId()); - // - // // Verify - // assert label.equals(created.getAdvisory()) : "Found: " + created.getAdvisory(); - // assert synopsis.equals(created.getSynopsis()) : "Found: " + created.getAdvisoryName(); - // assert type.equals(created.getAdvisoryType()) : "Found: " + created.getAdvisoryType(); - // - // assert retrieved != null; - // assert label.equals(retrieved.getAdvisory()) : "Found: " + retrieved.getAdvisory(); - // assert synopsis.equals(retrieved.getSynopsis()) : "Found: " + retrieved.getAdvisoryName(); - // assert type.equals(retrieved.getAdvisoryType()) : "Found: " + retrieved.getAdvisoryType(); - // - // retrieved = service.getAdvisoryByName(label); - // - // assert retrieved == null; - // } - // - // @Test(enabled = TESTS_ENABLED) - // public void createMapDeleteCve() throws Exception { - // - // // Setup - // String advLabel = "WsAdvisoryManagerTest.createMapDeleteCve.label"; - // String advSynopsis = "WsAdvisoryManagerTest.createMapDeleteCve.synopsis"; - // String advType = "bugfix"; - // - // String cveName = "WsAdvisoryManagerTest.createMapDeleteCve.name"; - // - // Subject admin = subjectUtil.admin(); - // - // PageControl pc = objectFactory.createPageControl(); - // - // // Test & Verify - // Advisory createdAdvisory = service.createAdvisory(admin, advLabel, advType, advSynopsis); - // assert createdAdvisory != null; - // - // Cve createdCve = service.createCVE(admin, cveName); - // assert createdCve != null; - // - // AdvisoryCVE createdMapping = service.createAdvisoryCVE(admin, createdAdvisory, createdCve); - // assert createdMapping != null; - // - // assert advLabel.equals(createdMapping.getAdvisory().getAdvisory()); - // - // List<AdvisoryCVE> cveList = service.getAdvisoryCVEByAdvId(admin, createdAdvisory.getId(), pc); - // assert cveList.size() == 1 : "Found: " + cveList.size(); - // - // service.deleteAdvisoryCVE(admin, createdAdvisory.getId()); - // - // List<AdvisoryCVE> deletedMappings = service.getAdvisoryCVEByAdvId(admin, createdAdvisory.getId(), pc); - // assert deletedMappings != null; - // assert deletedMappings.size() == 0; - // - // // Cleanup - // service.deleteCVE(admin, createdCve.getId()); - // service.deleteAdvisoryByAdvId(admin, createdAdvisory.getId()); - // } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsDistributionManagerTest.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsDistributionManagerTest.java deleted file mode 100644 index 1902fbc..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsDistributionManagerTest.java +++ /dev/null @@ -1,88 +0,0 @@ -/* -* RHQ Management Platform -* Copyright (C) 2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.enterprise.server.ws.test; - -import org.testng.annotations.Test; - -/** - * Web service tests for the distribution manager service. - * - * @author Jason Dobies - */ -@Test(groups = "ws") -public class WsDistributionManagerTest extends WsUnitTestBase { - - // Currently no WS interface - - // private static final boolean TESTS_ENABLED = true; - // - // @Test(enabled = TESTS_ENABLED) - // public void createGetDeleteDistribution() throws Exception { - // - // // Setup - // Subject admin = subjectUtil.admin(); - // String label = "WsDistributionManagerTest.createGetDeleteDistribution.label"; - // String path = "WsDistributionManagerTest.createGetDeleteDistribution.path"; - // - // DistributionType type = objectFactory.createDistributionType(); - // type.setName("WsDistributionManagerTest.createGetDeleteDistribution.type"); - // type.setDescription("WsDistributionManagerTest.createGetDeleteDistribution.desc"); - // - // // Test - // Distribution created = service.createDistribution(admin, label, path, type); - // - // assert created != null; - // - // Distribution byLabel = service.getDistributionByLabel(label); - // Distribution byPath = service.getDistributionByPath(path); - // - // DistributionType typeByName = service.getDistributionTypeByName(type.getName()); - // - // service.deleteDistributionByDistId(admin, created.getId()); - // - // // Verify - // assert byLabel != null; - // assert label.equals(byLabel.getLabel()); - // assert path.equals(byLabel.getBasePath()); - // assert type.getName().equals(byLabel.getDistributionType().getName()); - // - // assert byPath != null; - // assert label.equals(byPath.getLabel()); - // assert path.equals(byPath.getBasePath()); - // assert type.getName().equals(byPath.getDistributionType().getName()); - // - // assert typeByName != null; - // assert type.getName().equals(typeByName.getName()); - // assert type.getDescription().equals(typeByName.getDescription()); - // - // Distribution afterDelete = service.getDistributionByLabel(label); - // assert afterDelete == null; - // - // // Cleanup - // service.deleteDistributionTypeByName(admin, type.getName()); - // DistributionType typeAfterDelete = service.getDistributionTypeByName(type.getName()); - // - // assert typeAfterDelete == null; - // } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsUnitTestBase.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsUnitTestBase.java deleted file mode 100644 index f6ef8d2..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/WsUnitTestBase.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -* RHQ Management Platform -* Copyright (C) 2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.enterprise.server.ws.test; - -import java.net.URL; - -import javax.xml.namespace.QName; - -import org.testng.AssertJUnit; -import org.testng.annotations.BeforeClass; - -import org.rhq.enterprise.server.ws.ObjectFactory; -import org.rhq.enterprise.server.ws.TestPropertiesInterface; -import org.rhq.enterprise.server.ws.WebservicesManagerBeanService; -import org.rhq.enterprise.server.ws.WebservicesRemote; -import org.rhq.enterprise.server.ws.test.util.WsResourceUtility; -import org.rhq.enterprise.server.ws.test.util.WsSubjectUtility; -import org.rhq.enterprise.server.ws.utility.WsUtility; - -/** - * Base class for all webservice unit tests. This class runs the setup and teardown - * necessary to establish and release the connection to the remote server. Subclasses - * can use the variables initialized here for testing purposes. - * - * @author Jason Dobies - */ -public class WsUnitTestBase extends AssertJUnit implements TestPropertiesInterface { - - protected WebservicesRemote service; - protected ObjectFactory objectFactory; - - protected WsSubjectUtility subjectUtil; - protected WsResourceUtility resourceUtil; - - @BeforeClass - public void setup() throws Exception { - - // Variables needed - URL gUrl = WsUtility.generateRemoteWebserviceURL(WebservicesManagerBeanService.class, host, port, useSSL); - QName gQName = WsUtility.generateRemoteWebserviceQName(WebservicesManagerBeanService.class); - - // Establish outbound webservices connections - WebservicesManagerBeanService jws = new WebservicesManagerBeanService(gUrl, gQName); - service = jws.getWebservicesManagerBeanPort(); - - objectFactory = new ObjectFactory(); - - subjectUtil = new WsSubjectUtility(service); - resourceUtil = new WsResourceUtility(service); - } - -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsResourceUtility.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsResourceUtility.java deleted file mode 100644 index 2101515..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsResourceUtility.java +++ /dev/null @@ -1,115 +0,0 @@ -/* -* RHQ Management Platform -* Copyright (C) 2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.enterprise.server.ws.test.util; - -import java.util.List; - -import org.rhq.enterprise.server.ws.ObjectFactory; -import org.rhq.enterprise.server.ws.Resource; -import org.rhq.enterprise.server.ws.ResourceCriteria; -import org.rhq.enterprise.server.ws.ResourceType; -import org.rhq.enterprise.server.ws.ResourceTypeCriteria; -import org.rhq.enterprise.server.ws.Subject; -import org.rhq.enterprise.server.ws.WebservicesRemote; - -/** - * Utility functions for working with resources via web service calls. - * - * @author Jason Dobies - */ -public class WsResourceUtility { - - private WebservicesRemote service; - private WsSubjectUtility subjectUtil; - private ObjectFactory objectFactory; - - /** - * Initializes a new instance to use the given connection to a running server. - * - * @param service must be in a state where remote calls can be made (i.e. the server is running) - */ - public WsResourceUtility(WebservicesRemote service) { - this.service = service; - this.subjectUtil = new WsSubjectUtility(service); - this.objectFactory = new ObjectFactory(); - } - - /** - * Creates and returns a new platform in the system with a randomly generated name. The platform will be - * of type 'Linux'. - * <p/> - * Resources created in this way should be removed via {@link #deleteResource(int)} at the end of the test run. - * - * @return WS representation of the created platform - * @throws Exception if the platform cannot be created successfully - * @see #deleteResource(int) - */ - public Resource randomPlatform() throws Exception { - - long randomSeed = System.currentTimeMillis(); - Subject admin = subjectUtil.admin(); - - // Use the default Linux platform - ResourceTypeCriteria typeCriteria = objectFactory.createResourceTypeCriteria(); - typeCriteria.setFilterName("Linux"); - List<ResourceType> types = service.findResourceTypesByCriteria(admin, typeCriteria); - - if (types.size() != 1) { - throw new RuntimeException("Unexpected number of resource types returned for " + - "type [Linux]. Expected [1], Found [" + types.size() + "]"); - } - - // Information about the resource being created - String name = "Test Platform " + randomSeed; - - Resource resource = objectFactory.createResource(); - resource.setName(name); - resource.setResourceKey(name); - resource.setDescription("WsResourceUtility Created"); - resource.setVersion("1.0"); - resource.setResourceType(types.get(0)); - - // Retrieve for return - ResourceCriteria criteria = objectFactory.createResourceCriteria(); - criteria.setFilterName(name); - List<Resource> resources = service.findResourcesByCriteria(admin, criteria); - - if (resources.size() != 1) { - throw new RuntimeException("Unexpected number of resources returned for name [" + - name + "]. Expected [1], Found [" + resources.size() + "]"); - } - - return resources.get(0); - } - - /** - * Deletes the indicated resource from the server. - * - * @param resourceId must refer to an existing resource in the server - * @throws Exception if the resource cannot be deleted - */ - public void deleteResource(int resourceId) throws Exception { - Subject admin = subjectUtil.admin(); - service.deleteResource(admin, resourceId); - } -} diff --git a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsSubjectUtility.java b/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsSubjectUtility.java deleted file mode 100644 index fca9dad..0000000 --- a/modules/enterprise/remoting/webservices/src/test/java/org/rhq/enterprise/server/ws/test/util/WsSubjectUtility.java +++ /dev/null @@ -1,153 +0,0 @@ -/* -* RHQ Management Platform -* Copyright (C) 2009 Red Hat, Inc. -* All rights reserved. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License, version 2, as -* published by the Free Software Foundation, and/or the GNU Lesser -* General Public License, version 2.1, also as published by the Free -* Software Foundation. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License and the GNU Lesser General Public License -* for more details. -* -* You should have received a copy of the GNU General Public License -* and the GNU Lesser General Public License along with this program; -* if not, write to the Free Software Foundation, Inc., -* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -package org.rhq.enterprise.server.ws.test.util; - -import java.util.ArrayList; -import java.util.List; - -import org.rhq.enterprise.server.ws.ObjectFactory; -import org.rhq.enterprise.server.ws.Role; -import org.rhq.enterprise.server.ws.RoleCriteria; -import org.rhq.enterprise.server.ws.Subject; -import org.rhq.enterprise.server.ws.WebservicesRemote; - -/** - * @author Jason Dobies - */ -public class WsSubjectUtility { - - private static final String ADMIN_USERNAME = "rhqadmin"; - private static final String ADMIN_PASSWORD = "rhqadmin"; - - private WebservicesRemote service; - private ObjectFactory objectFactory; - - /** - * Initializes a new instance to use the given connection to a running server. - * - * @param service must be in a state where remote calls can be made (i.e. the server is running) - */ - public WsSubjectUtility(WebservicesRemote service) { - this.service = service; - this.objectFactory = new ObjectFactory(); - } - - /** - * Logs in and returns a WS representation of the default admin user. - * - * @return WS subject representing the default admin - * @throws Exception if there is an error in the remote call - * @see #ADMIN_USERNAME - * @see #ADMIN_PASSWORD - */ - public Subject admin() throws Exception { - Subject admin = service.login(ADMIN_USERNAME, ADMIN_PASSWORD); - return admin; - } - - /** - * Retrieves a WS subject object for the given credentials. If the user does not exist, - * it will be created first, assigning it to all roles in the system. The subject will be logged - * in as part of this call. - * <p/> - * Calls to this should be accompanied by a call to {#deleteUser(String} to clean up. - * - * @param username may not be <code>null</code> - * @param password may not be <code>null</code> - * @return WS subject object that can be used for remote calls that require a subject - * @throws Exception if anything goes wrong, most likely in the remote calls - * @see #deleteUser(int) - */ - public Subject createOrLoginUser(String username, String password) throws Exception { - - // If the user already exists, return that - try { - Subject user = service.login(username, password); - if (user != null) { - return user; - } - } - catch (Throwable e) { - // Will occur if the user does not exist, so this should occur often - } - - // Otherwise, create the user - Subject newUser = new Subject(); - newUser.setName(username); - newUser.setFirstName("WsSubjectUtility Created"); - newUser.setLastName("WsSubjectUtility Created"); - newUser.setEmailAddress(username + "@wssubjectutility"); - newUser.setDepartment("WsSubjectUtility Created"); - - Subject admin = admin(); - Subject created = service.createSubject(admin, newUser); - - service.createPrincipal(admin, username, password); - - // Assign to all roles - RoleCriteria criteria = objectFactory.createRoleCriteria(); - List<Role> allRoles = service.findRolesByCriteria(admin, criteria); - List<Integer> roleIds = rolesToIds(allRoles); - - service.addRolesToSubject(admin, created.getId(), roleIds); - - return created; - } - - /** - * Deletes an existing user from the system. - * - * @param subjectId must represent a valid subject in the system - * @throws Exception if there is an error in the remoting - * @see #deleteUsers(List) - */ - public void deleteUser(int subjectId) throws Exception { - List<Integer> deleteUs = new ArrayList<Integer>(1); - deleteUs.add(subjectId); - service.deleteSubjects(admin(), deleteUs); - } - - /** - * Deletes a number of users from the system. - * - * @param deleteUs IDs of one or more users in the system to delete - * @throws Exception if there is an error in the remoting - */ - public void deleteUsers(List<Integer> deleteUs) throws Exception { - service.deleteSubjects(admin(), deleteUs); - } - - /** - * Simple transformer from list of {@link Role} objects to a list of their respective IDs. - * - * @param roles cannot be <code>null</code> - * @return new list of the same size as <code>roles</code> - */ - private List<Integer> rolesToIds(List<Role> roles) { - List<Integer> roleIds = new ArrayList<Integer>(roles.size()); - for (Role role : roles) { - roleIds.add(role.getId()); - } - return roleIds; - } -} diff --git a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml index 093e3fe..41fba6e 100644 --- a/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml +++ b/modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml @@ -228,8 +228,6 @@ <include name="jconsole.*" /> <include name="run.*" /> <include name="vault.*" /> - <include name="wsconsume.*" /> - <include name="wsprovide.*" /> </fileset> </delete> <delete dir="${jboss.home}/bin/init.d" /> @@ -373,7 +371,6 @@ rhq.server.maintenance-mode-at-startup=false # General Properties rhq.server.startup.web.http.port=${rhq.server.http.port} rhq.server.startup.web.https.port=${rhq.server.https.port} -rhq.server.startup.webservice.port=9093 rhq.server.startup.namingservice.port=2099 rhq.server.startup.namingservice.rmiport=2098 rhq.server.startup.jrmpinvoker.rmiport=7444 diff --git a/modules/enterprise/server/container/pom.xml b/modules/enterprise/server/container/pom.xml index 2f0dcbd..c6fedfc 100644 --- a/modules/enterprise/server/container/pom.xml +++ b/modules/enterprise/server/container/pom.xml @@ -98,12 +98,6 @@ </dependency>
<dependency> - <groupId>org.jboss.jbossws</groupId> - <artifactId>jbossws-native-dist</artifactId> - <type>zip</type> - <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> - </dependency> - <dependency> <groupId>org.codehaus.groovy</groupId> <artifactId>groovy-all</artifactId> <version>1.7.3</version> @@ -196,9 +190,6 @@ <property name="rhq.server.http.port" value="${rhq.server.http.port}" /> <property name="rhq.server.https.port" value="${rhq.server.https.port}" />
- <property name="rhq.server.enable.ws" value="${rhq.server.enable.ws}" /> - <property name="jbossws-native-dist.version" value="${jbossws-native-dist.version}" /> - <property name="rhq.sync.endpoint-address" value="${rhq.sync.endpoint-address}" /> </ant> </target> diff --git a/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/ejb3.deployer/META-INF/jboss-service.xml b/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/ejb3.deployer/META-INF/jboss-service.xml index 86d0b9b..4e9bc3e 100644 --- a/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/ejb3.deployer/META-INF/jboss-service.xml +++ b/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/ejb3.deployer/META-INF/jboss-service.xml @@ -51,7 +51,6 @@ console-mgr-classes.jar, jfreechart.jar, juddi-service.jar, - wsdl4j.jar, commons-collections.jar, commons-pool.jar, juddi.jar, @@ -89,9 +88,7 @@ jboss-ejb3.jar, dom4j.jar, commons-codec-1.2.jar, - wsdl4j.jar, xmlsec.jar, - jbossws.jar, jboss-bean-deployer.jar, jboss-microcontainer.jar, jboss-dependency.jar, diff --git a/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws-management.war/WEB-INF/web.xml b/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws-management.war/WEB-INF/web.xml deleted file mode 100644 index bbcaa42..0000000 --- a/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws-management.war/WEB-INF/web.xml +++ /dev/null @@ -1,78 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> - -<!-- - A web application that installs the JBossWS servlets ---> - -<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd%22%3E - - <display-name>JBossWS</display-name> - - <servlet> - <servlet-name>ContextServlet</servlet-name> - <servlet-class>org.jboss.wsf.framework.management.ContextServlet</servlet-class> - </servlet> - - <servlet> - <servlet-name>PortComponentLinkServlet</servlet-name> - <servlet-class>org.jboss.ws.core.server.PortComponentLinkServlet</servlet-class> - </servlet> - - <!-- now the mappings --> - - <servlet-mapping> - <servlet-name>ContextServlet</servlet-name> - <url-pattern>/services/*</url-pattern> - </servlet-mapping> - - <servlet-mapping> - <servlet-name>PortComponentLinkServlet</servlet-name> - <url-pattern>/pclink</url-pattern> - </servlet-mapping> - - <!-- A security constraint that restricts access - <security-constraint> - <web-resource-collection> - <web-resource-name>ContextServlet</web-resource-name> - <description>An example security config that only allows users with the - role 'friend' to access the JBossWS console web application - </description> - <url-pattern>/*</url-pattern> - </web-resource-collection> - <auth-constraint> - <role-name>friend</role-name> - </auth-constraint> - </security-constraint> - --> - - <login-config> - <auth-method>BASIC</auth-method> - <realm-name>JBossWS Management Console</realm-name> - </login-config> - - <security-role> - <role-name>friend</role-name> - </security-role> - - <!-- - currently the W3C haven't settled on a media type for WSDL; - http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft - for now we go with the basic 'it's XML' response - --> - <mime-mapping> - <extension>wsdl</extension> - <mime-type>text/xml</mime-type> - </mime-mapping> - - <mime-mapping> - <extension>xsd</extension> - <mime-type>text/xml</mime-type> - </mime-mapping> - - <welcome-file-list id="WelcomeFileList"> - <welcome-file>index.html</welcome-file> - </welcome-file-list> - -</web-app> diff --git a/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml b/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml deleted file mode 100644 index 5d0c8b5..0000000 --- a/modules/enterprise/server/container/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml +++ /dev/null @@ -1,504 +0,0 @@ - - <!-- - This is the standard version of this file provided by JBossWS 3.1.1 (the updated version we use with AS 4.2.3). - This file needs to be updated when the version of jbossws or the version of AS is updated. It is updated only with - the declaration of our SafeEndpointInvoker. - --> -<deployment xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:bean-deployer bean-deployer_1_0.xsd" - xmlns="urn:jboss:bean-deployer"> <!-- An abstraction of server configuration aspects. --> - <bean name="WSServerConfig" class="org.jboss.wsf.stack.jbws.NativeServerConfig"> - <property name="mbeanServer"> - <inject bean="WSMBeanServerLocator" property="mbeanServer" /> - </property> - - <!-- - The WSDL, that is a required deployment artifact for an endpoint, has a <soap:address> element which points to - the location of the endpoint. JBoss supports rewriting of that SOAP address. If the content of <soap:address> - is a valid URL, JBossWS will not rewrite it unless 'modifySOAPAddress' is true. If the content of - <soap:address> is not a valid URL, JBossWS will rewrite it using the attribute values given below. If - 'webServiceHost' is not set, JBossWS uses requesters protocol host when rewriting the <soap:address>. - --> - <property name="webServiceHost">${jboss.bind.address}</property> - <property name="modifySOAPAddress">true</property> - - <!-- - Set these properties to explicitly define the ports that will be used for rewriting the SOAP address. Otherwise - the ports will be identified by querying the list of installed connectors. If multiple connectors are found the - port of the first connector is used. <property name="webServiceSecurePort">8443</property> <property - name="webServicePort">8080</property> - --> - </bean> - - <!-- The registry for web service endpoints --> - <bean name="WSEndpointRegistry" class="org.jboss.wsf.framework.management.ManagedEndpointRegistry"> - <property name="mbeanServer"> - <inject bean="WSMBeanServerLocator" property="mbeanServer" /> - </property> - </bean> - - <!-- A subscription manager for WS-Eventing --> - <bean name="WSSubscriptionManager" class="org.jboss.ws.extensions.eventing.mgmt.SubscriptionManager"> - <property name="bindAddress">${jboss.bind.address}</property> - </bean> - - <!-- Installed Record Processors--> - <bean name="WSMemoryBufferRecorder" class="org.jboss.wsf.framework.management.recording.MemoryBufferRecorder"> - <property name="recording">false</property> - </bean> - <bean name="WSLogRecorder" class="org.jboss.wsf.framework.management.recording.LogRecorder"> - <property name="recording">false</property> - </bean> - - <!-- - The stack specific deployment aspects - --> - <bean name="WSNativeContextPropertiesDeploymentAspect" class="org.jboss.wsf.framework.deployment.ContextPropertiesDeploymentAspect"> - <property name="provides">ContextProperties, StackDescriptor</property> - <property name="contextProperties"> - <map keyClass="java.lang.String" valueClass="java.lang.String"> - <entry> - <key>org.jboss.ws.webapp.ServletClass</key> - <value>org.jboss.wsf.stack.jbws.EndpointServlet</value> - </entry> - </map> - </property> - </bean> - - <bean name="WSNativeEagerInitializeDeploymentAspect" class="org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect"> - <property name="requires">UnifiedMetaDataModel</property> - <property name="provides">InitializedMetaDataModel</property> - </bean> - - <bean name="WSNativeEndpointHandlerDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect"> - <property name="requires">ContainerEndpointHandler, ContainerMetaData</property> - <property name="provides">StackEndpointHandler</property> - </bean> - - <bean name="WSNativeEndpointRecordProcessorDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointRecordProcessorDeploymentAspect"> - <property name="mbeanServer"> - <inject bean="WSMBeanServerLocator" property="mbeanServer" /> - </property> - <property name="requires">RegisteredEndpoint</property> - <property name="provides">EndpointRecordProcessors</property> - <property name="processors"> - <list class="java.util.ArrayList" elementClass="org.jboss.wsf.spi.management.recording.RecordProcessor"> - <inject bean="WSMemoryBufferRecorder" /> - <inject bean="WSLogRecorder" /> - </list> - </property> - </bean> - - <bean name="WSNativeEventingDeploymentAspect" class="org.jboss.wsf.stack.jbws.EventingDeploymentAspect"> - <property name="requires">UnifiedMetaDataModel</property> - </bean> - - <bean name="WSNativePublishContractDeploymentAspect" class="org.jboss.wsf.stack.jbws.PublishContractDeploymentAspect"> - <property name="requires">UnifiedMetaDataModel, JAXBIntros</property> - <property name="provides">PublishedContract</property> - </bean> - - <!-- - Replace this with our SafeInvoker defined just below. The SafeInvoker repairs issues left behind by Hibernate lazy - loading <bean name="WSNativeServiceEndpointInvokerDeploymentAspect" - class="org.jboss.wsf.stack.jbws.ServiceEndpointInvokerDeploymentAspect"> <property - name="requires">UnifiedMetaDataModel</property> </bean> - --> - - <bean name="WSNativeServiceEndpointInvokerDeploymentAspect" class="org.rhq.enterprise.server.util.EJB3SafeEndpointInvokerDeploymentAspect"> - <property name="requires">UnifiedMetaDataModel</property> - </bean> - - <bean name="WSNativeRMDeploymentAspect" class="org.jboss.ws.extensions.wsrm.server.RMDeploymentAspect"> - <property name="requires">StackEndpointHandler, UnifiedMetaDataModel</property> - </bean> - - <bean name="WSNativeUnifiedMetaDataDeploymentAspect" class="org.jboss.wsf.stack.jbws.UnifiedMetaDataDeploymentAspect"> - <property name="requires">RuntimeLoader, ContainerMetaData, URLPattern, VFSRoot, JAXBIntros</property> - <property name="provides">UnifiedMetaDataModel</property> - </bean> - - <bean name="WSJAXBIntroDeploymentAspect" class="org.jboss.wsf.stack.jbws.JAXBIntroDeploymentAspect"> - <property name="provides">JAXBIntros</property> - </bean> - - <!-- Deployment aspect installers --> - <!-- Phase 1 --> - <bean name="WSNativeDeploymentAspectInstallerPreJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerPreJSE" /> - </property> - <property name="sortAspectsOnCreate">true</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSNativeContextPropertiesDeploymentAspect" /> - </set> - </property> - <depends>WSDeploymentAspectInstallerPreJSE</depends> - </bean> - <!-- Phase 2 --> - <bean name="WSNativeDeploymentAspectInstallerPostJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerPostJSE" /> - </property> - <property name="sortAspectsOnCreate">true</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSNativeEndpointHandlerDeploymentAspect" /> - <inject bean="WSNativeEndpointRecordProcessorDeploymentAspect" /> - <inject bean="WSNativeEventingDeploymentAspect" /> - <inject bean="WSNativePublishContractDeploymentAspect" /> - <inject bean="WSNativeServiceEndpointInvokerDeploymentAspect" /> - <inject bean="WSNativeRMDeploymentAspect" /> - <inject bean="WSNativeUnifiedMetaDataDeploymentAspect" /> - <inject bean="WSNativeEagerInitializeDeploymentAspect" /> - <inject bean="WSJAXBIntroDeploymentAspect" /> - </set> - </property> - <depends>WSDeploymentAspectInstallerPostJSE</depends> - </bean> - - <bean name="WSNativeDeploymentAspectInstallerEJB" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerEJB" /> - </property> - <property name="sortAspectsOnCreate">true</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSNativeContextPropertiesDeploymentAspect" /> - <inject bean="WSNativeEagerInitializeDeploymentAspect" /> - <inject bean="WSNativeEndpointHandlerDeploymentAspect" /> - <inject bean="WSNativeEndpointRecordProcessorDeploymentAspect" /> - <inject bean="WSNativeEventingDeploymentAspect" /> - <inject bean="WSNativePublishContractDeploymentAspect" /> - <inject bean="WSNativeServiceEndpointInvokerDeploymentAspect" /> - <inject bean="WSNativeRMDeploymentAspect" /> - <inject bean="WSNativeUnifiedMetaDataDeploymentAspect" /> - <inject bean="WSJAXBIntroDeploymentAspect" /> - </set> - </property> - <depends>WSDeploymentAspectInstallerEJB</depends> - </bean> - - <bean name="WSNativeDeploymentAspectInstallerEndpointAPI" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerEndpointAPI" /> - </property> - <property name="sortAspectsOnCreate">true</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSNativeContextPropertiesDeploymentAspect" /> - <inject bean="WSNativeEagerInitializeDeploymentAspect" /> - <inject bean="WSNativeEndpointHandlerDeploymentAspect" /> - <inject bean="WSNativeEndpointRecordProcessorDeploymentAspect" /> - <inject bean="WSNativeEventingDeploymentAspect" /> - <inject bean="WSNativePublishContractDeploymentAspect" /> - <inject bean="WSNativeServiceEndpointInvokerDeploymentAspect" /> - <inject bean="WSNativeRMDeploymentAspect" /> - <inject bean="WSNativeUnifiedMetaDataDeploymentAspect" /> - <inject bean="WSJAXBIntroDeploymentAspect" /> - </set> - </property> - <depends>WSDeploymentAspectInstallerEndpointAPI</depends> - </bean> - <!-- Locate the single instance of the kernel --> - <bean name="WSKernelLocator" class="org.jboss.wsf.spi.util.KernelLocator"> - <property name="kernel"> - <inject bean="jboss.kernel:service=Kernel" /> - </property> - </bean> - - <!-- Locate the single instance of the MBeanServer --> - <bean name="WSMBeanServerLocator" class="org.jboss.wsf.framework.management.MBeanServerLocator" /> - - <!-- The HTTPServer used by the JAXWS Endpoint API --> - <bean name="WSHTTPServer" class="org.jboss.wsf.container.jboss42.DeploymentAspectHttpServer" /> - - <!-- Bind Service objects in client environment context --> - <bean name="WSServiceRefHandler" class="org.jboss.wsf.container.jboss42.serviceref.ServiceRefHandlerImpl" /> - - <!-- JBoss_4_2_0_GA uses this hardcoded bean name --> - <bean name="ServiceRefHandler" class="org.jboss.wsf.container.jboss42.serviceref.ServiceRefHandlerImpl" /> - - <!-- - ********************************************************************************************************************* - Web Service deployment There are three deployer interceptors registered with the JBoss Deployers. 1) - DeployerInterceptorJSE 2) DeployerInterceptorEJB21 3) DeployerInterceptorEJB3 Each interceptor has a number of - DeployerHooks registerd with it Conceptually, each of these hooks implements the following pattern: - - DployerHook.deploy(unit) if(isWebServiceDeployment) Deployment dep = createDeployment(unit) - DeploymentAspectManager.deploy(dep) DeployerHook.undeploy(unit) Deployment dep = getDeployment(unit) - DeploymentAspectManager.undeploy(dep) Each deployer hook has a web service DeployerManager injected into it. A web - service DeployerManager maintains a list of Deployers, each of which handles a single aspect of web service - deployment. Finally, each Endpoint is registered with the EndpointRegistry. - - ********************************************************************************************************************* - --> - - <!-- - Register DeployerHooks with JBoss deployers - --> - - <!-- Phase 1 --> - <bean name="WSDeployerHook_JAXRPC_PRE_JSE" class="org.jboss.wsf.container.jboss42.JAXRPCDeployerHookPreJSE"> - <property name="deploymentManagerName">WSDeploymentAspectManagerPreJSE</property> - <property name="phaseOneInterceptors"> - <list class="java.util.LinkedList" elementClass="javax.management.ObjectName"> - <value>jboss.ws:service=DeployerInterceptorJSE</value> - </list> - </property> - </bean> - - <!-- Phase 2 --> - <bean name="WSDeployerHook_JAXRPC_POST_JSE" class="org.jboss.wsf.container.jboss42.JAXRPCDeployerHookPostJSE"> - <property name="deploymentManagerName">WSDeploymentAspectManagerPostJSE</property> - <property name="phaseTwoInterceptors"> - <list class="java.util.LinkedList" elementClass="javax.management.ObjectName"> - <value>jboss.ws:service=DeployerInterceptorJSE</value> - </list> - </property> - </bean> - - <bean name="WSDeployerHook_JAXRPC_EJB21" class="org.jboss.wsf.container.jboss42.JAXRPCDeployerHookEJB21"> - <property name="deploymentManagerName">WSDeploymentAspectManagerEJB</property> - <property name="phaseTwoInterceptors"> - <list class="java.util.LinkedList" elementClass="javax.management.ObjectName"> - <value>jboss.ws:service=DeployerInterceptorEJB21</value> - </list> - </property> - </bean> - - <!-- Phase 1 --> - <bean name="WSDeployerHook_JAXWS_PRE_JSE" class="org.jboss.wsf.container.jboss42.JAXWSDeployerHookPreJSE"> - <property name="deploymentManagerName">WSDeploymentAspectManagerPreJSE</property> - <property name="phaseOneInterceptors"> - <list class="java.util.LinkedList" elementClass="javax.management.ObjectName"> - <value>jboss.ws:service=DeployerInterceptorJSE</value> - </list> - </property> - </bean> - - <!-- Phase 2 --> - <bean name="WSDeployerHook_JAXWS_POST_JSE" class="org.jboss.wsf.container.jboss42.JAXWSDeployerHookPostJSE"> - <property name="deploymentManagerName">WSDeploymentAspectManagerPostJSE</property> - <property name="phaseTwoInterceptors"> - <list class="java.util.LinkedList" elementClass="javax.management.ObjectName"> - <value>jboss.ws:service=DeployerInterceptorJSE</value> - </list> - </property> - </bean> - - <bean name="WSDeployerHook_JAXWS_EJB3" class="org.jboss.wsf.container.jboss42.JAXWSDeployerHookEJB3"> - <property name="deploymentManagerName">WSDeploymentAspectManagerEJB</property> - <property name="phaseTwoInterceptors"> - <list class="java.util.LinkedList" elementClass="javax.management.ObjectName"> - <value>jboss.ws:service=DeployerInterceptorEJB3</value> - </list> - </property> - </bean> - - <!-- - Each DeploymentAspectManger maintains a list of DeploymentAspects - --> - <bean name="WSDeploymentAspectManagerPreJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl"> - <property name="name">WSDeploymentAspectManagerPreJSE</property> - </bean> - <bean name="WSDeploymentAspectManagerPostJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl"> - <property name="parent"> - <inject bean="WSDeploymentAspectManagerPreJSE" /> - </property> - <property name="name">WSDeploymentAspectManagerPostJSE</property> - </bean> - <bean name="WSDeploymentAspectManagerEJB" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl"> - <property name="name">WSDeploymentAspectManagerEJB</property> - </bean> - <bean name="WSDeploymentAspectManagerEndpointAPI" class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl"> - <property name="name">WSDeploymentAspectManagerEndpointAPI</property> - </bean> - - <!-- - The container deployment aspects - --> - <bean name="WSContainerMetaDataDeploymentAspect" class="org.jboss.wsf.container.jboss42.ContainerMetaDataDeploymentAspect"> - <property name="provides">ContainerMetaData, VFSRoot</property> - <property name="metaDataAdapter"> - <inject bean="WSContainerMetaDataAdapter" /> - </property> - </bean> - - <bean name="WSContextRootDeploymentAspect" class="org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect"> - <property name="requires">ContainerMetaData</property> - <property name="provides">ContextRoot</property> - </bean> - - <bean name="WSEndpointAPIDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointAPIDeploymentAspect"> - <property name="provides">ContainerMetaData, RuntimeLoader, URLPattern, VFSRoot</property> - </bean> - - <bean name="WSEndpointAddressDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointAddressDeploymentAspect"> - <property name="requires">URLPattern</property> - <property name="provides">EndpointAddress</property> - </bean> - - <bean name="WSEndpointHandlerDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointHandlerDeploymentAspect"> - <property name="requires">ContainerMetaData</property> - <property name="provides">ContainerEndpointHandler</property> - </bean> - - <bean name="WSEndpointLifecycleDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointLifecycleDeploymentAspect"> - <property name="requires">LAST_DEPLOYMENT_ASPECT</property> - </bean> - - <bean name="WSEndpointMetricsDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointMetricsDeploymentAspect"> - <property name="provides">EndpointMetrics</property> - </bean> - - <bean name="WSEndpointNameDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointNameDeploymentAspect"> - <property name="requires">URLPattern</property> - <property name="provides">EndpointName</property> - </bean> - - <bean name="WSEndpointRegistryDeploymentAspect" class="org.jboss.wsf.framework.deployment.EndpointRegistryDeploymentAspect"> - <property name="requires">EndpointName</property> - <property name="provides">RegisteredEndpoint</property> - </bean> - - <bean name="WSModifyWebMetaDataDeploymentAspect" class="org.jboss.wsf.container.jboss42.ModifyWebMetaDataDeploymentAspect"> - <property name="requires">ContextProperties, ContainerMetaData, StackDescriptor</property> - <property name="webXMLRewriter"> - <inject bean="WSWebXMLRewriter" /> - </property> - </bean> - - <bean name="WSRuntimeLoaderDeploymentAspect" class="org.jboss.wsf.container.jboss42.RuntimeLoaderDeploymentAspect"> - <property name="requires">ContainerMetaData</property> - <property name="provides">RuntimeLoader</property> - </bean> - - <bean name="WSURLPatternDeploymentAspect" class="org.jboss.wsf.framework.deployment.BackwardCompatibleURLPatternDeploymentAspect"> - <property name="requires">ContextRoot, ContainerMetaData</property> - <property name="provides">URLPattern</property> - </bean> - - <bean name="WSWebAppDeploymentAspect" class="org.jboss.wsf.container.jboss42.WebAppDeploymentAspect"> - <property name="requires">WebMetaData, ContextProperties</property> - <property name="webXMLRewriter"> - <inject bean="WSWebXMLRewriter" /> - </property> - </bean> - - <bean name="WSWebAppGeneratorDeploymentAspect" class="org.jboss.wsf.framework.deployment.WebAppGeneratorDeploymentAspect"> - <property name="requires">URLPattern</property> - <property name="provides">WebMetaData</property> - <property name="securityHandlerEJB21"> - <inject bean="WSSecurityHandlerEJB21" /> - </property> - <property name="securityHandlerEJB3"> - <inject bean="WSSecurityHandlerEJB3" /> - </property> - </bean> - - <!-- Deployment aspect helper beans --> - <bean name="WSApplicationMetaDataAdapterEJB21" class="org.jboss.wsf.container.jboss42.EJBArchiveMetaDataAdapterEJB21" /> - <bean name="WSApplicationMetaDataAdapterEJB3" class="org.jboss.wsf.container.jboss42.EJBArchiveMetaDataAdapterEJB3" /> - <bean name="WSContainerMetaDataAdapter" class="org.jboss.wsf.container.jboss42.ContainerMetaDataAdapter"> - <property name="applicationMetaDataAdapterEJB21"> - <inject bean="WSApplicationMetaDataAdapterEJB21" /> - </property> - <property name="applicationMetaDataAdapterEJB3"> - <inject bean="WSApplicationMetaDataAdapterEJB3" /> - </property> - <property name="webMetaDataAdapter"> - <inject bean="WSWebMetaDataAdapter" /> - </property> - </bean> - <bean name="WSSecurityHandlerEJB21" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB21" /> - <bean name="WSSecurityHandlerEJB3" class="org.jboss.wsf.container.jboss42.SecurityHandlerEJB3" /> - <bean name="WSWebAppDesciptorModifier" class="org.jboss.wsf.container.jboss42.DefaultWebAppDesciptorModifierImpl" /> - <bean name="WSWebMetaDataAdapter" class="org.jboss.wsf.container.jboss42.JSEArchiveMetaDataAdapter" /> - <bean name="WSWebXMLRewriter" class="org.jboss.wsf.container.jboss42.WebXMLRewriterImpl"> - <property name="desciptorModifier"> - <inject bean="WSWebAppDesciptorModifier" /> - </property> - </bean> - - <!-- Deployment aspect installers --> - <!-- Phase 1 --> - <bean name="WSDeploymentAspectInstallerPreJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerPreJSE" /> - </property> - <property name="sortAspectsOnCreate">false</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSContainerMetaDataDeploymentAspect" /> - <inject bean="WSContextRootDeploymentAspect" /> - <inject bean="WSEndpointAddressDeploymentAspect" /> - <inject bean="WSEndpointHandlerDeploymentAspect" /> - <inject bean="WSEndpointMetricsDeploymentAspect" /> - <inject bean="WSEndpointNameDeploymentAspect" /> - <inject bean="WSEndpointRegistryDeploymentAspect" /> - <inject bean="WSModifyWebMetaDataDeploymentAspect" /> - <inject bean="WSURLPatternDeploymentAspect" /> - </set> - </property> - </bean> - - <!-- Phase 2 --> - <bean name="WSDeploymentAspectInstallerPostJSE" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerPostJSE" /> - </property> - <property name="sortAspectsOnCreate">false</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSEndpointLifecycleDeploymentAspect" /> - <inject bean="WSRuntimeLoaderDeploymentAspect" /> - </set> - </property> - <depends>WSDeploymentAspectInstallerPreJSE</depends> - </bean> - - <bean name="WSDeploymentAspectInstallerEJB" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerEJB" /> - </property> - <property name="sortAspectsOnCreate">false</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSContainerMetaDataDeploymentAspect" /> - <inject bean="WSContextRootDeploymentAspect" /> - <inject bean="WSEndpointAddressDeploymentAspect" /> - <inject bean="WSEndpointHandlerDeploymentAspect" /> - <inject bean="WSEndpointLifecycleDeploymentAspect" /> - <inject bean="WSEndpointMetricsDeploymentAspect" /> - <inject bean="WSEndpointNameDeploymentAspect" /> - <inject bean="WSEndpointRegistryDeploymentAspect" /> - <inject bean="WSRuntimeLoaderDeploymentAspect" /> - <inject bean="WSURLPatternDeploymentAspect" /> - <inject bean="WSWebAppDeploymentAspect" /> - <inject bean="WSWebAppGeneratorDeploymentAspect" /> - </set> - </property> - </bean> - - <bean name="WSDeploymentAspectInstallerEndpointAPI" class="org.jboss.wsf.framework.deployment.DeploymentAspectInstaller"> - <property name="manager"> - <inject bean="WSDeploymentAspectManagerEndpointAPI" /> - </property> - <property name="sortAspectsOnCreate">false</property> - <property name="aspects"> - <set class="java.util.HashSet" elementClass="org.jboss.wsf.spi.deployment.DeploymentAspect"> - <inject bean="WSEndpointAPIDeploymentAspect" /> - <inject bean="WSEndpointAddressDeploymentAspect" /> - <inject bean="WSEndpointHandlerDeploymentAspect" /> - <inject bean="WSEndpointLifecycleDeploymentAspect" /> - <inject bean="WSEndpointMetricsDeploymentAspect" /> - <inject bean="WSEndpointNameDeploymentAspect" /> - <inject bean="WSEndpointRegistryDeploymentAspect" /> - <inject bean="WSWebAppDeploymentAspect" /> - <inject bean="WSWebAppGeneratorDeploymentAspect" /> - </set> - </property> - </bean> - -</deployment> \ No newline at end of file diff --git a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml index 50303b5..0480080 100644 --- a/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml +++ b/modules/enterprise/server/container/src/main/scripts/rhq-container.build.xml @@ -73,9 +73,6 @@ <echo>*** Database type is ${rhq.server.database.type-mapping}</echo>
<property name="jboss.home" location="${project.build.outputDirectory}/jbossas" /> - <!-- The expanded native directory name --> - <property name="jboss-native-dir" value="jbossws-native-bin-dist" /> - <property name="jbossws-native.home" location="${project.build.outputDirectory}/${jboss-native-dir}" />
<!-- TODO: we no longer deploy hypersonic - so we no longer have a marker file that we can check to see if server is running --> <!-- @@ -147,12 +144,6 @@ </and> </condition>
- <condition property="undeploy-web-services" value="true"> - <not> - <equals arg1="${rhq.server.enable.ws}" arg2="true" /> - </not> - </condition> - <!-- developers might want to deploy agent/server plugins frequently, so we'll scan every 30 seconds --> <!-- in production, plugins change very infrequently, so only scan every 5 minutes --> <condition property="rhq.server.plugin-scan-period-ms" value="30000"> @@ -173,10 +164,8 @@ </target>
<target name="prepare-container" - depends="prepare-web-services-1, - prepare-jbossas-dir, - prepare-bin-dir, - prepare-web-services-2" /> + depends="prepare-jbossas-dir, + prepare-bin-dir" />
<target name="prepare-jbossas-dir" depends="initialize" @@ -197,55 +186,17 @@ <available file="${jboss.home}/lib/jboss-system.jar" type="file" property="jboss.home.is.valid" /> <fail unless="jboss.home.is.valid" message="${jboss.home} does not contain a valid JBoss 4.x installation - aborting..." />
- <!-- Run JBossWS 3.1.1 upgrade script on the JBossAS: - i) pull upgrade bundle ii) unzip iii) run it on JBossAS instance - (4.2.3) to 3.1.1. These upgrade steps should be revisited when moving JBossAS version beyond 4.2.3 --> - <echo>...Upgrading JBossWS version from bundled version...</echo> - - <!-- Unzip JBossWS dist zipfile... if necessary --> - <property name="jbossws-native.zip" location="${settings.localRepository}/org/jboss/jbossws/jbossws-native-dist/${jbossws-native-dist.version}/jbossws-native-dist-${jbossws-native-dist.version}.zip" /> - <condition property="jbossws-native.uptodate"> - <and> - <uptodate srcfile="${jbossws-native.zip}" targetfile="${jboss-native.home}" /> - <available file="${jboss-native.home}/deploy/lib/jbossws-native-core.jar" type="file" /> - </and> - </condition> - - <!-- Prepare the upgrade location --> - <antcall target="unzip-jbossws-native" inheritall="true" /> - - <!-- Call the upgrade script --> - <echo>Running upgrade script for JBossWS ${jbossws-native-dist.version} </echo> - <ant antfile="${basedir}/target/${jboss-native-dir}/build.xml" target="deploy-jboss423" dir="${basedir}/target/${jboss-native-dir}" /> - <echo/> - <echo>Installing safe ejb3 web invoker ...</echo> - <delete verbose="true"> - <fileset dir="${jboss.deploy.dir}/jbossws.sar"> - <include name="safe-invoker*" /> - </fileset> - <fileset dir="${jboss.deploy.dir}/jbossws.sar/jbossws.beans/META-INF"> - <include name="jboss-beans.xml" /> - </fileset> - </delete> - <copy file="${settings.localRepository}/org/rhq/safe-invoker/${rhq.version}/safe-invoker-${rhq.version}.jar" - toDir="${jboss.deploy.dir}/jbossws.sar" verbose="true" /> - <copy file="${basedir}/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws.beans/META-INF/jboss-beans.xml" - toDir="${jboss.deploy.dir}/jbossws.sar/jbossws.beans/META-INF" verbose="true" /> - <copy file="${basedir}/src/main/resources/jbossas/server/default/deploy/jbossws.sar/jbossws-management.war/WEB-INF/web.xml" - toDir="${jboss.deploy.dir}/jbossws.sar/jbossws-management.war/WEB-INF" verbose="true" overwrite="true"/> - - - <echo>Installing patched hibernate jar ...</echo> + <echo>Installing patched hibernate jar ...</echo> <copy file="${settings.localRepository}/hibernate/hibernate3/${hibernate3.version}/hibernate3-${hibernate3.version}.jar" tofile="${jboss.home}/server/default/lib/hibernate3.jar" verbose="true"/>
- <echo>Installing custom container library...</echo> + <echo>Installing custom container library...</echo> <copy file="${settings.localRepository}/org/rhq/rhq-container-lib/${rhq.version}/rhq-container-lib-${rhq.version}.jar" tofile="${jboss.home}/server/default/lib/rhq-container-lib-${rhq.version}.jar" verbose="true"/>
- <property name="jboss.lib.dir" location="${jboss.home}/server/default/lib" /> - <echo>Copying additional libs to ${jboss.lib.dir} ...</echo> + <property name="jboss.lib.dir" location="${jboss.home}/server/default/lib" /> + <echo>Copying additional libs to ${jboss.lib.dir} ...</echo> <copy file="${settings.localRepository}/com/oracle/ojdbc6/${ojdbc6.version}/ojdbc6-${ojdbc6.version}.jar" toDir="${jboss.lib.dir}" failonerror="false" verbose="true" /> <copy file="${settings.localRepository}/postgresql/postgresql/${postgresql.version}/postgresql-${postgresql.version}.jar" @@ -406,8 +357,6 @@ <move todir="${jboss.home}/lib/endorsed" verbose="true"> <fileset dir="${jboss.home}/client"> <include name="jboss-jaxrpc.jar" /> - <include name="jboss-jaxws.jar" /> - <include name="jboss-jaxws-ext.jar" /> <include name="jboss-saaj.jar" /> <include name="jaxb-api.jar" /> </fileset> @@ -499,7 +448,6 @@ rhq.server.maintenance-mode-at-startup=false # General Properties rhq.server.startup.web.http.port=${rhq.server.http.port} rhq.server.startup.web.https.port=${rhq.server.https.port} -rhq.server.startup.webservice.port=9093 rhq.server.startup.namingservice.port=2099 rhq.server.startup.namingservice.rmiport=2098 rhq.server.startup.jrmpinvoker.rmiport=7444 @@ -642,27 +590,6 @@ rhq.autoinstall.public-endpoint-address=
</target>
- <!-- even if user does not want to deploy web services we must temporarily move the rej dir - back to the non-rej dir because other parts of the build expect the non-rej name --> - <target name="prepare-web-services-1" depends="initialize"> - <move todir="${jboss.deploy.dir}/jbossws.sar" - verbose="true" failonerror="false"> - <!-- failonerror is false because if the container is built clean - the rej dir will not exist yet, so this error must be skipped; - if undeploy-web-services has never been set, this will be a no-op --> - <fileset dir="${jboss.deploy.dir}/jbossws.sar.rej" /> - </move> - </target> - - <!-- if user does not want to deploy web services, we want to rename the non-rej dir - to the rej dir name so that the jboss deployer does not pick up this sar at all --> - <target name="prepare-web-services-2" depends="initialize" if="undeploy-web-services"> - <move todir="${jboss.deploy.dir}/jbossws.sar.rej" - verbose="true"> - <fileset dir="${jboss.deploy.dir}/jbossws.sar" /> - </move> - </target> - <target name="unzip-jboss" unless="jboss.uptodate"> <unzip src="${settings.localRepository}/org/jboss/jbossas/jboss-as-dist/${jboss.version}/jboss-as-dist-${jboss.version}.zip" dest="${basedir}/target" /> @@ -683,26 +610,6 @@ rhq.autoinstall.public-endpoint-address= <delete file="${jboss.home}/server/default/deploy/quartz-ra.rar" /> </target>
- <target name="unzip-jbossws-native" unless="jbossws-native.uptodate"> - - <echo>Unzipping JBossWS-Native container</echo> - <!-- As it doesn't already exist we will create it now --> - <unzip src="${settings.localRepository}/org/jboss/jbossws/jbossws-native-dist/${jbossws-native-dist.version}/jbossws-native-dist-${jbossws-native-dist.version}.zip" dest="${basedir}/target" /> - - <!-- Modify the properties file for upgrade --> - <echo>The expanded native dir : ${jbossws-native.home}</echo> - <copy file="${basedir}/target/${jboss-native-dir}/ant.properties.example" tofile="${basedir}/target/${jboss-native-dir}/ant.properties" filtering="true"> - <!-- modify properties appropriately --> - <filterset> - <filter token="jboss423.home" value="${jboss.home}" /> - </filterset> - </copy> - <replace file="${basedir}/target/${jboss-native-dir}/ant.properties" token="jbossws.integration.target=jboss500" value="jbossws.integration.target=jboss423" /> - - <!-- This line added to convert the \ in Window's paths to /. Should have no effect on non-Windows --> - <replace file="${basedir}/target/${jboss-native-dir}/ant.properties" token="\" value="/" /> - </target> -
<target name="generate-rhq-ssl-key" unless="rhq.keystore.exists"> <echo>Generating self-signed certificate in ${jboss.conf.dir} ...</echo> @@ -827,7 +734,6 @@ rhq.autoinstall.public-endpoint-address= <!-- (i.e. after rhq-ds.xml, rhq-server.sh, etc. have been copied over by the resources plugin) -->
<target name="prepare-release" depends="initialize, - prepare-web-services-1, fix-perms, prepare-postinstaller-war, developer-release-message, @@ -844,8 +750,7 @@ rhq.autoinstall.public-endpoint-address= undeploy-embedded-agent, undeploy-jms, undeploy-ear, - undeploy-ds, - prepare-web-services-2" description="If this is a release build, make sure it is properly prepared."> + undeploy-ds" description="If this is a release build, make sure it is properly prepared.">
<echo>Adding license files...</echo> <copy todir="${project.build.outputDirectory}"> diff --git a/modules/enterprise/server/jar/pom.xml b/modules/enterprise/server/jar/pom.xml index 2c9d023..52eb316 100644 --- a/modules/enterprise/server/jar/pom.xml +++ b/modules/enterprise/server/jar/pom.xml @@ -569,12 +569,7 @@ <finalName>${project.artifactId}</finalName>
<resources> - <!-- Redefine which directories to treat like resources (which are filtered). --> - <resource> - <directory>src/main/filtered-sources/java</directory> - <filtering>true</filtering> - <targetPath>../filtered-sources/java</targetPath> - </resource> + <!-- Redefine which directories to treat like resources (which are filtered). --> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> @@ -767,18 +762,6 @@ <artifactId>build-helper-maven-plugin</artifactId> <executions> <execution> - <id>add-filtered-sources</id> - <phase>generate-sources</phase> - <goals> - <goal>add-source</goal> - </goals> - <configuration> - <sources> - <source>target/filtered-sources/java</source> - </sources> - </configuration> - </execution> - <execution> <id>add-antlr-sources</id> <phase>generate-sources</phase> <goals> @@ -1063,16 +1046,6 @@ <name>java5.home</name> </property> </activation> - - <dependencies> - <dependency> - <groupId>jboss.jbossws</groupId> - <artifactId>jboss-jaxws</artifactId> - <!-- NOTE: This version is old but is good enough to resolve the build dependency. --> - <version>3.0.1-native-2.0.4.GA</version> - <scope>provided</scope> - </dependency> - </dependencies> </profile>
<profile> diff --git a/modules/enterprise/server/jar/src/main/filtered-sources/java/org/rhq/enterprise/server/system/ServerVersion.java b/modules/enterprise/server/jar/src/main/filtered-sources/java/org/rhq/enterprise/server/system/ServerVersion.java deleted file mode 100644 index 275a5c6..0000000 --- a/modules/enterprise/server/jar/src/main/filtered-sources/java/org/rhq/enterprise/server/system/ServerVersion.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.system; - -import java.io.Serializable; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * Provides version information on the server itself. - * - * @author John Mazzitelli - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement -public class ServerVersion implements Serializable { - public static String getNamespace() { - return namespace; - } - - private static final long serialVersionUID = 1L; - - //removed final typing info for no-args constructor and JAXB requirement - private String version; - private String build; - - //This value must be set by build system just before Build/Compile Time. - public static final String namespace = "http://www.rhq-project.org/$%7Bpom.version%7D/Webservices.xsd"; - - public ServerVersion(String version, String build) { - this.version = version; - this.build = build; - } - - //No args constructor for JAXB serialization/bean requirement. - private ServerVersion() { - } - - /** - * The version of the server, such as "1.0.0.GA". - * - * @return server version - */ - public String getVersion() { - return version; - } - - /** - * Identifies the specific build of the server; this is typically - * a source code control system revision number, such as "10934". - * - * @return server build - */ - public String getBuild() { - return build; - } - - @Override - public String toString() { - return this.version + "(" + this.build + ")"; - } -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java index f7a4063..3a6e8bb 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertDefinitionManagerRemote.java @@ -19,50 +19,31 @@ package org.rhq.enterprise.server.alert;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.alert.AlertDefinition; import org.rhq.core.domain.alert.notification.AlertNotification; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.AlertDefinitionCriteria; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface AlertDefinitionManagerRemote { - @WebMethod + AlertDefinition getAlertDefinition(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "alertDefinitionId") int alertDefinitionId); + Subject subject, int alertDefinitionId);
- @WebMethod - PageList<AlertDefinition> findAlertDefinitionsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") AlertDefinitionCriteria criteria); + PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject subject, AlertDefinitionCriteria criteria);
- @WebMethod int enableAlertDefinitions(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "alertDefinitionIds") int[] alertDefinitionIds); + Subject subject, int[] alertDefinitionIds);
- @WebMethod int disableAlertDefinitions(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "alertDefinitionIds") int[] alertDefinitionIds); + Subject subject, int[] alertDefinitionIds);
- @WebMethod int removeAlertDefinitions(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "alertDefinitionIds") int[] alertDefinitionIds); + Subject subject, int[] alertDefinitionIds);
- @WebMethod String[] getAlertNotificationConfigurationPreview(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "notifications") AlertNotification[] notifications); + Subject subject, AlertNotification[] notifications);
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerRemote.java index 85fe1af..99637e6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/alert/AlertManagerRemote.java @@ -19,46 +19,24 @@ package org.rhq.enterprise.server.alert;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.alert.Alert; import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.common.EntityContext; import org.rhq.core.domain.criteria.AlertCriteria; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface AlertManagerRemote {
- @WebMethod - PageList<Alert> findAlertsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") AlertCriteria criteria); + PageList<Alert> findAlertsByCriteria(Subject subject, AlertCriteria criteria);
- @WebMethod - int deleteAlerts( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "alertIds") int[] alertIds); + int deleteAlerts(Subject subject, int[] alertIds);
- @WebMethod - int deleteAlertsByContext( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "context") EntityContext context); + int deleteAlertsByContext(Subject subject, EntityContext context);
- @WebMethod - int acknowledgeAlerts( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "alertIds") int[] alertIds); + int acknowledgeAlerts(Subject subject, int[] alertIds);
- @WebMethod - int acknowledgeAlertsByContext( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "context") EntityContext context); + int acknowledgeAlertsByContext(Subject subject, EntityContext context);
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerRemote.java index 6bcf56b..4470d53 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/auth/SubjectManagerRemote.java @@ -19,10 +19,6 @@ package org.rhq.enterprise.server.auth;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Principal; import org.rhq.core.domain.auth.Subject; @@ -30,10 +26,7 @@ import org.rhq.core.domain.criteria.SubjectCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.authz.RoleManagerLocal; import org.rhq.enterprise.server.exception.LoginException; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface SubjectManagerRemote {
@@ -44,11 +37,7 @@ public interface SubjectManagerRemote { * @param username The user whose password will be changed * @param password The new password for the user */ - @WebMethod - void changePassword( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "username") String username, // - @WebParam(name = "password") String password); + void changePassword(Subject subject, String username, String password);
/** * Creates a new principal (username and password) in the internal database. The password will be encoded before @@ -60,12 +49,7 @@ public interface SubjectManagerRemote { * * @throws Exception if the principal could not be added */ - @WebMethod - void createPrincipal( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "username") String username, // - @WebParam(name = "password") String password) // - throws SubjectException; + void createPrincipal(Subject subject, String username, String password) throws SubjectException;
/** * Create a a new subject. This <b>ignores</b> the roles in <code>subject</code>. The created subject will not be @@ -76,11 +60,7 @@ public interface SubjectManagerRemote { * * @return the newly persisted {@link Subject} */ - @WebMethod - Subject createSubject( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectToCreate") Subject subjectToCreate) // - throws SubjectException; + Subject createSubject(Subject subject, Subject subjectToCreate) throws SubjectException;
/** * Deletes the given set of users, including both the {@link Subject} and {@link Principal} objects associated with @@ -91,10 +71,7 @@ public interface SubjectManagerRemote { * * @throws Exception if failed to delete one or more users */ - @WebMethod - void deleteSubjects( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectIds") int[] subjectIds); + void deleteSubjects(Subject subject, int[] subjectIds);
/** * Looks up the existing subject using the given username. @@ -107,9 +84,7 @@ public interface SubjectManagerRemote { * a future release. Given that multiple sessions may exist for a * single user the result of this call is non-deterministic. */ - @WebMethod - Subject getSubjectByName( // - @WebParam(name = "username") String username); + Subject getSubjectByName(String username);
/** * Looks up the Subject for a current RHQ session by username and sessionId. @@ -121,10 +96,7 @@ public interface SubjectManagerRemote { * * @throws Exception if the sessionId is not valid */ - @WebMethod - Subject getSubjectByNameAndSessionId( // - @WebParam(name = "username") String username, // - @WebParam(name = "sessionId") int sessionId) throws Exception; + Subject getSubjectByNameAndSessionId(String username, int sessionId) throws Exception;
/** * Logs a user into the system. This will authenticate the given user with the given password. If the user was @@ -137,20 +109,14 @@ public interface SubjectManagerRemote { * * @exception LoginException if the login failed for some reason */ - @WebMethod - Subject login( // - @WebParam(name = "username") String username, // - @WebParam(name = "password") String password) // - throws LoginException; + Subject login(String username, String password) throws LoginException;
/** * Logs out a user. * * @param subject The Subject to log out. The sessionId must be valid. */ - @WebMethod - void logout( // - @WebParam(name = "subject") Subject subject); + void logout(Subject subject);
/** * Updates an existing subject with new data. This does <b>not</b> cascade any changes to the roles but it will save @@ -161,13 +127,7 @@ public interface SubjectManagerRemote { * * @return the merged subject, which may or may not be the same instance of <code>subjectToModify</code> */ - @WebMethod - Subject updateSubject( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectToModify") Subject subjectToModify); + Subject updateSubject(Subject subject, Subject subjectToModify);
- @WebMethod - PageList<Subject> findSubjectsByCriteria(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") SubjectCriteria criteria); + PageList<Subject> findSubjectsByCriteria(Subject subject, SubjectCriteria criteria); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java index 73e053d..0586998 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/authz/RoleManagerRemote.java @@ -19,25 +19,18 @@ package org.rhq.enterprise.server.authz;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.authz.Role; import org.rhq.core.domain.criteria.RoleCriteria; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
/** * The remote interface to the role manager, providing a restricted set of Role Management services. that provides the API to manipulate the security rules within the JON Server. * * @author Jay Shaughnessy */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface RoleManagerRemote {
@@ -49,10 +42,7 @@ public interface RoleManagerRemote { * * @return the role or <code>null</code> if it wasn't found */ - @WebMethod - Role getRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleId") int roleId); + Role getRole(Subject subject, int roleId);
/** * Persists the new role to the database. The subjects assigned to the role are ignored - this only creates the @@ -62,10 +52,7 @@ public interface RoleManagerRemote { * @param newRole The new role being created * @return The persisted role with the primary key populated */ - @WebMethod - Role createRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "newRole") Role newRole); + Role createRole(Subject subject, Role newRole);
/** * Removes a set of roles from the database. The subjects assigned to the roles are no longer authorized with the @@ -74,10 +61,7 @@ public interface RoleManagerRemote { * @param subject The user attempting to delete the role * @param roleIds The IDs of the roles to delete */ - @WebMethod - void deleteRoles( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleIds") int[] roleIds); + void deleteRoles(Subject subject, int[] roleIds);
/** * Updates the given role, excluding the subjects and groups. This updates permissions, name, description, etc. @@ -86,10 +70,7 @@ public interface RoleManagerRemote { * @param role The role being updated * @return The updated role */ - @WebMethod - Role updateRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "role") Role role); + Role updateRole(Subject subject, Role role);
/** * Get all roles assigned for a certain subject @@ -99,17 +80,9 @@ public interface RoleManagerRemote { * @param pc PageControl * @return A page list of assigned */ - @WebMethod - PageList<Role> findSubjectAssignedRoles( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectId") int subjectId, // - @WebParam(name = "pageControl") PageControl pc); - - @WebMethod - PageList<Role> findSubjectUnassignedRoles( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectId") int subjectId, // - @WebParam(name = "pageControl") PageControl pc); + PageList<Role> findSubjectAssignedRoles(Subject subject, int subjectId, PageControl pc); + + PageList<Role> findSubjectUnassignedRoles(Subject subject, int subjectId, PageControl pc);
/** * Assigns a set of roles to a subject which authorizes the subject to do anything the roles permit. @@ -118,11 +91,7 @@ public interface RoleManagerRemote { * @param subjectId the subject who is to be authorized with the given roles * @param roleIds the roles to assign */ - @WebMethod - void addRolesToSubject( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectId") int subjectId, // - @WebParam(name = "roleIds") int[] roleIds); + void addRolesToSubject(Subject subject, int subjectId, int[] roleIds);
/** * Disassociates particular roles from a subject. Once complete, the subject will no longer be authorized with the @@ -132,11 +101,7 @@ public interface RoleManagerRemote { * @param subjectId the user that is to have the roles unassigned from it * @param roleIds list of role IDs that are to be removed from user */ - @WebMethod - void removeRolesFromSubject( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectId") int subjectId, // - @WebParam(name = "roleIds") int[] roleIds); + void removeRolesFromSubject(Subject subject, int subjectId, int[] roleIds);
/** * Assigns a set of subjects to a role which authorizes the subjects to do anything the role permits. @@ -145,11 +110,7 @@ public interface RoleManagerRemote { * @param roleId the role who will authorized with the given subjects * @param subjectIds the subjects to assign the role */ - @WebMethod - void addSubjectsToRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleId") int roleId, // - @WebParam(name = "subjectIds") int[] subjectIds); + void addSubjectsToRole(Subject subject, int roleId, int[] subjectIds);
/** * Dissociate particular subjects from a role. @@ -158,11 +119,7 @@ public interface RoleManagerRemote { * @param roleId The role ID to dissociate the roles from * @param subjectIds The IDs of the subjects to remove from the specified Role */ - @WebMethod - void removeSubjectsFromRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleId") int roleId, // - @WebParam(name = "subjectIds") int[] subjectIds); + void removeSubjectsFromRole(Subject subject, int roleId, int[] subjectIds);
/** * Sets the set of roles assigned to a subject. Requires SECURITY_ADMIN @@ -170,11 +127,7 @@ public interface RoleManagerRemote { * @param subjectId * @param roleIds */ - @WebMethod - void setAssignedSubjectRoles( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "subjectId") int subjectId, // - @WebParam(name = "roleIds") int[] roleIds); + void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds);
/** * Adds the given resource groups to the given role. @@ -183,21 +136,11 @@ public interface RoleManagerRemote { * @param roleId * @param pendingGroupIds */ - @WebMethod - void addResourceGroupsToRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleId") int roleId, // - @WebParam(name = "pendingGroupIds") int[] pendingGroupIds); - - @WebMethod - void addRolesToResourceGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "roleIds") int[] roleIds); - - void setAssignedResourceGroups(@WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleId") int roleId, // - @WebParam(name = "groupIds") int[] groupIds); + void addResourceGroupsToRole(Subject subject, int roleId, int[] pendingGroupIds); + + void addRolesToResourceGroup(Subject subject, int groupId, int[] roleIds); + + void setAssignedResourceGroups(Subject subject, int roleId, int[] groupIds);
/** * Removes the given resource groups from the given role. @@ -206,21 +149,10 @@ public interface RoleManagerRemote { * @param roleId * @param groupIds */ - @WebMethod - void removeResourceGroupsFromRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleId") int roleId, // - @WebParam(name = "groupIds") int[] groupIds); - - @WebMethod - void removeRolesFromResourceGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "roleIds") int[] roleIds); - - @WebMethod - PageList<Role> findRolesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") RoleCriteria criteria); + void removeResourceGroupsFromRole(Subject subject, int roleId, int[] groupIds); + + void removeRolesFromResourceGroup(Subject subject, int groupId, int[] roleIds); + + PageList<Role> findRolesByCriteria(Subject subject, RoleCriteria criteria);
} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java index b8913ca..9114d1b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/bundle/BundleManagerRemote.java @@ -24,10 +24,6 @@ import java.util.List; import java.util.Set;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.bundle.Bundle; @@ -48,7 +44,6 @@ import org.rhq.core.domain.criteria.BundleFileCriteria; import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; import org.rhq.core.domain.criteria.BundleVersionCriteria; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
/** * Remote interface to the manager responsible for creating and managing bundles. @@ -56,8 +51,6 @@ import org.rhq.enterprise.server.system.ServerVersion; * @author John Mazzitelli * @author Jay Shaughnessy */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface BundleManagerRemote {
@@ -71,10 +64,8 @@ public interface BundleManagerRemote { * @return the bundle configuration for the group's resource type * @throws Exception */ - @WebMethod - ResourceTypeBundleConfiguration getResourceTypeBundleConfiguration( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "compatGroupId") int compatGroupId) throws Exception; + ResourceTypeBundleConfiguration getResourceTypeBundleConfiguration(Subject subject, int compatGroupId) + throws Exception;
/** * Adds a BundleFile to the BundleVersion and implicitly creates the backing PackageVersion. If the PackageVersion @@ -89,14 +80,8 @@ public interface BundleManagerRemote { * @return the new BundleFile * @throws Exception */ - @WebMethod - BundleFile addBundleFile( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionid") int bundleVersionId, // - @WebParam(name = "name") String name, // - @WebParam(name = "version") String version, // - @WebParam(name = "architecture") Architecture architecture, // - @WebParam(name = "fileStream") InputStream fileStream) throws Exception; + BundleFile addBundleFile(Subject subject, int bundleVersionId, String name, String version, + Architecture architecture, InputStream fileStream) throws Exception;
/** * A convenience method taking a byte array as opposed to a stream for the file bits. @@ -105,40 +90,24 @@ public interface BundleManagerRemote { * * @see {@link addBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)} */ - @WebMethod - BundleFile addBundleFileViaByteArray( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionid") int bundleVersionId, // - @WebParam(name = "name") String name, // - @WebParam(name = "version") String version, // - @WebParam(name = "architecture") Architecture architecture, // - @WebParam(name = "fileBytes") byte[] fileBytes) throws Exception; + BundleFile addBundleFileViaByteArray(Subject subject, int bundleVersionId, String name, String version, + Architecture architecture, byte[] fileBytes) throws Exception;
/** * A convenience method taking a URL String whose content will be streamed to the server and used for the file bits. * * @see {@link addBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)} */ - @WebMethod - BundleFile addBundleFileViaURL( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionid") int bundleVersionId, // - @WebParam(name = "name") String name, // - @WebParam(name = "version") String version, // - @WebParam(name = "architecture") Architecture architecture, // - @WebParam(name = "bundleFileUrl") String bundleFileUrl) throws Exception; + BundleFile addBundleFileViaURL(Subject subject, int bundleVersionId, String name, String version, + Architecture architecture, String bundleFileUrl) throws Exception;
/** * A convenience method taking an existing PackageVersion as opposed to a stream for the file bits. * * @see {@link addBundleFile(Subject, int, String, String, Architecture, InputStream, boolean)} */ - @WebMethod - BundleFile addBundleFileViaPackageVersion( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionid") int bundleVersionId, // - @WebParam(name = "name") String name, // - @WebParam(name = "packageVersionId") int packageVersionId) throws Exception; + BundleFile addBundleFileViaPackageVersion(Subject subject, int bundleVersionId, String name, int packageVersionId) + throws Exception;
/** * Create a new bundle deployment. Note that bundle deployment names are generated by this @@ -154,13 +123,8 @@ public interface BundleManagerRemote { * @return the persisted deployment * @throws Exception */ - @WebMethod - BundleDeployment createBundleDeployment( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionId") int bundleVersionId, // - @WebParam(name = "bundleDestinationId") int bundleDestinationId, // - @WebParam(name = "description") String description, // - @WebParam(name = "configuration") Configuration configuration) throws Exception; + BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, + String description, Configuration configuration) throws Exception;
/** * Creates a bundle destination that describes a target for the bundle deployments. @@ -178,15 +142,8 @@ public interface BundleManagerRemote { * @return the persisted destination * @throws Exception */ - @WebMethod - BundleDestination createBundleDestination( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleId") int bundleId, // - @WebParam(name = "name") String name, // - @WebParam(name = "description") String description, // - @WebParam(name = "destBaseDirName") String destBaseDirName, // - @WebParam(name = "deployDir") String deployDir, // - @WebParam(name = "groupId") Integer groupId) throws Exception; + BundleDestination createBundleDestination(Subject subject, int bundleId, String name, String description, + String destBaseDirName, String deployDir, Integer groupId) throws Exception;
/** * Creates a bundle version based on single recipe string. The recipe specifies the bundle name, @@ -199,10 +156,7 @@ public interface BundleManagerRemote { * @return the persisted BundleVersion with alot of the internal relationships filled in to help the caller * understand all that this method did. */ - @WebMethod - BundleVersion createBundleVersionViaRecipe( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "recipe") String recipe) throws Exception; + BundleVersion createBundleVersionViaRecipe(Subject subject, String recipe) throws Exception;
/** * Creates a bundle version based on a Bundle Distribution file. Typically a zip file, the bundle distribution @@ -216,10 +170,7 @@ public interface BundleManagerRemote { * @return the persisted BundleVersion with alot of the internal relationships filled in to help the caller * understand all that this method did. Bundle files specifically are returned. */ - @WebMethod - BundleVersion createBundleVersionViaFile( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "distributionFile") File distributionFile) throws Exception; + BundleVersion createBundleVersionViaFile(Subject subject, File distributionFile) throws Exception;
/** * Creates a bundle version based on the actual bytes of a Bundle Distribution file. This is essentially @@ -233,10 +184,7 @@ public interface BundleManagerRemote { * @return the persisted BundleVersion with alot of the internal relationships filled in to help the caller * understand all that this method did. Bundle files specifically are returned. */ - @WebMethod - BundleVersion createBundleVersionViaByteArray( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "fileBytes") byte[] fileBytes) throws Exception; + BundleVersion createBundleVersionViaByteArray(Subject subject, byte[] fileBytes) throws Exception;
/** * Creates a bundle version based on a Bundle Distribution file. Typically a zip file, the bundle distribution @@ -254,10 +202,7 @@ public interface BundleManagerRemote { * @return the persisted BundleVersion with alot of the internal relationships filled in to help the caller * understand all that this method did. Bundle files specifically are returned. */ - @WebMethod - BundleVersion createBundleVersionViaURL( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "distributionFileUrl") String distributionFileUrl) throws Exception; + BundleVersion createBundleVersionViaURL(Subject subject, String distributionFileUrl) throws Exception;
/** * Remove everything associated with the Bundles with the exception of files laid down by related deployments. @@ -268,10 +213,7 @@ public interface BundleManagerRemote { * @param bundleIds IDs of all bundles to be deleted * @throws Exception if any part of the removal fails. */ - @WebMethod - void deleteBundles( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleIds") int[] bundleIds) throws Exception; + void deleteBundles(Subject subject, int[] bundleIds) throws Exception;
/** * Remove everything associated with the Bundle with the exception of files laid down by related deployments. @@ -282,10 +224,7 @@ public interface BundleManagerRemote { * @param bundleId * @throws Exception if any part of the removal fails. */ - @WebMethod - void deleteBundle( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleId") int bundleId) throws Exception; + void deleteBundle(Subject subject, int bundleId) throws Exception;
/** * Remove everything associated with the BundleVersion with the exception of files laid down by related deployments. @@ -298,54 +237,27 @@ public interface BundleManagerRemote { * bundle, then that bundle entity itself will be completely purged * @throws Exception if any part of the removal fails. */ - @WebMethod - void deleteBundleVersion( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionId") int bundleVersionId, // - @WebParam(name = "deleteBundleIfEmpty") boolean deleteBundleIfEmpty) throws Exception; - - @WebMethod - PageList<Bundle> findBundlesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") BundleCriteria criteria); - - @WebMethod - PageList<BundleDeployment> findBundleDeploymentsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") BundleDeploymentCriteria criteria); - - @WebMethod - PageList<BundleDestination> findBundleDestinationsByCriteria(@WebParam(name = "subject") Subject subject, - @WebParam(name = "criteria") BundleDestinationCriteria criteria); - - @WebMethod - PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "BundleResourceDeploymentCriteria") BundleResourceDeploymentCriteria criteria); - - @WebMethod - PageList<BundleFile> findBundleFilesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") BundleFileCriteria criteria); - - @WebMethod - PageList<BundleVersion> findBundleVersionsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") BundleVersionCriteria criteria); - - @WebMethod - PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") BundleCriteria criteria); - - @WebMethod - List<BundleType> getAllBundleTypes( // - @WebParam(name = "subject") Subject subject); - - @WebMethod - BundleType getBundleType( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleTypeName") String bundleTypeName); + void deleteBundleVersion(Subject subject, int bundleVersionId, boolean deleteBundleIfEmpty) throws Exception; + + PageList<Bundle> findBundlesByCriteria(Subject subject, BundleCriteria criteria); + + PageList<BundleDeployment> findBundleDeploymentsByCriteria(Subject subject, BundleDeploymentCriteria criteria); + + PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, BundleDestinationCriteria criteria); + + PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject, + BundleResourceDeploymentCriteria criteria); + + PageList<BundleFile> findBundleFilesByCriteria(Subject subject, BundleFileCriteria criteria); + + PageList<BundleVersion> findBundleVersionsByCriteria(Subject subject, BundleVersionCriteria criteria); + + PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(Subject subject, + BundleCriteria criteria); + + List<BundleType> getAllBundleTypes(Subject subject); + + BundleType getBundleType(Subject subject, String bundleTypeName);
/** * Determine the files required for a BundleVersion and return all of the filenames or optionally, just those @@ -358,11 +270,8 @@ public interface BundleManagerRemote { * @return The List of filenames. * @throws Exception */ - @WebMethod - Set<String> getBundleVersionFilenames( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionId") int bundleVersionId, // - @WebParam(name = "withoutBundleFileOnly") boolean withoutBundleFileOnly) throws Exception; + Set<String> getBundleVersionFilenames(Subject subject, int bundleVersionId, boolean withoutBundleFileOnly) + throws Exception;
/** * Similar to {@link #getBundleVersionFilenames(Subject, int, boolean)}, this will determine the files required for a BundleVersion and return @@ -375,9 +284,9 @@ public interface BundleManagerRemote { * @throws Exception */ /* comment back in when someone writes an adapter to support Map un/marshalling - Map<String, Boolean> getAllBundleVersionFilenames( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleVersionId") int bundleVersionId) throws Exception; + Map<String, Boolean> getAllBundleVersionFilenames( + Subject subject, + int bundleVersionId) throws Exception; */
/** @@ -386,10 +295,7 @@ public interface BundleManagerRemote { * @param subject user that must have proper permissions * @param bundleDestinationId the ID of the destination that is to be purged of bundle content */ - @WebMethod - void purgeBundleDestination( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleDestinationId") int bundleDestinationId) throws Exception; + void purgeBundleDestination(Subject subject, int bundleDestinationId) throws Exception;
/** * Deploy the bundle to the destination, as described in the provided deployment. @@ -405,11 +311,8 @@ public interface BundleManagerRemote { * @return the BundleDeployment record, updated with status and (resource) deployments. * @throws Exception */ - @WebMethod - BundleDeployment scheduleBundleDeployment( - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleDeploymentId") int bundleDeploymentId, - @WebParam(name = "isCleanDeployment") boolean isCleanDeployment) throws Exception; + BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId, boolean isCleanDeployment) + throws Exception;
/** * For the specified destination, revert from the current live deployment to the deployment it had replaced. @@ -429,11 +332,7 @@ public interface BundleManagerRemote { * @return the BundleDeployment record, updated with status and (resource) deployments. * @throws Exception */ - @WebMethod - BundleDeployment scheduleRevertBundleDeployment( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "bundleDestinationId") int bundleDestinationId, // - @WebParam(name = "deploymentDescription") String deploymentDescription, // - @WebParam(name = "isCleanDeployment") boolean isCleanDeployment) throws Exception; + BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, + String deploymentDescription, boolean isCleanDeployment) throws Exception;
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java index 6f18088..b6ed3d1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerBean.java @@ -32,14 +32,11 @@ import javax.ejb.EJB; import javax.ejb.Stateless; import javax.ejb.TransactionAttribute; import javax.ejb.TransactionAttributeType; -import javax.jws.WebParam; import javax.persistence.EntityManager; import javax.persistence.EntityNotFoundException; import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -118,15 +115,12 @@ import org.rhq.enterprise.server.configuration.job.GroupPluginConfigurationUpdat import org.rhq.enterprise.server.configuration.job.GroupResourceConfigurationUpdateJob; import org.rhq.enterprise.server.configuration.util.ConfigurationMaskingUtility; import org.rhq.enterprise.server.core.AgentManagerLocal; -import org.rhq.enterprise.server.jaxb.WebServiceTypeAdapter; -import org.rhq.enterprise.server.jaxb.adapter.ConfigurationAdapter; import org.rhq.enterprise.server.resource.ResourceManagerLocal; import org.rhq.enterprise.server.resource.ResourceNotFoundException; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; import org.rhq.enterprise.server.resource.group.ResourceGroupNotFoundException; import org.rhq.enterprise.server.resource.group.ResourceGroupUpdateException; import org.rhq.enterprise.server.scheduler.SchedulerLocal; -import org.rhq.enterprise.server.system.ServerVersion; import org.rhq.enterprise.server.util.CriteriaQueryGenerator; import org.rhq.enterprise.server.util.CriteriaQueryRunner; import org.rhq.enterprise.server.util.QuartzUtil; @@ -138,7 +132,6 @@ import org.rhq.enterprise.server.util.QuartzUtil; * @author Ian Springer */ @Stateless -@XmlType(namespace = ServerVersion.namespace) public class ConfigurationManagerBean implements ConfigurationManagerLocal, ConfigurationManagerRemote { private final Log log = LogFactory.getLog(ConfigurationManagerBean.class);
@@ -162,9 +155,9 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf @EJB private SubjectManagerLocal subjectManager;
+ @Override @Nullable - public @XmlJavaTypeAdapter(ConfigurationAdapter.class) - Configuration getPluginConfiguration(Subject subject, int resourceId) { + public Configuration getPluginConfiguration(Subject subject, int resourceId) { log.debug("Getting current plugin configuration for resource [" + resourceId + "]");
Resource resource = entityManager.find(Resource.class, resourceId); @@ -185,6 +178,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf // Use new transaction because this only works if the resource in question has not // yet been loaded by Hibernate. We want the query to return a non-proxied configuration, // this is critical for remote API use. + @Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public Configuration getPluginConfiguration(int resourceId) { // Ensure that we return a non-proxied Configuration object that can survive after the @@ -205,6 +199,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return pluginConfiguration; }
+ @Override public void completePluginConfigurationUpdate(Integer updateId) { PluginConfigurationUpdate update = entityManager.find(PluginConfigurationUpdate.class, updateId); configurationManager.completePluginConfigurationUpdate(update); @@ -214,6 +209,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf * this method will not fire off the update asynchronously (like the completeResourceConfigurationUpdate method * does); instead, it will block until an update response is retrieved from the agent-side resource */ + @Override public void completePluginConfigurationUpdate(PluginConfigurationUpdate update) { // use EJB3 reference to ourself so that transaction semantics are correct ConfigurationUpdateResponse response = configurationManager.executePluginConfigurationUpdate(update); @@ -243,6 +239,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf }
// use requires new so that exceptions bubbling up from the agent.updatePluginConfiguration don't force callers to rollback as well + @Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public ConfigurationUpdateResponse executePluginConfigurationUpdate(PluginConfigurationUpdate update) { Resource resource = update.getResource(); @@ -271,9 +268,10 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return response; }
+ @Override public PluginConfigurationUpdate updatePluginConfiguration(Subject subject, int resourceId, - @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration newPluginConfiguration) - throws ResourceNotFoundException { + Configuration newPluginConfiguration) throws ResourceNotFoundException { + Subject overlord = subjectManager.getOverlord(); Resource resource = resourceManager.getResourceById(overlord, resourceId);
@@ -304,8 +302,8 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return update; }
- public @XmlJavaTypeAdapter(ConfigurationAdapter.class) - Configuration getResourceConfiguration(Subject subject, int resourceId) { + @Override + public Configuration getResourceConfiguration(Subject subject, int resourceId) { Resource resource = entityManager.find(Resource.class, resourceId);
if (resource == null) { @@ -323,6 +321,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf }
// local only + @Override public void setResourceConfiguration(int resourceId, Configuration configuration) { Resource resource = entityManager.find(Resource.class, resourceId); if (resource == null) { @@ -335,6 +334,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf // Use new transaction because this only works if the resource in question has not // yet been loaded by Hibernate. We want the query to return a non-proxied configuration, // this is critical for remote API use. + @Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public Configuration getResourceConfiguration(int resourceId) { // Ensure that we return a non-proxied Configuration object that can survive after the @@ -356,6 +356,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return resourceConfiguration; }
+ @Override public ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(Subject subject, int resourceId, boolean fromStructured) { log.debug("Getting current Resource configuration for Resource [" + resourceId + "]..."); @@ -458,6 +459,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return current; }
+ @Override @Nullable public ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(Subject subject, int resourceId) { return getLatestResourceConfigurationUpdate(subject, resourceId, true); @@ -494,6 +496,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return update; }
+ @Override public PluginConfigurationUpdate getLatestPluginConfigurationUpdate(Subject subject, int resourceId) { log.debug("Getting current plugin configuration for resource [" + resourceId + "]...");
@@ -533,6 +536,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return current; }
+ @Override public boolean isResourceConfigurationUpdateInProgress(Subject subject, int resourceId) { boolean updateInProgress; try { @@ -553,6 +557,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updateInProgress; }
+ @Override public boolean isPluginConfigurationUpdateInProgress(Subject subject, int resourceId) { boolean updateInProgress; try { @@ -572,6 +577,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updateInProgress; }
+ @Override public boolean isGroupResourceConfigurationUpdateInProgress(Subject subject, int groupId) { boolean updateInProgress; try { @@ -595,6 +601,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updateInProgress; }
+ @Override public boolean isGroupPluginConfigurationUpdateInProgress(Subject subject, int groupId) { boolean updateInProgress; try { @@ -617,6 +624,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updateInProgress; }
+ @Override public Map<Integer, Configuration> getResourceConfigurationsForCompatibleGroup(Subject subject, int groupId) throws ConfigurationUpdateStillInProgressException, Exception {
@@ -688,6 +696,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return currentPersistedConfigs; }
+ @Override public Map<Integer, Configuration> getPluginConfigurationsForCompatibleGroup(Subject subject, int groupId) throws ConfigurationUpdateStillInProgressException, Exception { // The below call will also handle the check to see if the subject has perms to view the group. @@ -766,7 +775,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf query.setParameter("status", ConfigurationUpdateStatus.INPROGRESS); List<PluginConfigurationUpdate> pluginConfigUpdates = query.getResultList(); if (!pluginConfigUpdates.isEmpty()) { - List<Integer> resourceIds = new ArrayList(pluginConfigUpdates.size()); + List<Integer> resourceIds = new ArrayList<Integer>(pluginConfigUpdates.size()); for (PluginConfigurationUpdate pluginConfigUpdate : pluginConfigUpdates) { resourceIds.add(pluginConfigUpdate.getResource().getId()); } @@ -863,11 +872,13 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return results; }
+ @Override public Configuration getLiveResourceConfiguration(Subject subject, int resourceId, boolean pingAgentFirst) throws Exception { return getLiveResourceConfiguration(subject, resourceId, pingAgentFirst, true); }
+ @Override public Configuration getLiveResourceConfiguration(Subject subject, int resourceId, boolean pingAgentFirst, boolean fromStructured) throws Exception { Resource resource = entityManager.find(Resource.class, resourceId); @@ -887,6 +898,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return liveConfig; }
+ @Override public void checkForTimedOutConfigurationUpdateRequests() { log.debug("Begin scanning for timed out configuration update requests"); checkForTimedOutResourceConfigurationUpdateRequests(); @@ -955,6 +967,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria)} */ + @Override @SuppressWarnings("unchecked") public PageList<PluginConfigurationUpdate> findPluginConfigurationUpdates(Subject subject, int resourceId, Long beginDate, Long endDate, PageControl pc) { @@ -1014,6 +1027,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria)} */ + @Override @SuppressWarnings("unchecked") public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdates(Subject subject, Integer resourceId, Long beginDate, Long endDate, boolean suppressOldest, PageControl pc) { @@ -1076,6 +1090,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use criteria-based API */ + @Override public PluginConfigurationUpdate getPluginConfigurationUpdate(Subject subject, int configurationUpdateId) { PluginConfigurationUpdate update = entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId);
@@ -1092,6 +1107,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use criteria-based API */ + @Override public ResourceConfigurationUpdate getResourceConfigurationUpdate(Subject subject, int configurationUpdateId) { ResourceConfigurationUpdate update = entityManager.find(ResourceConfigurationUpdate.class, configurationUpdateId); @@ -1106,6 +1122,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return update; }
+ @Override public void purgePluginConfigurationUpdate(Subject subject, int configurationUpdateId, boolean purgeInProgress) { PluginConfigurationUpdate doomedRequest = entityManager.find(PluginConfigurationUpdate.class, configurationUpdateId); @@ -1136,6 +1153,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return; }
+ @Override public void purgePluginConfigurationUpdates(Subject subject, int[] configurationUpdateIds, boolean purgeInProgress) { if ((configurationUpdateIds == null) || (configurationUpdateIds.length == 0)) { return; @@ -1149,6 +1167,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return; }
+ @Override public void purgeResourceConfigurationUpdate(Subject subject, int configurationUpdateId, boolean purgeInProgress) { ResourceConfigurationUpdate doomedRequest = entityManager.find(ResourceConfigurationUpdate.class, configurationUpdateId); @@ -1179,6 +1198,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return; }
+ @Override public void purgeResourceConfigurationUpdates(Subject subject, int[] configurationUpdateIds, boolean purgeInProgress) { if ((configurationUpdateIds == null) || (configurationUpdateIds.length == 0)) { return; @@ -1192,6 +1212,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return; }
+ @Override public ResourceConfigurationUpdate updateStructuredOrRawConfiguration(Subject subject, int resourceId, Configuration newConfiguration, boolean fromStructured) throws ResourceNotFoundException, ConfigurationUpdateStillInProgressException { @@ -1258,10 +1279,10 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return ConfigurationFormat.STRUCTURED_AND_RAW == configDef.getConfigurationFormat(); }
+ @Override @Nullable public ResourceConfigurationUpdate updateResourceConfiguration(Subject subject, int resourceId, - @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration newResourceConfiguration) - throws ResourceNotFoundException { + Configuration newResourceConfiguration) throws ResourceNotFoundException {
if (isStructuredAndRawSupported(resourceId)) { throw new ConfigurationUpdateNotSupportedException("Cannot update a resource configuration that " @@ -1295,6 +1316,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return newUpdate; }
+ @Override public void executeResourceConfigurationUpdate(int updateId) { ResourceConfigurationUpdate update = getResourceConfigurationUpdate(subjectManager.getOverlord(), updateId); Configuration originalConfig = update.getConfiguration(); @@ -1326,6 +1348,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf } }
+ @Override public void rollbackResourceConfiguration(Subject subject, int resourceId, int configHistoryId) throws ConfigurationUpdateException { ResourceConfigurationUpdate configurationUpdateHistory = entityManager.find(ResourceConfigurationUpdate.class, @@ -1343,6 +1366,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf } }
+ @Override public void rollbackPluginConfiguration(Subject subject, int resourceId, int configHistoryId) throws ConfigurationUpdateException { PluginConfigurationUpdate configurationUpdateHistory = entityManager.find(PluginConfigurationUpdate.class, @@ -1356,6 +1380,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf updatePluginConfiguration(subject, resourceId, configuration); }
+ @Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public ResourceConfigurationUpdate persistNewResourceConfigurationUpdateHistory(Subject subject, int resourceId, Configuration newConfiguration, ConfigurationUpdateStatus newStatus, String newSubject, @@ -1453,6 +1478,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf log.debug(callingMethod + ": " + stats); }
+ @Override public void completeResourceConfigurationUpdate(ConfigurationUpdateResponse response) { log.debug("Received a configuration-update-completed message: " + response);
@@ -1489,6 +1515,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return; }
+ @Override @SuppressWarnings("unchecked") public void checkForCompletedGroupResourceConfigurationUpdate(int resourceConfigUpdateId) { ResourceConfigurationUpdate resourceConfigUpdate = entityManager.find(ResourceConfigurationUpdate.class, @@ -1537,6 +1564,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return; }
+ @Override public ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject, int packageTypeId) { Query query = entityManager.createNamedQuery(ConfigurationDefinition.QUERY_FIND_DEPLOYMENT_BY_PACKAGE_TYPE_ID); query.setParameter("packageTypeId", packageTypeId); @@ -1553,7 +1581,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return configurationDefinition; }
- @Nullable + @Override public ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId) { Query query = entityManager.createNamedQuery(ConfigurationDefinition.QUERY_FIND_RESOURCE_BY_RESOURCE_TYPE_ID); query.setParameter("resourceTypeId", resourceTypeId); @@ -1570,6 +1598,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return configurationDefinition; }
+ @Override @Nullable public ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType(Subject subject, int resourceTypeId) { @@ -1593,17 +1622,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return configurationDefinition; }
- public boolean hasPluginConfiguration(int resourceTypeId) { - Query countQuery = PersistenceUtility.createCountQuery(entityManager, - ConfigurationDefinition.QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID); - - countQuery.setParameter("resourceTypeId", resourceTypeId); - long count = (Long) countQuery.getSingleResult(); - - return (count != 0L); - } - - @Nullable + @Override public ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId) { Query query = entityManager.createNamedQuery(ConfigurationDefinition.QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID); query.setParameter("resourceTypeId", resourceTypeId); @@ -1672,21 +1691,25 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return liveConfig; }
+ @Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public AbstractResourceConfigurationUpdate mergeConfigurationUpdate( AbstractResourceConfigurationUpdate configurationUpdate) { return this.entityManager.merge(configurationUpdate); }
+ @Override public Configuration getConfigurationById(int id) { return entityManager.find(Configuration.class, id); }
+ @Override public Configuration getConfiguration(Subject subject, int configurationId) { Configuration configuration = getConfigurationById(configurationId); return configuration; }
+ @Override public Configuration getConfigurationFromDefaultTemplate(ConfigurationDefinition definition) { ConfigurationDefinition managedDefinition = entityManager.find(ConfigurationDefinition.class, definition.getId()); @@ -1706,12 +1729,14 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf this.resourceManager.clearResourceConfigError(resource.getId()); }
+ @Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public int createGroupConfigurationUpdate(AbstractGroupConfigurationUpdate update) throws SchedulerException { entityManager.persist(update); return update.getId(); }
+ @Override public int scheduleGroupPluginConfigurationUpdate(Subject subject, int compatibleGroupId, Map<Integer, Configuration> memberPluginConfigurations) throws SchedulerException {
@@ -1765,10 +1790,10 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updateId; }
- public int scheduleGroupResourceConfigurationUpdate(Subject subject, int compatibleGroupId,// - @WebParam(targetNamespace = ServerVersion.namespace)// - @XmlJavaTypeAdapter(WebServiceTypeAdapter.class)// + @Override + public int scheduleGroupResourceConfigurationUpdate(Subject subject, int compatibleGroupId, Map<Integer, Configuration> newResourceConfigurationMap) { + if (newResourceConfigurationMap == null) { throw new IllegalArgumentException( "GroupResourceConfigurationUpdate must have non-null member configurations."); @@ -1868,6 +1893,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findGroupPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.GroupPluginConfigurationUpdateCriteria)} */ + @Override public GroupPluginConfigurationUpdate getGroupPluginConfigurationById(int configurationUpdateId) { GroupPluginConfigurationUpdate update = entityManager.find(GroupPluginConfigurationUpdate.class, configurationUpdateId); @@ -1877,12 +1903,14 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findGroupResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria)} */ + @Override public GroupResourceConfigurationUpdate getGroupResourceConfigurationById(int configurationUpdateId) { GroupResourceConfigurationUpdate update = entityManager.find(GroupResourceConfigurationUpdate.class, configurationUpdateId); return update; }
+ @Override @SuppressWarnings("unchecked") public PageList<ConfigurationUpdateComposite> findPluginConfigurationUpdateCompositesByParentId( int configurationUpdateId, PageControl pageControl) { @@ -1899,6 +1927,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return new PageList<ConfigurationUpdateComposite>(results, (int) count, pageControl); }
+ @Override @SuppressWarnings("unchecked") public PageList<ConfigurationUpdateComposite> findResourceConfigurationUpdateCompositesByParentId(Subject subject, int configurationUpdateId, PageControl pageControl) { @@ -1923,6 +1952,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.PluginConfigurationUpdateCriteria)} */ + @Override @SuppressWarnings("unchecked") public PageList<Integer> findPluginConfigurationUpdatesByParentId(int configurationUpdateId, PageControl pageControl) { pageControl.initDefaultOrderingField("cu.modifiedTime"); @@ -1938,6 +1968,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return new PageList<Integer>(results, (int) count, pageControl); }
+ @Override public long getPluginConfigurationUpdateCountByParentId(int configurationUpdateId) { Query countQuery = PersistenceUtility.createCountQuery(entityManager, PluginConfigurationUpdate.QUERY_FIND_BY_PARENT_UPDATE_ID); @@ -1948,6 +1979,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.ResourceConfigurationUpdateCriteria)} */ + @Override @SuppressWarnings("unchecked") public PageList<Integer> findResourceConfigurationUpdatesByParentId(int groupConfigurationUpdateId, PageControl pageControl) { @@ -1964,6 +1996,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return new PageList<Integer>(results, (int) count, pageControl); }
+ @Override public long getResourceConfigurationUpdateCountByParentId(int groupConfigurationUpdateId) { Query countQuery = PersistenceUtility.createCountQuery(entityManager, ResourceConfigurationUpdate.QUERY_FIND_BY_PARENT_UPDATE_ID); @@ -1971,6 +2004,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return (Long) countQuery.getSingleResult(); }
+ @Override @SuppressWarnings("unchecked") public Map<Integer, Configuration> getResourceConfigurationMapForGroupUpdate(Subject subject, Integer groupResourceConfigurationUpdateId) { @@ -1998,6 +2032,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return results; }
+ @Override @SuppressWarnings("unchecked") public Map<Integer, Configuration> getPluginConfigurationMapForGroupUpdate(Subject subject, Integer groupPluginConfigurationUpdateId) { @@ -2062,6 +2097,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findGroupPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.GroupPluginConfigurationUpdateCriteria)} */ + @Override @SuppressWarnings("unchecked") public PageList<GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdates(int groupId, PageControl pc) { pc.initDefaultOrderingField("modifiedTime", PageOrdering.DESC); @@ -2083,6 +2119,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findGroupResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria)} */ + @Override @SuppressWarnings("unchecked") public PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdates(Subject subject, int groupId, PageControl pc) { @@ -2107,6 +2144,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return new PageList<GroupResourceConfigurationUpdate>(results, (int) count, pc); }
+ @Override @SuppressWarnings("unchecked") public ConfigurationUpdateStatus updateGroupResourceConfigurationUpdateStatus( int groupResourceConfigurationUpdateId, String errorMessages) { @@ -2121,6 +2159,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return completeGroupConfigurationUpdate(groupResourceConfigUpdate, updateStatusTuples, errorMessages); }
+ @Override @SuppressWarnings("unchecked") public ConfigurationUpdateStatus updateGroupPluginConfigurationUpdateStatus(int groupPluginConfigurationUpdateId, String errorMessages) { @@ -2151,6 +2190,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return groupConfigUpdateStatus; // if the caller wants to know what the new status was }
+ @Override public int deleteGroupPluginConfigurationUpdates(Subject subject, Integer resourceGroupId, Integer[] groupPluginConfigurationUpdateIds) {
@@ -2186,6 +2226,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return removed; }
+ @Override public int deleteGroupResourceConfigurationUpdates(Subject subject, Integer resourceGroupId, Integer[] groupResourceConfigurationUpdateIds) {
@@ -2219,11 +2260,13 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return removed; }
+ @Override public void updateGroupConfigurationUpdate(AbstractGroupConfigurationUpdate groupUpdate) { // TODO jmarques: if (errorMessages != null) set any remaining INPROGRESS children to FAILURE entityManager.merge(groupUpdate); }
+ @Override public void deleteConfigurations(List<Integer> configurationIds) { if (configurationIds == null || configurationIds.size() == 0) { return; @@ -2249,6 +2292,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf configurationsQuery.executeUpdate(); // uses DB-level cascades to delete properties }
+ @Override public void deleteProperties(int[] propertyIds) { if (propertyIds == null || propertyIds.length == 0) { return; @@ -2262,6 +2306,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findGroupPluginConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.GroupPluginConfigurationUpdateCriteria)} */ + @Override public GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(Subject subject, int configurationUpdateId) { GroupPluginConfigurationUpdate update = getGroupPluginConfigurationById(configurationUpdateId);
@@ -2279,6 +2324,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf /** * @deprecated use {@link #findGroupResourceConfigurationUpdatesByCriteria(org.rhq.core.domain.auth.Subject, org.rhq.core.domain.criteria.GroupResourceConfigurationUpdateCriteria)} */ + @Override public GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject subject, int configurationUpdateId) { GroupResourceConfigurationUpdate update = getGroupResourceConfigurationById(configurationUpdateId); @@ -2292,6 +2338,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return update; }
+ @Override public Configuration translateResourceConfiguration(Subject subject, int resourceId, Configuration configuration, boolean fromStructured) {
@@ -2323,11 +2370,13 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf } }
+ @Override public Configuration mergeConfiguration(Configuration config) { Configuration out = entityManager.merge(config); return out; }
+ @Override public PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(Subject subject, ResourceConfigurationUpdateCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); @@ -2361,6 +2410,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updates; }
+ @Override public PageList<PluginConfigurationUpdate> findPluginConfigurationUpdatesByCriteria(Subject subject, PluginConfigurationUpdateCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); @@ -2394,6 +2444,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updates; }
+ @Override public PageList<GroupResourceConfigurationUpdate> findGroupResourceConfigurationUpdatesByCriteria(Subject subject, GroupResourceConfigurationUpdateCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); @@ -2426,6 +2477,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updates; }
+ @Override public PageList<GroupPluginConfigurationUpdate> findGroupPluginConfigurationUpdatesByCriteria(Subject subject, GroupPluginConfigurationUpdateCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); @@ -2458,6 +2510,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return updates; }
+ @Override public ConfigurationDefinition getOptionsForConfigurationDefinition(Subject subject, ConfigurationDefinition def) {
for (Map.Entry<String, PropertyDefinition> entry : def.getPropertyDefinitions().entrySet()) { @@ -2532,7 +2585,7 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf return; }
- expr = expr.substring(expr.indexOf(':')+1); + expr = expr.substring(expr.indexOf(':') + 1); criteria.setSearchExpression(expr); } else { criteria.setSearchExpression(expression); @@ -2599,9 +2652,8 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf String mapPropName; if (mapPropLocation.contains("/")) { // List of maps - mapPropName = mapPropLocation.substring(0,mapPropLocation.indexOf('/')); - } - else { + mapPropName = mapPropLocation.substring(0, mapPropLocation.indexOf('/')); + } else { mapPropName = mapPropLocation; } p = configuration.get(mapPropName); @@ -2669,12 +2721,4 @@ public class ConfigurationManagerBean implements ConfigurationManagerLocal, Conf
return true; } - - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // - // Remote Interface Impl - // - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - // ***TODO***: Move all remoted methods below this line. } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java index 9b49959..1ab9e5e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerLocal.java @@ -57,7 +57,7 @@ import org.rhq.enterprise.server.resource.ResourceNotFoundException; * @author Ian Springer */ @Local -public interface ConfigurationManagerLocal { +public interface ConfigurationManagerLocal extends ConfigurationManagerRemote {
/** * Updates the plugin configuration used to connect and communicate with the resource using the information in the @@ -276,19 +276,6 @@ public interface ConfigurationManagerLocal {
/** * Return the resource configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the - * specified id. - * - * @param subject the user who is requesting the resource configuration definition - * @param resourceTypeId identifies the resource type whose resource configuration definition is being requested - * - * @return the resource configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the - * specified id, or <code>null</code> if the ResourceType does not define a resource configuration - */ - @Nullable - ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId); - - /** - * Return the resource configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the * specified id. The templates will be loaded in the definition returned from this call. * * @param subject the user who is requesting the resource configuration definition @@ -302,19 +289,6 @@ public interface ConfigurationManagerLocal { int resourceTypeId);
/** - * Return the plugin configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the - * specified id. - * - * @param subject the user who is requesting the plugin configuration definition - * @param resourceTypeId identifies the resource type whose plugin configuration definition is being requested - * - * @return the plugin configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the - * specified id, or <code>null</code> if the ResourceType does not define a plugin configuration - */ - @Nullable - ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId); - - /** * Merge the specified configuration update into the DB. * * @param configurationUpdate a configuration update @@ -432,31 +406,6 @@ public interface ConfigurationManagerLocal {
public Configuration getConfiguration(Subject subject, int configurationId);
- // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - // - // The following are shared with the Remote Interface - // - // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - - public GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(Subject subject, int configurationUpdateId); - - public GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject subject, - int configurationUpdateId); - - /** - * Get the current plugin configuration for the {@link Resource} with the given id, or <code>null</code> if the - * resource's plugin configuration is not yet initialized. - * - * @param subject the user who wants to see the information - * @param resourceId a {@link Resource} id - * - * @return the current plugin configuration for the {@link Resource} with the given id, or <code>null</code> if the - * resource's configuration is not yet initialized - * @throws FetchException TODO - */ - @Nullable - Configuration getPluginConfiguration(Subject subject, int resourceId); - /** * Get the latest plugin configuration for the {@link Resource} with the given id. Returns the configuration as it * is known on the server-side in the database. @@ -491,54 +440,14 @@ public interface ConfigurationManagerLocal { ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(Subject subject, int resourceId, boolean fromStructured);
- boolean isResourceConfigurationUpdateInProgress(Subject subject, int resourceId); - - boolean isGroupResourceConfigurationUpdateInProgress(Subject subject, int groupId); - boolean isGroupPluginConfigurationUpdateInProgress(Subject subject, int groupId);
- int scheduleGroupResourceConfigurationUpdate(Subject subject, int compatibleGroupId, - Map<Integer, Configuration> newResourceConfigurationMap); - - /** - * Updates the plugin configuration used to connect and communicate with the resource. The given <code> - * newConfiguration</code> is usually a modified version of a configuration returned by - * {@link #getPluginConfiguration(Subject, int)}. - * - * @param subject the user who wants to see the information - * @param resourceId a {@link Resource} id - * @param newConfiguration the new plugin configuration - * - * @return the plugin configuration update item corresponding to this request - */ - PluginConfigurationUpdate updatePluginConfiguration(Subject subject, int resourceId, Configuration newConfiguration) - throws ResourceNotFoundException; - - /** - * This method is called when a user has requested to change the resource configuration for an existing resource. If - * the user does not have the proper permissions to change the resource's configuration, an exception is thrown. - * - * <p>This will not wait for the agent to finish the configuration update. This will return after the request is - * sent. Once the agent finishes with the request, it will send the completed request information to - * {@link #completeResourceConfigurationUpdate}.</p> - * - * @param subject the user who is requesting the update - * @param resourceId identifies the resource to be updated - * @param newConfiguration the resource's desired new configuration - * - * @return the resource configuration update item corresponding to this request. null - * if newConfiguration is equal to the existing configuration. - */ - @Nullable - ResourceConfigurationUpdate updateResourceConfiguration(Subject subject, int resourceId, - Configuration newConfiguration) throws ResourceNotFoundException, ConfigurationUpdateStillInProgressException; + boolean isPluginConfigurationUpdateInProgress(Subject subject, int resourceId);
ResourceConfigurationUpdate updateStructuredOrRawConfiguration(Subject subject, int resourceId, Configuration newConfiguration, boolean fromStructured) throws ResourceNotFoundException, ConfigurationUpdateStillInProgressException;
- Configuration getResourceConfiguration(Subject subject, int resourceId); - /** * This method is called when the plugin container reports a new Resource configuration after an external change was * detected. @@ -548,14 +457,6 @@ public interface ConfigurationManagerLocal { */ void setResourceConfiguration(int resourceId, Configuration configuration);
- /** - * @see ConfigurationManagerRemote#getPackageTypeConfigurationDefinition(Subject,int) - */ - ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject, int packageTypeId); - - Configuration translateResourceConfiguration(Subject subject, int resourceId, Configuration configuration, - boolean fromStructured) throws ResourceNotFoundException, TranslationNotSupportedException; - Configuration mergeConfiguration(Configuration config);
PageList<ResourceConfigurationUpdate> findResourceConfigurationUpdatesByCriteria(Subject subject, diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java index b4836c6..affd51e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/configuration/ConfigurationManagerRemote.java @@ -21,13 +21,6 @@ package org.rhq.enterprise.server.configuration; import java.util.Map;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.AbstractResourceConfigurationUpdate; @@ -38,10 +31,7 @@ import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate; import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate; import org.rhq.core.domain.resource.Resource; -import org.rhq.enterprise.server.jaxb.WebServiceTypeAdapter; -import org.rhq.enterprise.server.jaxb.adapter.ConfigurationAdapter; import org.rhq.enterprise.server.resource.ResourceNotFoundException; -import org.rhq.enterprise.server.system.ServerVersion;
/** * The configuration manager which allows you to request resource configuration changes, view current resource @@ -50,38 +40,25 @@ import org.rhq.enterprise.server.system.ServerVersion; * @author John Mazzitelli * @author Ian Springer */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface ConfigurationManagerRemote {
- @WebMethod - GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "configurationUpdateId") int configurationUpdateId); + GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(Subject subject, int configurationUpdateId);
- @WebMethod - GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "configurationUpdateId") int configurationUpdateId); + GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject subject, int configurationUpdateId);
/** * Get the current plugin configuration for the {@link Resource} with the given id, or <code>null</code> if the * resource's plugin configuration is not yet initialized. * - * @param user The logged in user's subject. - * @param resourceId Resource Id + * @param subject the user who wants to see the information + * @param resourceId a {@link Resource} id * * @return the current plugin configuration for the {@link Resource} with the given id, or <code>null</code> if the * resource's configuration is not yet initialized * @throws FetchException */ - @Nullable - @WebMethod - @XmlJavaTypeAdapter(ConfigurationAdapter.class) - Configuration getPluginConfiguration( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + Configuration getPluginConfiguration(Subject subject, int resourceId);
/** * Get the current Resource configuration. @@ -91,21 +68,12 @@ public interface ConfigurationManagerRemote { * * @throws FetchException In case where there was a problem fetching the resource configuration */ - @WebMethod - @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration getResourceConfiguration(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + Subject subject, int resourceId);
- @WebMethod - PluginConfigurationUpdate getLatestPluginConfigurationUpdate( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + PluginConfigurationUpdate getLatestPluginConfigurationUpdate(Subject subject, int resourceId);
- @WebMethod - ResourceConfigurationUpdate getLatestResourceConfigurationUpdate( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(Subject subject, int resourceId);
/** * Get whether the the specified resource is in the process of updating its configuration. @@ -114,25 +82,12 @@ public interface ConfigurationManagerRemote { * @return True if in progress, else False. * @throws FetchException */ - @WebMethod - boolean isResourceConfigurationUpdateInProgress( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + boolean isResourceConfigurationUpdateInProgress(Subject subject, int resourceId);
- @WebMethod - boolean isGroupResourceConfigurationUpdateInProgress( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceGroupId") int resourceGroupId); + boolean isGroupResourceConfigurationUpdateInProgress(Subject subject, int resourceGroupId);
- /* this currently doesn't build because jaxws requires a default, no-arg constructor from all objects in the graph - * in order to perform serialization correctly, and java.util.Map does not have one (because it's an interface) - * */ - @WebMethod - int scheduleGroupResourceConfigurationUpdate(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "compatibleGroupId") int compatibleGroupId, // - @XmlJavaTypeAdapter(WebServiceTypeAdapter.class)// - @WebParam(name = "newResourceConfigurationMap", targetNamespace = ServerVersion.namespace) Map<Integer, Configuration> newResourceConfigurationMap); + int scheduleGroupResourceConfigurationUpdate(Subject subject, int compatibleGroupId, + Map<Integer, Configuration> newResourceConfigurationMap);
/** * Updates the plugin configuration used to connect and communicate with the resource. The given <code> @@ -145,12 +100,7 @@ public interface ConfigurationManagerRemote { * * @return the plugin configuration update item corresponding to this request */ - @WebMethod - PluginConfigurationUpdate updatePluginConfiguration( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "newConfiguration")// - @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration newConfiguration) + PluginConfigurationUpdate updatePluginConfiguration(Subject subject, int resourceId, Configuration newConfiguration) throws ResourceNotFoundException;
/** @@ -167,13 +117,10 @@ public interface ConfigurationManagerRemote { * * @return the resource configuration update item corresponding to this request */ - @WebMethod - ResourceConfigurationUpdate updateResourceConfiguration( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "newConfiguration")// - @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration newConfiguration) - throws ResourceNotFoundException, ConfigurationUpdateStillInProgressException; + + ResourceConfigurationUpdate updateResourceConfiguration(Subject subject, int resourceId, + + Configuration newConfiguration) throws ResourceNotFoundException, ConfigurationUpdateStillInProgressException;
/** * Get the currently live resource configuration for the {@link Resource} with the given id. This actually asks for @@ -188,11 +135,7 @@ public interface ConfigurationManagerRemote { * * @throws Exception if failed to get the configuration from the agent */ - @WebMethod - Configuration getLiveResourceConfiguration( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "pingAgentFirst") boolean pingAgentFirst) // + Configuration getLiveResourceConfiguration(Subject subject, int resourceId, boolean pingAgentFirst) throws Exception;
/** @@ -205,9 +148,7 @@ public interface ConfigurationManagerRemote { * @return the resource configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the * specified id, or <code>null</code> if the ResourceType does not define a resource configuration */ - @WebMethod - ConfigurationDefinition getResourceConfigurationDefinitionForResourceType( - @WebParam(name = "subject") Subject subject, @WebParam(name = "resourceTypeId") int resourceTypeId); + ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId);
/** * Return the resource configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the @@ -219,9 +160,8 @@ public interface ConfigurationManagerRemote { * @return the resource configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the * specified id, or <code>null</code> if the ResourceType does not define a resource configuration */ - @WebMethod - ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType( - @WebParam(name = "subject") Subject subject, @WebParam(name = "resourceTypeId") int resourceTypeId); + ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType(Subject subject, + int resourceTypeId);
/** * Return the plugin configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the @@ -233,9 +173,7 @@ public interface ConfigurationManagerRemote { * @return the plugin configuration definition for the {@link org.rhq.core.domain.resource.ResourceType} with the * specified id, or <code>null</code> if the ResourceType does not define a plugin configuration */ - @WebMethod - ConfigurationDefinition getPluginConfigurationDefinitionForResourceType( - @WebParam(name = "subject") Subject subject, @WebParam(name = "resourceTypeId") int resourceTypeId); + ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId);
/** * Return the deploy configuration definition for the {@link org.rhq.core.domain.content.PackageType} with the @@ -247,12 +185,8 @@ public interface ConfigurationManagerRemote { * @return the the deploy configuration definition for the {@link org.rhq.core.domain.content.PackageType} with the * specified id. */ - @WebMethod - ConfigurationDefinition getPackageTypeConfigurationDefinition( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "packageTypeId") int packageTypeId); + ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject, int packageTypeId);
Configuration translateResourceConfiguration(Subject subject, int resourceId, Configuration configuration, boolean fromStructured) throws ResourceNotFoundException; - } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java index e2e37c5..5e55090 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentManagerRemote.java @@ -21,10 +21,6 @@ package org.rhq.enterprise.server.content; import java.util.List;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.content.Architecture; @@ -39,13 +35,11 @@ import org.rhq.core.domain.criteria.PackageCriteria; import org.rhq.core.domain.criteria.PackageVersionCriteria; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.resource.ResourceTypeNotFoundException; -import org.rhq.enterprise.server.system.ServerVersion;
/** * @author Jay Shaughnessy */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) + @Remote public interface ContentManagerRemote {
@@ -63,14 +57,8 @@ public interface ContentManagerRemote { * @return newly created package version if one did not exist; existing package version that matches these data if * one was found */ - @WebMethod - PackageVersion createPackageVersion( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "packageName") String packageName, // - @WebParam(name = "packageTypeId") int packageTypeId, // - @WebParam(name = "version") String version, // - @WebParam(name = "architectureId") Integer architectureId, // - @WebParam(name = "packageBytes") byte[] packageBytes); + PackageVersion createPackageVersion(Subject subject, String packageName, int packageTypeId, String version, + Integer architectureId, byte[] packageBytes);
/** * Creates a new package version in the system. If the parent package (identified by the packageName parameter) does @@ -86,15 +74,8 @@ public interface ContentManagerRemote { * @return newly created package version if one did not exist; existing package version that matches these data if * one was found */ - @WebMethod - PackageVersion createPackageVersionWithDisplayVersion( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "packageName") String packageName, // - @WebParam(name = "packageTypeId") int packageTypeId, // - @WebParam(name = "version") String version, // - @WebParam(name = "displayVersion") String displayVersion, // - @WebParam(name = "architectureId") Integer architectureId, // - @WebParam(name = "packageBytes") byte[] packageBytes); + PackageVersion createPackageVersionWithDisplayVersion(Subject subject, String packageName, int packageTypeId, + String version, String displayVersion, Integer architectureId, byte[] packageBytes);
/** * Deletes the specified package from the resource. @@ -103,12 +84,7 @@ public interface ContentManagerRemote { * @param resourceId identifies the resource from which the packages should be deleted * @param installedPackageIds identifies all of the packages to be deleted */ - @WebMethod - void deletePackages( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "installedPackages") int[] installedPackageIds, // - @WebParam(name = "requestNotes") String requestNotes); + void deletePackages(Subject subject, int resourceId, int[] installedPackageIds, String requestNotes);
/** * Deletes the specified PackageVersion from the system. The PackageVersion must be an orphan to be @@ -118,10 +94,8 @@ public interface ContentManagerRemote { * @param subject The logged in subject * @param packageVersionId The PackageVersion to delete. */ - @WebMethod public void deletePackageVersion(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + Subject subject, int resourceId);
/** * Deploys packages on the specified resources. Each installed package entry should be populated with the <code> @@ -132,12 +106,8 @@ public interface ContentManagerRemote { * @param resourceIds identifies the resources against which the package will be deployed * @param packageVersionIds packageVersions we want to install */ - @WebMethod @Deprecated - void deployPackages( - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") int[] resourceIds, // - @WebParam(name = "packageVersionIds") int[] packageVersionIds); + void deployPackages(Subject subject, int[] resourceIds, int[] packageVersionIds);
/** * Deploys packages on the specified resources. Each installed package entry should be populated with the <code> @@ -149,12 +119,7 @@ public interface ContentManagerRemote { * @param packageVersionIds packageVersions we want to install * @param requestNotes request notes */ - @WebMethod - void deployPackagesWithNote( - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") int[] resourceIds, // - @WebParam(name = "packageVersionIds") int[] packageVersionIds, - @WebParam(name = "requestNotes") String requestNotes); + void deployPackagesWithNote(Subject subject, int[] resourceIds, int[] packageVersionIds, String requestNotes);
/** * Returns all architectures known to the system. @@ -162,9 +127,7 @@ public interface ContentManagerRemote { * @param subject The logged in subject * @return list of all architectures in the database */ - @WebMethod - List<Architecture> findArchitectures( // - @WebParam(name = "subject") Subject subject); + List<Architecture> findArchitectures(Subject subject);
/** * This gets the package types that can be deployed to the given resource. It is a function of the resource @@ -175,11 +138,8 @@ public interface ContentManagerRemote { * * @return The requested list of package types. Can be empty. */ - @WebMethod - List<PackageType> findPackageTypes( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceTypeName") String resourceTypeName, // - @WebParam(name = "pluginName") String pluginName) throws ResourceTypeNotFoundException; + List<PackageType> findPackageTypes(Subject subject, String resourceTypeName, String pluginName) + throws ResourceTypeNotFoundException;
/** * This re tries to find a package type of given name defined by the resource type @@ -193,12 +153,7 @@ public interface ContentManagerRemote { * @param packageTypeName the name of the package type to find * @return */ - @WebMethod - PackageType findPackageType( - @WebParam(name = "subject") Subject subject, - @WebParam(name = "resourceTypeId") Integer resourceTypeId, - @WebParam(name = "packageTypeName") String packageTypeName - ); + PackageType findPackageType(Subject subject, Integer resourceTypeId, String packageTypeName);
/** * Similar to {@link #findPackageType(Subject, Integer, String)} but @@ -209,21 +164,15 @@ public interface ContentManagerRemote { * @param packageTypeName * @return */ - @WebMethod - PackageTypeAndVersionFormatComposite findPackageTypeWithVersionFormat( - @WebParam(name = "subject") Subject subject, - @WebParam(name ="resourceTypeId") Integer resourceTypeId, - @WebParam(name = "packageTypeName") String packageTypeName); + PackageTypeAndVersionFormatComposite findPackageTypeWithVersionFormat(Subject subject, Integer resourceTypeId, + String packageTypeName);
/** * @param subject * @param criteria {@link InstalledPackageCriteria} * @return InstalledPackages for the criteria */ - @WebMethod - PageList<InstalledPackage> findInstalledPackagesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") InstalledPackageCriteria criteria); + PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject, InstalledPackageCriteria criteria);
/** * If a resourceId filter is not set via {@link PackageVersionCriteria.addFilterResourceId()} then @@ -235,10 +184,7 @@ public interface ContentManagerRemote { * @return Installed PackageVersions for the resource * @throws IllegalArgumentException for invalid resourceId filter */ - @WebMethod - PageList<PackageVersion> findPackageVersionsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") PackageVersionCriteria criteria); + PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject, PackageVersionCriteria criteria);
/** * If the criteria object filters on repo id, the subject needs to be able to @@ -249,10 +195,7 @@ public interface ContentManagerRemote { * @param criteria * @return */ - @WebMethod - PageList<Package> findPackagesByCriteria( - @WebParam(name = "subject") Subject subject, - @WebParam(name = "criteria") PackageCriteria criteria); + PageList<Package> findPackagesByCriteria(Subject subject, PackageCriteria criteria);
/** * Akin to {@link #findPackagesByCriteria(Subject, PackageCriteria)} but also @@ -265,10 +208,7 @@ public interface ContentManagerRemote { * @return * @throws IllegalArgumentException if the criteria doesn't define a repo filter */ - @WebMethod - PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion( - @WebParam(name = "subject") Subject subject, - @WebParam(name = "criteria") PackageCriteria criteria); + PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion(Subject subject, PackageCriteria criteria);
/** * For a resource that is content-backed (aka package-backed), this call will return InstalledPackage information @@ -277,19 +217,14 @@ public interface ContentManagerRemote { * @param resourceId a valid resource * @return The InstalledPackage object for the content-packed resource. Or null for non-existent or non-package backed resource. */ - @WebMethod - InstalledPackage getBackingPackageForResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + InstalledPackage getBackingPackageForResource(Subject subject, int resourceId);
/** * This can be a dangerous call for large packages as the entire package will attempt to be loaded. - * @param user + * @param subject * @param resourceId * @param installedPackageId * @return the package bytes */ - @WebMethod - byte[] getPackageBytes(@WebParam(name = "subject") Subject user, @WebParam(name = "resourceId") int resourceId, - @WebParam(name = "installedPackageId") int installedPackageId); + byte[] getPackageBytes(Subject subject, int resourceId, int installedPackageId); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java index 9b01413..ef1dc39 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/ContentSourceManagerBean.java @@ -133,7 +133,6 @@ import org.rhq.enterprise.server.util.LookupUtil; */ // TODO: all authz checks need to be more fine grained... entitlements need to plug into here somehow? @Stateless -//@WebService(endpointInterface = "org.rhq.enterprise.server.content.ContentSourceManagerRemote") public class ContentSourceManagerBean implements ContentSourceManagerLocal { /** * The location we store the bits and distro files diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerRemote.java index 45c0c5a..98db824 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/content/RepoManagerRemote.java @@ -21,10 +21,6 @@ package org.rhq.enterprise.server.content; import java.util.List;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.content.PackageVersion; @@ -35,10 +31,7 @@ import org.rhq.core.domain.criteria.RepoCriteria; import org.rhq.core.domain.resource.Resource; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface RepoManagerRemote {
@@ -49,11 +42,7 @@ public interface RepoManagerRemote { * @param repoId the ID of the repo * @param packageVersionIds the list of package version IDs to add to the repo */ - @WebMethod - void addPackageVersionsToRepo( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repoId") int repoId, // - @WebParam(name = "packageVersionIds") int[] packageVersionIds); + void addPackageVersionsToRepo(Subject subject, int repoId, int[] packageVersionIds);
/** * Creates a new {@link Repo}. Note that the created repo will not have any content sources assigned and no @@ -65,11 +54,7 @@ public interface RepoManagerRemote { * @return the newly created repo * @throws RepoException if a repo already exists with the same name */ - @WebMethod - Repo createRepo( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repo") Repo repo) // - throws RepoException; + Repo createRepo(Subject subject, Repo repo) throws RepoException;
/** * Deletes the indicated repo. If this deletion orphans package versions (that is, its originating resource or @@ -78,10 +63,7 @@ public interface RepoManagerRemote { * @param subject The logged in user's subject. * @param repoId identifies the repo to delete */ - @WebMethod - void deleteRepo( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repoId") int repoId); + void deleteRepo(Subject subject, int repoId);
/** * Returns the repo with the given id; throws an error if one does not exist at that id. @@ -90,10 +72,7 @@ public interface RepoManagerRemote { * @param repoId identifies the repo to be retrieved * @return details describing the repo */ - @WebMethod - Repo getRepo( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repoId") int repoId); + Repo getRepo(Subject subject, int repoId);
/** * Returns all repos that match the given criteria. @@ -102,10 +81,7 @@ public interface RepoManagerRemote { * @param criteria describes how the query should function; may not be <code>null</code> * @return any repos that match the given criteria; empty list if none match */ - @WebMethod - PageList<Repo> findReposByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") RepoCriteria criteria); + PageList<Repo> findReposByCriteria(Subject subject, RepoCriteria criteria);
/** * Returns all imported repos in the server. @@ -114,10 +90,7 @@ public interface RepoManagerRemote { * @param pc used for pagination * @return paged list */ - @WebMethod - PageList<Repo> findRepos( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "pageControl") PageControl pc); + PageList<Repo> findRepos(Subject subject, PageControl pc);
/** * @param subject @@ -125,10 +98,7 @@ public interface RepoManagerRemote { * @return PackageVersions for the repo * @throws IllegalArgumentException for invalid repoId filter */ - @WebMethod - PageList<PackageVersion> findPackageVersionsInRepoByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") PackageVersionCriteria criteria); + PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject, PackageVersionCriteria criteria);
/** * Returns the latest package version of the supplied package. @@ -143,12 +113,8 @@ public interface RepoManagerRemote { * @param repoId the repo where to take the package versions of the package from * @return */ - @WebMethod - PackageVersion getLatestPackageVersion( - @WebParam(name = "subject") Subject subject, - @WebParam(name = "packageId") int packageId, - @WebParam(name = "repoId") int repoId); - + PackageVersion getLatestPackageVersion(Subject subject, int packageId, int repoId); + /** * Update an existing {@link Repo} object's basic fields, like name, description, etc. Note that the given <code> * repo</code>'s relationships will be ignored and not merged with the existing repo (e.g. is subscribed @@ -159,11 +125,7 @@ public interface RepoManagerRemote { * * @return Repo that was updated */ - @WebMethod - Repo updateRepo( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repo") Repo repo) // - throws RepoException; + Repo updateRepo(Subject subject, Repo repo) throws RepoException;
/** * Returns the set of package versions that can currently be accessed via the given repo. @@ -175,12 +137,7 @@ public interface RepoManagerRemote { * * @return the package versions that are available in the repo */ - @WebMethod - PageList<PackageVersion> findPackageVersionsInRepo( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repoId") int repoId, // - @WebParam(name = "filter") String filter, // - @WebParam(name = "pageControl") PageControl pc); + PageList<PackageVersion> findPackageVersionsInRepo(Subject subject, int repoId, String filter, PageControl pc);
/** * Deletes package versions from a repo if they are not referenced by @@ -194,12 +151,8 @@ public interface RepoManagerRemote { * @param packageVersionIds * @return true if all the package versions were successfully deleted, false if some references exist. */ - @WebMethod - boolean deletePackageVersionsFromRepo( - @WebParam(name = "subject") Subject subject, - @WebParam(name = "repoId") int repoId, - @WebParam(name = "packageVersionIds") int[] packageVersionId); - + boolean deletePackageVersionsFromRepo(Subject subject, int repoId, int[] packageVersionId); + /** * Gets all resources that are subscribed to the given repo. * @@ -209,11 +162,7 @@ public interface RepoManagerRemote { * * @return the list of subscribers */ - @WebMethod - PageList<Resource> findSubscribedResources( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repoId") int repoId, // - @WebParam(name = "pageControl") PageControl pc); + PageList<Resource> findSubscribedResources(Subject subject, int repoId, PageControl pc);
/** * Get a list of truncated Repo objects that represent the @@ -222,10 +171,7 @@ public interface RepoManagerRemote { * @param resourceId The id of the resource. * @return A list of repos. */ - @WebMethod - List<SubscribedRepo> findSubscriptions( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + List<SubscribedRepo> findSubscriptions(Subject subject, int resourceId);
/** * Subscribes the identified resource to the set of identified repos. Once complete, the resource will be able to @@ -235,11 +181,7 @@ public interface RepoManagerRemote { * @param resourceId The id of the resource to be subscribed. * @param repoIds A list of repos to which the resource is subscribed. */ - @WebMethod - void subscribeResourceToRepos( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "repoIds") int[] repoIds); + void subscribeResourceToRepos(Subject subject, int resourceId, int[] repoIds);
/** * Unsubscribes the identified resource from the set of identified repos. @@ -248,28 +190,18 @@ public interface RepoManagerRemote { * @param resourceId The id of the resource to be subscribed. * @param repoIds A list of repos to which the resource is subscribed. */ - @WebMethod - void unsubscribeResourceFromRepos( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "repoIds") int[] repoIds); + void unsubscribeResourceFromRepos(Subject subject, int resourceId, int[] repoIds);
- @WebMethod - int synchronizeRepos( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "repoIds") int[] repoIds) // - throws Exception; + int synchronizeRepos(Subject subject, int[] repoIds) throws Exception;
/** * This method allows for downloading the bytes of an arbitrary package version. This call can be dangerous with * large packages because it will attempt to load the whole package in memory. * - * @param user + * @param subject * @param repoId * @param packageVersionId * @return the bytes of the package version */ - @WebMethod - byte[] getPackageVersionBytes(@WebParam(name = "subject") Subject user, @WebParam(name = "repoId") int repoId, - @WebParam(name = "packageVersionId") int packageVersionId); + byte[] getPackageVersionBytes(Subject subject, int repoId, int packageVersionId); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java index 7ece912..a332113 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/comm/ServerCommunicationsService.java @@ -69,7 +69,6 @@ import org.rhq.enterprise.server.agentclient.AgentClient; import org.rhq.enterprise.server.agentclient.impl.AgentClientImpl; import org.rhq.enterprise.server.cloud.instance.ServerManagerLocal; import org.rhq.enterprise.server.remote.RemoteSafeInvocationHandler; -import org.rhq.enterprise.server.remote.RemoteWsInvocationHandler; import org.rhq.enterprise.server.util.LookupUtil;
/** @@ -149,7 +148,6 @@ public class ServerCommunicationsService implements ServerCommunicationsServiceM * The invocation handler used to process incoming remote API requests from things such as the CLI. */ private RemoteSafeInvocationHandler m_remoteApiHandler; - private RemoteWsInvocationHandler m_remoteWsApiHandler;
/** * Sets up some internal state. @@ -201,11 +199,6 @@ public class ServerCommunicationsService implements ServerCommunicationsServiceM m_remoteApiHandler.registerMetricsMBean(container.getMBeanServer()); container.addInvocationHandler(REMOTE_API_SUBSYSTEM, m_remoteApiHandler);
- // now let's add our additional handler to support the remote clients (e.g. CLI) - m_remoteWsApiHandler = new RemoteWsInvocationHandler(); - // m_remoteWsApiHandler.registerMetricsMBean(container.getMBeanServer()); - container.addInvocationHandler(WS_REMOTE_API_SUBSYSTEM, m_remoteWsApiHandler); - m_container = container; m_configuration = config; m_started = true; @@ -235,7 +228,6 @@ public class ServerCommunicationsService implements ServerCommunicationsServiceM m_container.shutdown(); m_container = null; m_remoteApiHandler = null; - m_remoteWsApiHandler = null; m_started = false; }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossRemote.java index ee0a1f6..9abf57b 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/discovery/DiscoveryBossRemote.java @@ -19,22 +19,14 @@ package org.rhq.enterprise.server.discovery;
import javax.ejb.Remote; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; - -import org.jetbrains.annotations.NotNull;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.resource.Resource; -import org.rhq.enterprise.server.system.ServerVersion;
/** * The remote boss interface to the discovery subsystem. */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface DiscoveryBossRemote {
@@ -46,9 +38,7 @@ public interface DiscoveryBossRemote { * @param subject * @param resourceIds */ - void importResources( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") int[] resourceIds); + void importResources(Subject subject, int[] resourceIds);
/** * Analogous to the GUI feature Ignore Resources in the auto discovery queue. @@ -58,9 +48,7 @@ public interface DiscoveryBossRemote { * @param subject * @param resourceIds */ - void ignoreResources( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") int[] resourceIds); + void ignoreResources(Subject subject, int[] resourceIds);
/** * Analogous to the GUI feature Unignore Resources in the auto discovery queue. @@ -70,9 +58,7 @@ public interface DiscoveryBossRemote { * @param subject * @param resourceIds */ - void unignoreResources( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") int[] resourceIds); + void unignoreResources(Subject subject, int[] resourceIds);
/** * Manually Add the resource of the specified type to inventory using the specified plugin configuration (i.e. @@ -90,12 +76,7 @@ public interface DiscoveryBossRemote { * @throws Exception if connecting to the underlying managed resource failed due to invalid plugin configuration or * if the manual discovery fails for any reason. */ - @NotNull - Resource manuallyAddResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceTypeId") int resourceTypeId, // - @WebParam(name = "parentResourceId") int parentResourceId, // - @WebParam(name = "pluginConfiguration") Configuration pluginConfiguration) // - throws Exception; + Resource manuallyAddResource(Subject subject, int resourceTypeId, int parentResourceId, + Configuration pluginConfiguration) throws Exception;
} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerRemote.java index 424a529..742e746 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/event/EventManagerRemote.java @@ -19,50 +19,23 @@ package org.rhq.enterprise.server.event;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.EventCriteria; import org.rhq.core.domain.event.Event; import org.rhq.core.domain.event.EventSeverity; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface EventManagerRemote {
- @WebMethod - EventSeverity[] getSeverityBuckets( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "begin") long begin, // - @WebParam(name = "end") long end, // - @WebParam(name = "numBuckets") int numBuckets); + EventSeverity[] getSeverityBuckets(Subject subject, int resourceId, long begin, long end, int numBuckets);
- @WebMethod - EventSeverity[] getSeverityBucketsForAutoGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "parentResourceId") int parentResourceId, // - @WebParam(name = "resourceTypeId") int resourceTypeId, // - @WebParam(name = "begin") long begin, // - @WebParam(name = "end") long end, // - @WebParam(name = "numBuckets") int numBuckets); + EventSeverity[] getSeverityBucketsForAutoGroup(Subject subject, int parentResourceId, int resourceTypeId, + long begin, long end, int numBuckets);
- @WebMethod - EventSeverity[] getSeverityBucketsForCompGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceGroupId") int resourceGroupId, // - @WebParam(name = "begin") long begin, // - @WebParam(name = "end") long end, // - @WebParam(name = "numBuckets") int numBuckets); + EventSeverity[] getSeverityBucketsForCompGroup(Subject subject, int resourceGroupId, long begin, long end, + int numBuckets);
- @WebMethod - PageList<Event> findEventsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") EventCriteria criteria); + PageList<Event> findEventsByCriteria(Subject subject, EventCriteria criteria); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java index 9b85f05..14387b9 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/install/remote/RemoteInstallManagerRemote.java @@ -23,23 +23,16 @@ package org.rhq.enterprise.server.install.remote;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.install.remote.AgentInstallInfo; import org.rhq.core.domain.install.remote.RemoteAccessInfo; -import org.rhq.enterprise.server.system.ServerVersion;
/** * Provides an interface to remotely install an RHQ Agent over SSH. * * @author Greg Hinkle */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface RemoteInstallManagerRemote { /** @@ -51,11 +44,7 @@ public interface RemoteInstallManagerRemote { * * @return true if an agent is installed in the given install path, false if not */ - @WebMethod - boolean agentInstallCheck( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // - @WebParam(name = "agentInstallPath") String agentInstallPath); + boolean agentInstallCheck(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
/** * Installs the agent update binary distribution file to the given parent @@ -69,11 +58,7 @@ public interface RemoteInstallManagerRemote { * * @return info containing the results of the installation */ - @WebMethod - AgentInstallInfo installAgent( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // - @WebParam(name = "parentPath") String parentPath); + AgentInstallInfo installAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath);
/** * Starts the agent located in the given installation directory. @@ -84,11 +69,7 @@ public interface RemoteInstallManagerRemote { * * @return results of the start command */ - @WebMethod - String startAgent( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // - @WebParam(name = "agentInstallPath") String agentInstallPath); + String startAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
/** * Stops the agent located in the given installation directory. @@ -99,11 +80,7 @@ public interface RemoteInstallManagerRemote { * * @return results of the stop command */ - @WebMethod - String stopAgent( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // - @WebParam(name = "agentInstallPath") String agentInstallPath); + String stopAgent(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
/** * Determines the running status of the agent located in the given installation directory. @@ -114,11 +91,7 @@ public interface RemoteInstallManagerRemote { * * @return results of the status command */ - @WebMethod - String agentStatus( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // - @WebParam(name = "agentInstallPath") String agentInstallPath); + String agentStatus(Subject subject, RemoteAccessInfo remoteAccessInfo, String agentInstallPath);
/** * Given a root parent path to check, this will scan all subdirectories (recursively) @@ -134,11 +107,7 @@ public interface RemoteInstallManagerRemote { * * @return the probable location of an installed agent; null if no agent install was found */ - @WebMethod - String findAgentInstallPath( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // - @WebParam(name = "parentPath") String parentPath); + String findAgentInstallPath(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath);
/** * Returns the given parent directory's child files/directories. @@ -149,9 +118,5 @@ public interface RemoteInstallManagerRemote { * * @return names of the parent's child files/directories */ - @WebMethod - String[] remotePathDiscover( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "remoteAccessInfo") RemoteAccessInfo remoteAccessInfo, // - @WebParam(name = "parentPath") String parentPath); + String[] remotePathDiscover(Subject subject, RemoteAccessInfo remoteAccessInfo, String parentPath); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceMapAdapter.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceMapAdapter.java deleted file mode 100644 index 004576e..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceMapAdapter.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.rhq.enterprise.server.jaxb; - -import java.util.HashMap; -import java.util.Map; - -import javax.jws.WebResult; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import org.rhq.enterprise.server.system.ServerVersion; - -/** See the javadoc for the XmlAdapter itself for a more complete explanation, but simply - * put the adapter maps types that JAXB has difficulty serializing(Ex. Map<Integer,String>) - * to java types that JAXB can actually serialize. From a JAXB perspective think of the - * problematic types as opaque to JAXB and the map to type in a marshal as the serializable - * type. - * - * @author Simeon Pinder - * @author Filip Drabek - * - */ -@XmlType(namespace = ServerVersion.namespace) -public class WebServiceMapAdapter extends XmlAdapter<Object[], Map<Integer, String>> { - - @WebResult(targetNamespace = ServerVersion.namespace) - public Object[] marshal(Map<Integer, String> opaque) throws Exception { - Object[] bag = null; - if (opaque != null) { - int i = 0; - bag = new Object[2 * opaque.size()]; - for (Map.Entry<Integer, String> mapEntry : opaque.entrySet()) { - bag[i++] = mapEntry.getKey(); - bag[i++] = mapEntry.getValue(); - } - } else { - bag = new Object[0]; - } - return bag; - } - - @WebResult(targetNamespace = ServerVersion.namespace) - public Map<Integer, String> unmarshal(Object[] marshallable) throws Exception { - Map<Integer, String> map = new HashMap<Integer, String>(); - if (marshallable != null) { - for (int i = 0; i < marshallable.length; i += 2) { - map.put((Integer) marshallable[i], (String) marshallable[i + 1]); - } - } - return map; - } -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceTypeAdapter.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceTypeAdapter.java deleted file mode 100644 index 45ba705..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/WebServiceTypeAdapter.java +++ /dev/null @@ -1,51 +0,0 @@ -package org.rhq.enterprise.server.jaxb; - -import java.util.HashMap; -import java.util.Map; - -import javax.jws.WebResult; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.enterprise.server.system.ServerVersion; - -/** See the javadoc for the XmlAdapter itself for a more complete explanation, but simply - * put the adapter maps types that JAXB has difficulty serializing(Ex. Map<int,Configuration>) - * to java types that JAXB can actually serialize. From a JAXB perspective think of the - * problematic types as opaque to JAXB and the map to type in a marshal as the serializable - * type. - * - * @author Simeon Pinder - * - */ -@XmlType(namespace = ServerVersion.namespace) -public class WebServiceTypeAdapter extends XmlAdapter<Object[], Map<Integer, Configuration>> { - - @WebResult(targetNamespace = ServerVersion.namespace) - public Object[] marshal(Map<Integer, Configuration> opaque) throws Exception { - Object[] bag = null; - if (opaque != null) { - int i = 0; - bag = new Object[2 * opaque.size()]; - for (Map.Entry<Integer, Configuration> mapEntry : opaque.entrySet()) { - bag[i++] = mapEntry.getKey(); - bag[i++] = mapEntry.getValue(); - } - } else { - bag = new Object[0]; - } - return bag; - } - - @WebResult(targetNamespace = ServerVersion.namespace) - public Map<Integer, Configuration> unmarshal(Object[] marshallable) throws Exception { - Map<Integer, Configuration> map = new HashMap<Integer, Configuration>(); - if (marshallable != null) { - for (int i = 0; i < marshallable.length; i += 2) { - map.put((Integer) marshallable[i], (Configuration) marshallable[i + 1]); - } - } - return map; - } -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ConfigurationAdapter.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ConfigurationAdapter.java deleted file mode 100644 index 4366cfb..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ConfigurationAdapter.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.enterprise.server.jaxb.adapter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.Property; -import org.rhq.core.domain.configuration.PropertyList; -import org.rhq.core.domain.configuration.PropertyMap; -import org.rhq.core.domain.configuration.PropertySimple; - -/**This adapter is a JAXB wrapper for the Configuration class. JAXB works with JavaBeans and - * Configuration does not adhere to those conventions strictly and creates wrapper types - * on the fly which JAXB has difficulty with. This means that on the Webservice side - * instead of Configuration JAXB types there necessarily has to be WsConfiguration alternative types. - * - * @author Simeon Pinder - * - */ -public class ConfigurationAdapter extends XmlAdapter<WsConfiguration, Configuration> { - - /**Converts a Configuration type back to marshallable JAXB type. - * - */ - public WsConfiguration marshal(Configuration opaque) throws Exception { - WsConfiguration config = null; - if (opaque != null) { - config = new WsConfiguration(opaque); - } else { - throw new IllegalArgumentException("The configuration passed in was null."); - } - return config; - } - - /** - * Converts the WsConfiguration type back into familiar Configuration type on server side. - * - */ - public Configuration unmarshal(WsConfiguration marshallable) throws Exception { - Configuration config = null; - if (marshallable != null) { - - //create new Config instance to be returned - config = new Configuration(); - - ArrayList<Property> allProperties = new ArrayList<Property>(); - - //go through all property(Simple,List,Map) and add to properties if not already there - for (PropertySimple type : marshallable.propertySimpleContainer) { - //set reference to configuration. Causes cycle but needed back on server side? - type.setConfiguration(config); - allProperties.add(type); - } - for (PropertyMap type : marshallable.propertyMapContainer) { - allProperties.add(type); - type.setConfiguration(config); - } - for (PropertyList type : marshallable.propertyListContainer) { - allProperties.add(type); - type.setConfiguration(config); - } - config.setProperties(allProperties); - } else { - throw new IllegalArgumentException("The WsConfiguration type passed in was null."); - } - return config; - } -} - -/**Purpose of this class is to create a JAXB marshallable class for Configuration - * that does not have the same problems being serialized as Configuration. - * - * @author Simeon Pinder - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement -class WsConfiguration { - - //FIELDS : BEGIN - @XmlTransient - private Configuration CONFIG = null; - - private int id = -1; - private String notes = ""; - private long version; - private long ctime; - private long mtime; - - public List<Property> properties = new ArrayList<Property>(); - - //now individual property maps - public List<PropertyList> propertyListContainer = new ArrayList<PropertyList>(); - public List<PropertySimple> propertySimpleContainer = new ArrayList<PropertySimple>(); - public List<PropertyMap> propertyMapContainer = new ArrayList<PropertyMap>(); - public Collection<String> names = new ArrayList<String>(); - - //FIELDS: END - - //default no args constructor for JAXB and bean requirement - public WsConfiguration() { - //set default for new Configuration - this.ctime = System.currentTimeMillis(); - this.mtime = System.currentTimeMillis(); - this.notes = ""; - } - - public WsConfiguration(Configuration opaque) { - //copy over all core information - this.CONFIG = opaque; - this.id = opaque.getId(); - this.notes = opaque.getNotes(); - this.version = opaque.getVersion(); - this.ctime = opaque.getCreatedTime(); - this.mtime = opaque.getModifiedTime(); - - this.properties = new ArrayList<Property>(); - this.propertyListContainer = new ArrayList<PropertyList>(); - this.propertyMapContainer = new ArrayList<PropertyMap>(); - this.propertySimpleContainer = new ArrayList<PropertySimple>(); - - if ((opaque.getAllProperties() != null) && (opaque.getAllProperties().size() > 0)) { - for (String key : opaque.getAllProperties().keySet()) { - Property property = opaque.getAllProperties().get(key); - this.properties.add(property); - if (property instanceof PropertySimple) { - this.propertySimpleContainer.add((PropertySimple) property); - } - if (property instanceof PropertyList) { - this.propertyListContainer.add((PropertyList) property); - } - if (property instanceof PropertyMap) { - this.propertyMapContainer.add((PropertyMap) property); - } - } - } - - //Now copy values over. - populatePropertyMaps(); - } - - private void populatePropertyMaps() { - if ((this.properties != null) && (this.properties.size() > 0)) { - for (Property type : this.properties) { - //store away key in names - this.names.add(type.getName()); - //now check each property - Property property = type; - if (property instanceof PropertySimple) { - propertySimpleContainer.add((PropertySimple) type); - } else if (property instanceof PropertyList) { - propertyListContainer.add((PropertyList) type); - } else if (property instanceof PropertyMap) { - propertyMapContainer.add((PropertyMap) type); - } - } - } - } - //METHODS :END -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/MeasurementDataNumericHighLowCompositeAdapter.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/MeasurementDataNumericHighLowCompositeAdapter.java deleted file mode 100644 index 9640e1a..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/MeasurementDataNumericHighLowCompositeAdapter.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.rhq.enterprise.server.jaxb.adapter; - -import java.util.ArrayList; -import java.util.List; - -import javax.jws.WebResult; -import javax.xml.bind.annotation.XmlType; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite; -import org.rhq.enterprise.server.system.ServerVersion; - -/** See the javadoc for the XmlAdapter itself for a more complete explanation, but simply - * put the adapter maps types that JAXB has difficulty serializing(Ex. Map<int,Configuration>) - * to java types that JAXB can actually serialize. From a JAXB perspective think of the - * problematic types as opaque to JAXB and the map to type in a marshal as the serializable - * type. - * - * @author Simeon Pinder - * - */ -@XmlType(namespace = ServerVersion.namespace) -public class MeasurementDataNumericHighLowCompositeAdapter - extends - XmlAdapter<ArrayList<ArrayList<MeasurementDataNumericHighLowComposite>>, List<List<MeasurementDataNumericHighLowComposite>>> { - - public ArrayList<ArrayList<MeasurementDataNumericHighLowComposite>> marshal( - List<List<MeasurementDataNumericHighLowComposite>> opaque) throws Exception { - ArrayList<ArrayList<MeasurementDataNumericHighLowComposite>> converted = new ArrayList<ArrayList<MeasurementDataNumericHighLowComposite>>(); - if (opaque != null) { - for (List<MeasurementDataNumericHighLowComposite> li : opaque) { - converted.add((ArrayList<MeasurementDataNumericHighLowComposite>) li); - } - } - return converted; - } - - @WebResult(targetNamespace = ServerVersion.namespace) - public List<List<MeasurementDataNumericHighLowComposite>> unmarshal( - ArrayList<ArrayList<MeasurementDataNumericHighLowComposite>> marshallable) throws Exception { - return new ArrayList<List<MeasurementDataNumericHighLowComposite>>(marshallable); - } - -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceGroupAdapter.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceGroupAdapter.java deleted file mode 100644 index a6fedea..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceGroupAdapter.java +++ /dev/null @@ -1,144 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.rhq.enterprise.server.jaxb.adapter; - -import java.util.LinkedList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.group.ResourceGroup; - -/**This adapter is a JAXB wrapper for the ResourceGroup class. - * - * Problematic fields on resource: ResourceGroup.groupCategory - * - * @author Simeon Pinder - * - */ -public class ResourceGroupAdapter extends XmlAdapter<WsResourceGroupWrapper, ResourceGroup> { - - /**Converts a ResourceGroup type back to marshallable JAXB type. - * - */ - public WsResourceGroupWrapper marshal(ResourceGroup opaque) throws Exception { - WsResourceGroupWrapper resources = null; - //no implementation now. Needed if server needs to re-populate some reference - //before returning it to the client. - if (opaque != null) { - resources = new WsResourceGroupWrapper(opaque); - } - return resources; - } - - /** - * Converts the WsResourceGroupWrapper type back into familiar ResourceGroup type on server side. - */ - public ResourceGroup unmarshal(WsResourceGroupWrapper marshallable) throws Exception { - ResourceGroup group = null; - if (marshallable != null) { - //create new ResourceGroup instance to be returned - group = new ResourceGroup(""); - //Copy all relevant fields over - copy(marshallable, group); - } else { - throw new IllegalArgumentException("The WsConfiguration type passed in was null."); - } - return group; - } - - /**Copies all the values from the client side - * component to create equivalent server side element. - * - * groupCategory is null in client type - * - * @param destination - * @param source - */ - private void copy(WsResourceGroupWrapper source, ResourceGroup destination) { - // destination.setAgent(source.getAgent()); - destination.setAlertDefinitions(source.getAlertDefinitions()); - destination.setResourceType(source.getResourceType()); - destination.setClusterBackingGroups(source.getClusterBackingGroups()); - destination.setClusterResourceGroup(source.getClusterResourceGroup()); - destination.setConfigurationUpdates(source.getConfigurationUpdates()); - destination.setCtime(source.getCtime()); - destination.setDescription(source.getDescription()); - destination.setExplicitResources(source.getExplicitResources()); - destination.setGroupByClause(source.getGroupByClause()); - destination.setGroupDefinition(source.getGroupDefinition()); - destination.setId(source.getId()); - destination.setImplicitResources(source.getImplicitResources()); - destination.setModifiedBy(source.getModifiedBy()); - destination.setMtime(source.getMtime()); - destination.setName(source.getName()); - destination.setOperationHistories(source.getOperationHistories()); - destination.setRecursive(source.isRecursive()); - destination.setVisible(source.isVisible()); - } -} - -/**Purpose of this class is to create a JAXB marshallable class for Configuration - * that does not have the same problems being serialized as Configuration. - * - * @author Simeon Pinder - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement -class WsResourceGroupWrapper extends ResourceGroup { - - //FIELDS : BEGIN - private List<Resource> lineageList = new LinkedList<Resource>(); - - //FIELDS: END - - //default no args constructor for JAXB and bean requirement - public WsResourceGroupWrapper() { - // super(); - } - - public WsResourceGroupWrapper(ResourceGroup rg) { - //TODO:add implementation? - } - - // public WsResourceListWrapper(List<Resource> opaque) { - // //store the resourceList as embedded property - // if (opaque != null) { - // for (Resource r : opaque) { - // // lineageList.add(r); - // //make copy and save that copy - // Resource copy = new Resource(); - // copyResource(copy, r); - // lineageList.add(copy); - // } - // } - // } - - // //METHODS :END -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceListAdapter.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceListAdapter.java deleted file mode 100644 index 964d84c..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/ResourceListAdapter.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.enterprise.server.jaxb.adapter; - -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.adapters.XmlAdapter; - -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceError; - -/**This adapter is a JAXB wrapper for the Resource class. - * - * Problematic field on resource: Resource.parentResource - * Resource.List<ResourceErrors> - * - * @author Simeon Pinder - * - */ -public class ResourceListAdapter extends XmlAdapter<WsResourceListWrapper, List<Resource>> { - - /**Converts a Resource type back to marshallable JAXB type. - * - */ - public WsResourceListWrapper marshal(List<Resource> opaque) throws Exception { - - WsResourceListWrapper resources = null; - - if (opaque != null) { - resources = new WsResourceListWrapper(opaque); - } else { - throw new IllegalArgumentException("The resource passed in was null."); - } - return resources; - } - - /** - * Converts the WsResource type back into familiar Resource type on server side. - * TODO: not sure we need this at all as there would have to be a reason to turn - * WsResource back into a List<Resource>. Problem is one way for now. - */ - public List<Resource> unmarshal(WsResourceListWrapper marshallable) throws Exception { - - List<Resource> resource = null; - if (marshallable != null) { - - //create new Config instance to be returned - resource = new ArrayList<Resource>(); - - } else { - throw new IllegalArgumentException("The WsResource type passed in was null."); - } - return resource; - } -} - - -/**Purpose of this class is to create a JAXB marshallable class for Configuration -* that does not have the same problems being serialized as Configuration. -* -* @author Simeon Pinder -* -*/ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement -class WsResourceListWrapper extends Resource { - - //FIELDS : BEGIN - //Following fields are not populated by default because the fields in core/domain - // object had to be marked as XmlTransient to eliminate cycles. These fields are - // added back here on the return type so that the client still has the appropriate - // id(s) to look up if they do need the data that was contained in the XMLTransient - // fields. - private List<Resource> lineageList = new LinkedList<Resource>(); - private int parentResourceId = -1; - private List<Integer> resourceErrorIds = new ArrayList<Integer>(); - - //FIELDS: END - - //default no args constructor for JAXB and bean requirement - public WsResourceListWrapper() { - // public WsResource() { - super(); - } - - public WsResourceListWrapper(List<Resource> opaque) { - // public WsResource(Resource opaque) { - //store the resourceList as embedded property - if (opaque != null) { - for (Resource r : opaque) { - //make copy and save that copy - WsResourceListWrapper copy = new WsResourceListWrapper(); - copyResource(copy, r); - lineageList.add(copy); - } - } - } - - /**Copies all the values from the original Server side - * component to a different reference. JAXB will use - * reflection to null out those references that are - * annotated as XmlTransient. In this case the parentResources. - * - * parentResource is used in lineage type returned - * - * @param destination - * @param source - */ - private void copyResource(WsResourceListWrapper destination, Resource source) { - - if ((destination == null) || (source == null)) { - throw new IllegalArgumentException("Neither source or destination references can be null."); - } - destination.setAgent(source.getAgent()); - destination.setAlertDefinitions(source.getAlertDefinitions()); - destination.setDescription(source.getDescription()); - destination.setChildResources(source.getChildResources()); - destination.setConnected(source.isConnected()); - destination.setContentServiceRequests(source.getContentServiceRequests()); - destination.setCreateChildResourceRequests(source.getCreateChildResourceRequests()); - destination.setCurrentAvailability(source.getCurrentAvailability()); - destination.setDeleteResourceRequests(source.getDeleteResourceRequests()); - destination.setExplicitGroups(source.getExplicitGroups()); - destination.setImplicitGroups(source.getImplicitGroups()); - destination.setInstalledPackageHistory(source.getInstalledPackageHistory()); - destination.setInstalledPackages(source.getInstalledPackages()); - destination.setInventoryStatus(source.getInventoryStatus()); - destination.setItime(source.getItime()); - destination.setLocation(source.getLocation()); - destination.setModifiedBy(source.getModifiedBy()); - destination.setMtime(source.getMtime()); - destination.setOperationHistories(source.getOperationHistories()); - destination.setPluginConfiguration(source.getPluginConfiguration()); - destination.setPluginConfigurationUpdates(source.getPluginConfigurationUpdates()); - destination.setProductVersion(source.getProductVersion()); - destination.setResourceConfiguration(source.getResourceConfiguration()); - destination.setResourceConfigurationUpdates(source.getResourceConfigurationUpdates()); - destination.setSchedules(source.getSchedules()); - destination.setUuid(source.getUuid()); - //handle the problematic references that would cause cycles if used by storing only ids. - if (source.getParentResource() != null) { - destination.parentResourceId = source.getParentResource().getId(); - } - if ((source.getResourceErrors() != null) && (!source.getResourceErrors().isEmpty())) { - for (ResourceError error : source.getResourceErrors()) { - destination.resourceErrorIds.add(error.getId()); - } - } - destination.setId(source.getId()); - destination.setName(source.getName()); - destination.setResourceKey(source.getResourceKey()); - destination.setResourceType(source.getResourceType()); - destination.setVersion(source.getVersion()); - - } - // //METHODS :END -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/WsResource.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/WsResource.java deleted file mode 100644 index 3c74f06..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/jaxb/adapter/WsResource.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -package org.rhq.enterprise.server.jaxb.adapter; - -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; - -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceError; - -/**Purpose of this class is to create a JAXB marshallable class for Configuration - * that does not have the same problems being serialized as Configuration. - * - * @author Simeon Pinder - * - */ -@XmlAccessorType(XmlAccessType.FIELD) -@XmlRootElement -class WsResource extends Resource { - // class WsResourceListWrapper extends Resource { - - //FIELDS : BEGIN - //Following fields are not populated by default because the fields in core/domain - // object had to be marked as XmlTransient to eliminate cycles. These fields are - // added back here on the return type so that the client still has the appropriate - // id(s) to look up if they do need the data that was contained in the XMLTransient - // fields. - // private List<Resource> lineageList = new LinkedList<Resource>(); - private int parentResourceId = -1; - private List<Integer> resourceErrorIds = new ArrayList<Integer>(); - - //FIELDS: END - - //default no args constructor for JAXB and bean requirement - // public WsResourceListWrapper() { - public WsResource() { - super(); - } - - // public WsResourceListWrapper(List<Resource> opaque) { - public WsResource(Resource opaque) { - //store the resourceList as embedded property - if (opaque != null) { - // for (Resource r : opaque) { - // // lineageList.add(r); - // //make copy and save that copy - // Resource copy = new Resource(); - // copyResource(copy, r); - // lineageList.add(copy); - // } - WsResource copy = new WsResource(); - copyResource(copy, opaque); - } - } - - /**Copies all the values from the original Server side - * component to a different reference. JAXB will use - * reflection to null out those references that are - * annotated as XmlTransient. In this case the parentResources. - * - * parentResource is used in lineage type returned - * - * @param destination - * @param source - */ - private void copyResource(WsResource destination, Resource source) { - if ((destination == null) || (source == null)) { - throw new IllegalArgumentException("Neither source or destination references can be null."); - } - destination.setAgent(source.getAgent()); - destination.setAlertDefinitions(source.getAlertDefinitions()); - destination.setDescription(source.getDescription()); - destination.setChildResources(source.getChildResources()); - destination.setConnected(source.isConnected()); - destination.setContentServiceRequests(source.getContentServiceRequests()); - destination.setCreateChildResourceRequests(source.getCreateChildResourceRequests()); - destination.setCurrentAvailability(source.getCurrentAvailability()); - destination.setDeleteResourceRequests(source.getDeleteResourceRequests()); - destination.setExplicitGroups(source.getExplicitGroups()); - destination.setImplicitGroups(source.getImplicitGroups()); - destination.setInstalledPackageHistory(source.getInstalledPackageHistory()); - destination.setInstalledPackages(source.getInstalledPackages()); - destination.setInventoryStatus(source.getInventoryStatus()); - destination.setItime(source.getItime()); - destination.setLocation(source.getLocation()); - destination.setModifiedBy(source.getModifiedBy()); - destination.setMtime(source.getMtime()); - destination.setOperationHistories(source.getOperationHistories()); - destination.setPluginConfiguration(source.getPluginConfiguration()); - destination.setPluginConfigurationUpdates(source.getPluginConfigurationUpdates()); - destination.setProductVersion(source.getProductVersion()); - destination.setResourceConfiguration(source.getResourceConfiguration()); - destination.setResourceConfigurationUpdates(source.getResourceConfigurationUpdates()); - destination.setSchedules(source.getSchedules()); - destination.setUuid(source.getUuid()); - //handle the problematic references that would cause cycles if used by storing only ids. - if (source.getParentResource() != null) { - destination.parentResourceId = source.getParentResource().getId(); - } - if ((source.getResourceErrors() != null) && (!source.getResourceErrors().isEmpty())) { - for (ResourceError error : source.getResourceErrors()) { - destination.resourceErrorIds.add(error.getId()); - } - } - destination.setId(source.getId()); - destination.setName(source.getName()); - destination.setResourceKey(source.getResourceKey()); - destination.setResourceType(source.getResourceType()); - destination.setVersion(source.getVersion()); - - } - // //METHODS :END -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/AvailabilityManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/AvailabilityManagerRemote.java index 3091c5c..a1a0442 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/AvailabilityManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/AvailabilityManagerRemote.java @@ -20,24 +20,18 @@ package org.rhq.enterprise.server.measurement;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.AvailabilityCriteria; import org.rhq.core.domain.measurement.Availability; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
/** + * @Author Jay Shaughnessy * @author Noam Malki */
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface AvailabilityManagerRemote {
@@ -50,11 +44,7 @@ public interface AvailabilityManagerRemote { * @Deprecated use {@link #findAvailabilityByCriteria(Subject, AvailabilityCriteria)} */ @Deprecated - @WebMethod - public PageList<Availability> findAvailabilityForResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "pageControl") PageControl pc); + public PageList<Availability> findAvailabilityForResource(Subject subject, int resourceId, PageControl pc);
/** * Gets the last known Availability for the given resource - which includes whether it is currently up (i.e. @@ -67,12 +57,7 @@ public interface AvailabilityManagerRemote { * @throws FetchException TODO * @throws FetchException */ - @WebMethod - public Availability getCurrentAvailabilityForResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + public Availability getCurrentAvailabilityForResource(Subject subject, int resourceId);
- PageList<Availability> findAvailabilityByCriteria( // - Subject subject, // - AvailabilityCriteria criteria); + PageList<Availability> findAvailabilityByCriteria(Subject subject, AvailabilityCriteria criteria); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerRemote.java index c044fb5..3683529 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/CallTimeDataManagerRemote.java @@ -19,38 +19,27 @@ package org.rhq.enterprise.server.measurement;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface CallTimeDataManagerRemote { - @WebMethod - PageList<CallTimeDataComposite> findCallTimeDataForResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "scheduleId") int scheduleId, // - @WebParam(name = "beginTime") long beginTime, // - @WebParam(name = "endTime") long endTime, // - @WebParam(name = "pageControl") PageControl pc); + + PageList<CallTimeDataComposite> findCallTimeDataForResource(Subject subject, int scheduleId, long beginTime, + long endTime, PageControl pc);
/* this method was never implemented, and so won't be in the remote api yet - @WebMethod - PageList<CallTimeDataComposite> getCallTimeDataForCompatibleGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "measurementDefinitionId") int measurementDefinitionId, // - @WebParam(name = "beginTime") long beginTime, // - @WebParam(name = "endTime") long endTime, // - @WebParam(name = "pageControl") PageControl pageControl) // + + PageList<CallTimeDataComposite> getCallTimeDataForCompatibleGroup( + Subject subject, + int groupId, + int measurementDefinitionId, + long beginTime, + long endTime, + PageControl pageControl) throws FetchException; */ } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerRemote.java index b1eba73..ade80ea 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementBaselineManagerRemote.java @@ -21,22 +21,12 @@ package org.rhq.enterprise.server.measurement; import java.util.List;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.measurement.MeasurementBaseline; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface MeasurementBaselineManagerRemote {
- @WebMethod - List<MeasurementBaseline> findBaselinesForResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + List<MeasurementBaseline> findBaselinesForResource(Subject subject, int resourceId); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java index 65ec2a7..f971099 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerBean.java @@ -44,7 +44,6 @@ import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; import javax.sql.DataSource; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -90,7 +89,6 @@ import org.rhq.enterprise.server.alert.engine.AlertConditionCacheStats; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.core.AgentManagerLocal; -import org.rhq.enterprise.server.jaxb.adapter.MeasurementDataNumericHighLowCompositeAdapter; import org.rhq.enterprise.server.measurement.instrumentation.MeasurementMonitor; import org.rhq.enterprise.server.measurement.util.MeasurementDataManagerUtility; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; @@ -723,8 +721,7 @@ public class MeasurementDataManagerBean implements MeasurementDataManagerLocal, return result; }
- public @XmlJavaTypeAdapter(MeasurementDataNumericHighLowCompositeAdapter.class) - List<List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(Subject subject, int groupId, + public List<List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(Subject subject, int groupId, int definitionId, long beginTime, long endTime, int numPoints) {
List<List<MeasurementDataNumericHighLowComposite>> ret = findDataForContext(subject, diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java index b452adf..cfcd484 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDataManagerRemote.java @@ -22,11 +22,6 @@ import java.util.List; import java.util.Set;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria; @@ -35,67 +30,25 @@ import org.rhq.core.domain.measurement.MeasurementData; import org.rhq.core.domain.measurement.MeasurementDataTrait; import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.jaxb.adapter.MeasurementDataNumericHighLowCompositeAdapter; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface MeasurementDataManagerRemote { - @WebMethod - MeasurementAggregate getAggregate(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "scheduleId") int scheduleId, // - @WebParam(name = "startTime") long startTime, // - @WebParam(name = "endTime") long endTime);
- @WebMethod - List<MeasurementDataTrait> findTraits(// - @WebParam(name = "subject") Subject subject,// - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "definitionId") int definitionId); + MeasurementAggregate getAggregate(Subject subject, int scheduleId, long startTime, long endTime);
- @WebMethod - List<MeasurementDataTrait> findCurrentTraitsForResource(// - @WebParam(name = "subject") Subject subject,// - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "displayType") DisplayType displayType); + List<MeasurementDataTrait> findTraits(Subject subject, int resourceId, int definitionId);
- @WebMethod - PageList<MeasurementDataTrait> findTraitsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") MeasurementDataTraitCriteria criteria); - - @WebMethod - Set<MeasurementData> findLiveData(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "definitionIds") int[] definitionIds); - - @WebMethod - Set<MeasurementData> findLiveDataForGroup(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId,// - @WebParam(name = "resourceId") int[] resourceIds, // - @WebParam(name = "definitionIds") int[] definitionIds); + List<MeasurementDataTrait> findCurrentTraitsForResource(Subject subject, int resourceId, DisplayType displayType);
- @WebMethod - @XmlJavaTypeAdapter(MeasurementDataNumericHighLowCompositeAdapter.class) - List<List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId,// - @WebParam(name = "definitionId") int definitionId, // - @WebParam(name = "beginTime") long beginTime, // - @WebParam(name = "endTime") long endTime, // - @WebParam(name = "numPoints") int numPoints); + PageList<MeasurementDataTrait> findTraitsByCriteria(Subject subject, MeasurementDataTraitCriteria criteria);
- @WebMethod - @XmlJavaTypeAdapter(MeasurementDataNumericHighLowCompositeAdapter.class) - List<List<MeasurementDataNumericHighLowComposite>> findDataForResource(// - @WebParam(name = "subject") Subject subject,// - @WebParam(name = "resourceId") int resourceId,// - @WebParam(name = "definitionIds") int[] definitionIds,// - @WebParam(name = "beginTime") long beginTime, // - @WebParam(name = "endTime") long endTime, // - @WebParam(name = "numPoints") int numPoints); + Set<MeasurementData> findLiveData(Subject subject, int resourceId, int[] definitionIds); + + Set<MeasurementData> findLiveDataForGroup(Subject subject, int groupId, int[] resourceIds, int[] definitionIds); + + List<List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(Subject subject, int groupId, + int definitionId, long beginTime, long endTime, int numPoints); + + List<List<MeasurementDataNumericHighLowComposite>> findDataForResource(Subject subject, int resourceId, + int[] definitionIds, long beginTime, long endTime, int numPoints); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerRemote.java index 4ba64b1..c35ed2d 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementDefinitionManagerRemote.java @@ -19,29 +19,17 @@ package org.rhq.enterprise.server.measurement;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria; import org.rhq.core.domain.measurement.MeasurementDefinition; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface MeasurementDefinitionManagerRemote {
- @WebMethod - MeasurementDefinition getMeasurementDefinition(// - @WebParam(name = "subject") Subject subject,// - @WebParam(name = "definitionId") int definitionId); + MeasurementDefinition getMeasurementDefinition(Subject subject, int definitionId);
- @WebMethod PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") MeasurementDefinitionCriteria criteria); + Subject subject, MeasurementDefinitionCriteria criteria); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerRemote.java index 78bdc22..9533fcd 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementProblemManagerRemote.java @@ -19,26 +19,15 @@ package org.rhq.enterprise.server.measurement;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.resource.composite.ProblemResourceComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface MeasurementProblemManagerRemote {
- @WebMethod - PageList<ProblemResourceComposite> findProblemResources(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "oldestDate") long oldestDate, // - @WebParam(name = "pageControl") PageControl pc); + PageList<ProblemResourceComposite> findProblemResources(Subject subject, long oldestDate, PageControl pc);
} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerRemote.java index d0aa9c7..06041a4 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/measurement/MeasurementScheduleManagerRemote.java @@ -19,23 +19,16 @@ package org.rhq.enterprise.server.measurement;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; import org.rhq.core.domain.measurement.MeasurementSchedule; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
/** * @author Jay Shaughnessy * */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface MeasurementScheduleManagerRemote {
@@ -47,20 +40,12 @@ public interface MeasurementScheduleManagerRemote { * @param measurementDefinitionIds * @param resourceId */ - @WebMethod - void disableSchedulesForResource(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds); + void disableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds);
/** * Disable the measurement schedules for the passed definitions for the resources of the passed compatible group. */ - @WebMethod - void disableSchedulesForCompatibleGroup(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds); + void disableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds);
/** * Requires MANAGE_SETTINGS global permission. @@ -69,18 +54,13 @@ public interface MeasurementScheduleManagerRemote { * @param measurementDefinitionIds * @param updateExistingSchedules */ - void disableSchedulesForResourceType(// - Subject subject, // - int[] measurementDefinitionIds, // + void disableSchedulesForResourceType(Subject subject, int[] measurementDefinitionIds, boolean updateExistingSchedules);
/** * @deprecated use {@link #disableSchedulesForResourceType(Subject, int[], boolean) */ - @WebMethod - void disableMeasurementTemplates(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds); + void disableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds);
/** * Enable the schedules for the provided definitions and resource @@ -88,20 +68,12 @@ public interface MeasurementScheduleManagerRemote { * @param measurementDefinitionIds * @param resourceId */ - @WebMethod - void enableSchedulesForResource(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds); + void enableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds);
/** * Enable the measurement schedules for the passed definitions for the resources of the passed compatible group. */ - @WebMethod - void enableSchedulesForCompatibleGroup(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds); + void enableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds);
/** * Requires MANAGE_SETTINGS global permission. @@ -110,37 +82,20 @@ public interface MeasurementScheduleManagerRemote { * @param measurementDefinitionIds * @param updateExistingSchedules */ - void enableSchedulesForResourceType(// - Subject subject, // - int[] measurementDefinitionIds, // - boolean updateExistingSchedules); + void enableSchedulesForResourceType(Subject subject, int[] measurementDefinitionIds, boolean updateExistingSchedules);
/** * @deprecated use {@link #enableSchedulesForResourceType(Subject, int[], boolean) */ - @WebMethod - void enableMeasurementTemplates(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds); - - @WebMethod - void updateSchedule( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "measurementSchedule") MeasurementSchedule measurementSchedule); - - @WebMethod - void updateSchedulesForResource(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds, // - @WebParam(name = "collectionInterval") long collectionInterval); - - @WebMethod - void updateSchedulesForCompatibleGroup(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int groupId, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds, // - @WebParam(name = "collectionInterval") long collectionInterval); + void enableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds); + + void updateSchedule(Subject subject, MeasurementSchedule measurementSchedule); + + void updateSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds, + long collectionInterval); + + void updateSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds, + long collectionInterval);
/** * Requires MANAGE_SETTINGS global permission. @@ -150,24 +105,13 @@ public interface MeasurementScheduleManagerRemote { * @param collectionInterval * @param updateExistingSchedules */ - void updateSchedulesForResourceType(// - Subject subject, // - int[] measurementDefinitionIds, // - long collectionInterval, // + void updateSchedulesForResourceType(Subject subject, int[] measurementDefinitionIds, long collectionInterval, boolean updateExistingSchedules);
/** * @deprecated use {@link #updateSchedulesForResourceType(Subject, int[], boolean) */ - @WebMethod - void updateMeasurementTemplates(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "measurementDefinitionIds") int[] measurementDefinitionIds, // - @WebParam(name = "collectionInterval") long collectionInterval); - - @WebMethod - PageList<MeasurementSchedule> findSchedulesByCriteria(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") MeasurementScheduleCriteria criteria); + void updateMeasurementTemplates(Subject subject, int[] measurementDefinitionIds, long collectionInterval);
+ PageList<MeasurementSchedule> findSchedulesByCriteria(Subject subject, MeasurementScheduleCriteria criteria); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java index d95bd9f..41ae67e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerBean.java @@ -31,7 +31,6 @@ import javax.persistence.EntityManager; import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -92,7 +91,6 @@ import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal; import org.rhq.enterprise.server.core.AgentManagerLocal; import org.rhq.enterprise.server.exception.ScheduleException; import org.rhq.enterprise.server.exception.UnscheduleException; -import org.rhq.enterprise.server.jaxb.adapter.ConfigurationAdapter; import org.rhq.enterprise.server.resource.ResourceManagerLocal; import org.rhq.enterprise.server.resource.ResourceNotFoundException; import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; @@ -141,9 +139,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan }
public ResourceOperationSchedule scheduleResourceOperation(Subject subject, int resourceId, String operationName, - long delay, long repeatInterval, int repeatCount, int timeout,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration parameters, String notes) throws ScheduleException { + long delay, long repeatInterval, int repeatCount, int timeout, Configuration parameters, String notes) + throws ScheduleException { try {
SimpleTrigger trigger = new SimpleTrigger(); @@ -174,8 +171,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan Trigger trigger = convertToTrigger(jobTrigger); try { ResourceOperationSchedule resourceOperationSchedule = scheduleResourceOperation(subject, schedule - .getResource().getId(), schedule.getOperationName(), schedule.getParameters(), trigger, schedule - .getDescription()); + .getResource().getId(), schedule.getOperationName(), schedule.getParameters(), trigger, + schedule.getDescription()); return resourceOperationSchedule.getId(); } catch (SchedulerException e) { throw new ScheduleException(e); @@ -198,8 +195,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan } } GroupOperationSchedule groupOperationSchedule = scheduleGroupOperation(subject, - schedule.getGroup().getId(), executionOrderResourceIds, schedule.getHaltOnFailure(), schedule - .getOperationName(), schedule.getParameters(), trigger, schedule.getDescription()); + schedule.getGroup().getId(), executionOrderResourceIds, schedule.getHaltOnFailure(), + schedule.getOperationName(), schedule.getParameters(), trigger, schedule.getDescription()); return groupOperationSchedule.getId(); } catch (SchedulerException e) { throw new ScheduleException(e); @@ -249,8 +246,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan
// We need to create our own schedule tracking entity. ResourceOperationScheduleEntity schedule; - schedule = new ResourceOperationScheduleEntity(jobDetail.getName(), jobDetail.getGroup(), trigger - .getStartTime(), resource); + schedule = new ResourceOperationScheduleEntity(jobDetail.getName(), jobDetail.getGroup(), + trigger.getStartTime(), resource); entityManager.persist(schedule);
// Add the id of the entity bean, so we can easily map the Quartz job to the associated entity bean. @@ -1054,9 +1051,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan // We still flag the operation as canceled to indicate that the agent did attempt to cancel it; // hopefully, the plugin did the right thing. canceled = true; - LOG - .debug("Agent attempted to cancel the operation - it interrupted the operation while it was running. " - + "agent=[" + agent + "], op=[" + doomedHistory + "]"); + LOG.debug("Agent attempted to cancel the operation - it interrupted the operation while it was running. " + + "agent=[" + agent + "], op=[" + doomedHistory + "]"); break; }
@@ -1187,7 +1183,7 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan } }
- @SuppressWarnings( { "unchecked" }) + @SuppressWarnings({ "unchecked" }) public List<OperationDefinition> findSupportedGroupOperations(Subject subject, int compatibleGroupId, boolean eagerLoaded) { if (!authorizationManager.canViewGroup(subject, compatibleGroupId)) { @@ -1588,8 +1584,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan for (ResourceOperationScheduleComposite composite : results) { try { ResourceOperationSchedule sched = getResourceOperationSchedule(subject, composite.getJobId().toString()); - OperationDefinition def = getSupportedResourceOperation(overlord, composite.getResourceId(), sched - .getOperationName(), false); + OperationDefinition def = getSupportedResourceOperation(overlord, composite.getResourceId(), + sched.getOperationName(), false); composite.setOperationName((def.getDisplayName() != null) ? def.getDisplayName() : sched .getOperationName()); } catch (SchedulerException se) { @@ -1641,8 +1637,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan for (GroupOperationScheduleComposite composite : results) { try { GroupOperationSchedule sched = getGroupOperationSchedule(subject, composite.getJobId().toString()); - OperationDefinition def = getSupportedGroupOperation(overlord, composite.getGroupId(), sched - .getOperationName(), false); + OperationDefinition def = getSupportedGroupOperation(overlord, composite.getGroupId(), + sched.getOperationName(), false); composite.setOperationName((def.getDisplayName() != null) ? def.getDisplayName() : sched .getOperationName()); } catch (SchedulerException se) { @@ -1973,8 +1969,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan ResourceOperationHistoryCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); if (authorizationManager.isInventoryManager(subject) == false) { - generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, subject - .getId()); + generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.RESOURCE, + subject.getId()); }
CriteriaQueryRunner<ResourceOperationHistory> queryRunner = new CriteriaQueryRunner(criteria, generator, @@ -1987,8 +1983,8 @@ public class OperationManagerBean implements OperationManagerLocal, OperationMan GroupOperationHistoryCriteria criteria) { CriteriaQueryGenerator generator = new CriteriaQueryGenerator(subject, criteria); if (authorizationManager.isInventoryManager(subject) == false) { - generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.GROUP, subject - .getId()); + generator.setAuthorizationResourceFragment(CriteriaQueryGenerator.AuthorizationTokenType.GROUP, + subject.getId()); }
CriteriaQueryRunner<GroupOperationHistory> queryRunner = new CriteriaQueryRunner(criteria, generator, diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java index 26e5f4f..c6f8da1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java @@ -21,11 +21,6 @@ package org.rhq.enterprise.server.operation; import java.util.List;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.Configuration; @@ -40,11 +35,7 @@ import org.rhq.core.domain.operation.bean.ResourceOperationSchedule; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.exception.ScheduleException; import org.rhq.enterprise.server.exception.UnscheduleException; -import org.rhq.enterprise.server.jaxb.adapter.ConfigurationAdapter; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface OperationManagerRemote {
@@ -73,11 +64,7 @@ public interface OperationManagerRemote { * this method will not update the history status unless it could successfully tell the agent(s) to * cancel the operation. */ - @WebMethod - void cancelOperationHistory( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "operationHistoryId") int operationHistoryId, // - @WebParam(name = "ignoreAgentErrors") boolean ignoreAgentErrors); + void cancelOperationHistory(Subject subject, int operationHistoryId, boolean ignoreAgentErrors);
/** * Purges the history from the database. Doing this loses all audit trails of the invoked operation. This can handle @@ -99,11 +86,7 @@ public interface OperationManagerRemote { * <code>false</code>, but a user might want to force it to be purged, in which case the UI will want * to pass in <code>true</code> */ - @WebMethod - void deleteOperationHistory( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "operationHistoryId") int operationHistoryId, // - @WebParam(name = "purgeInProgress") boolean purgeInProgress); + void deleteOperationHistory(Subject subject, int operationHistoryId, boolean purgeInProgress);
/** * Schedules an operation for execution on the given resource. @@ -130,18 +113,8 @@ public interface OperationManagerRemote { * @return the information on the new schedule * @throws ScheduleException TODO */ - @WebMethod - ResourceOperationSchedule scheduleResourceOperation( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceid") int resourceId, // - @WebParam(name = "operationName") String operationName, // - @WebParam(name = "delay") long delay, // - @WebParam(name = "repeatInterval") long repeatInterval, // - @WebParam(name = "repeatCount") int repeatCount, // - @WebParam(name = "timeout") int timeout, // - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - @WebParam(name = "parameters") Configuration parameters, // - @WebParam(name = "description") String description) // + ResourceOperationSchedule scheduleResourceOperation(Subject subject, int resourceId, String operationName, + long delay, long repeatInterval, int repeatCount, int timeout, Configuration parameters, String description) throws ScheduleException;
/** @@ -156,12 +129,7 @@ public interface OperationManagerRemote { * @throws UnscheduleException TODO * @throws Exception */ - @WebMethod - void unscheduleResourceOperation( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "jobId") String jobId, // - @WebParam(name = "resourceId") int resourceId) // - throws UnscheduleException; + void unscheduleResourceOperation(Subject subject, String jobId, int resourceId) throws UnscheduleException;
/** * @param subject @@ -178,19 +146,9 @@ public interface OperationManagerRemote { * @return * @throws ScheduleException */ - @WebMethod - GroupOperationSchedule scheduleGroupOperation(// - @WebParam(name = "subject") Subject subject,// - @WebParam(name = "groupId") int groupId,// - @WebParam(name = "executionOrderResourceIds") int[] executionOrderResourceIds,// - @WebParam(name = "haltOnFailure") boolean haltOnFailure,// - @WebParam(name = "operationName") String operationName,// - @WebParam(name = "parameters") Configuration parameters,// - @WebParam(name = "delay") long delay,// - @WebParam(name = "repeatInterval") long repeatInterval,// - @WebParam(name = "repeatCount") int repeatCount,// - @WebParam(name = "timeout") int timeout,// - @WebParam(name = "description") String description)// + GroupOperationSchedule scheduleGroupOperation(Subject subject, int groupId, int[] executionOrderResourceIds, + boolean haltOnFailure, String operationName, Configuration parameters, long delay, long repeatInterval, + int repeatCount, int timeout, String description)// throws ScheduleException;
/** @@ -201,11 +159,7 @@ public interface OperationManagerRemote { * @param resourceGroupId the ID of the group whose operation is getting unscheduled * @throws UnscheduleException TODO */ - @WebMethod - void unscheduleGroupOperation(// - @WebParam(name = "subject") Subject subject,// - @WebParam(name = "jobId") String jobId,// - @WebParam(name = "resourceGroupId") int resourceGroupId)// + void unscheduleGroupOperation(Subject subject, String jobId, int resourceGroupId)// throws UnscheduleException;
/** @@ -221,30 +175,15 @@ public interface OperationManagerRemote { * @throws Exception TODO * @throws Exception */ - @WebMethod - List<ResourceOperationSchedule> findScheduledResourceOperations( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId) // - throws Exception; + List<ResourceOperationSchedule> findScheduledResourceOperations(Subject subject, int resourceId) throws Exception;
- @WebMethod - List<GroupOperationSchedule> findScheduledGroupOperations( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId) // - throws Exception; + List<GroupOperationSchedule> findScheduledGroupOperations(Subject subject, int groupId) throws Exception;
- @WebMethod - List<OperationDefinition> findOperationDefinitionsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") OperationDefinitionCriteria criteria); + List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject, OperationDefinitionCriteria criteria);
- @WebMethod - PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") ResourceOperationHistoryCriteria criteria); + PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject, + ResourceOperationHistoryCriteria criteria);
- @WebMethod - PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") GroupOperationHistoryCriteria criteria); + PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(Subject subject, + GroupOperationHistoryCriteria criteria); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java index a74f993..7aea01a 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/PerspectiveManagerBean.java @@ -45,7 +45,6 @@ import org.rhq.enterprise.server.perspective.activator.context.ResourceActivatio import org.rhq.enterprise.server.plugin.pc.perspective.metadata.PerspectivePluginMetadataManager;
@Stateless -// @WebService(endpointInterface = "org.rhq.enterprise.server.perspective.PerspectiveManagerRemote") /** * @author Jay Shaughnessy * @author Ian Springer diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteWsInvocationHandler.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteWsInvocationHandler.java deleted file mode 100644 index 16c2195..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/remote/RemoteWsInvocationHandler.java +++ /dev/null @@ -1,656 +0,0 @@ -package org.rhq.enterprise.server.remote; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.StringTokenizer; - -import javax.management.MBeanServer; -import javax.naming.InitialContext; -import javax.xml.namespace.QName; -import javax.xml.ws.WebServiceClient; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.jboss.remoting.InvocationRequest; -import org.jboss.remoting.ServerInvocationHandler; -import org.jboss.remoting.ServerInvoker; -import org.jboss.remoting.callback.InvokerCallbackHandler; -import org.jboss.remoting.invocation.NameBasedInvocation; - -import org.rhq.core.domain.server.ExternalizableStrategy; -import org.rhq.enterprise.server.safeinvoker.HibernateDetachUtility; - -public class RemoteWsInvocationHandler implements ServerInvocationHandler { - - private static final Log log = LogFactory.getLog(RemoteWsInvocationHandler.class); - private static final Map<String, Class<?>> PRIMITIVE_CLASSES; - private static Map<String, Class<?>> WS_MAP_CLASSES = new HashMap<String, Class<?>>(); - private static Object objFactory = null; - - //Stores references to jaxb static types that have been refelectively located. - private static HashMap<String, Object> remoteList = new HashMap<String, Object>(); - - static { - PRIMITIVE_CLASSES = new HashMap<String, Class<?>>(); - PRIMITIVE_CLASSES.put(Short.TYPE.getName(), Short.TYPE); - PRIMITIVE_CLASSES.put(Integer.TYPE.getName(), Integer.TYPE); - PRIMITIVE_CLASSES.put(Long.TYPE.getName(), Long.TYPE); - PRIMITIVE_CLASSES.put(Float.TYPE.getName(), Float.TYPE); - PRIMITIVE_CLASSES.put(Double.TYPE.getName(), Double.TYPE); - PRIMITIVE_CLASSES.put(Boolean.TYPE.getName(), Boolean.TYPE); - PRIMITIVE_CLASSES.put(Character.TYPE.getName(), Character.TYPE); - PRIMITIVE_CLASSES.put(Byte.TYPE.getName(), Byte.TYPE); - } - - public void addListener(InvokerCallbackHandler arg0) { - } - - public Object invoke(InvocationRequest invocationRequest) throws Throwable { - - System.out.println("In WS Invocation handler ...:" + invocationRequest); - - if (invocationRequest == null) { - throw new IllegalArgumentException("WS-InvocationRequest was null."); - } - - String methodName = null; - boolean successful = false; // we will flip this to true when we know we were successful - Object result = null; - - long time = System.currentTimeMillis(); - - try { - InitialContext ic = new InitialContext(); - - //Figure out which method was called - NameBasedInvocation nbi = ((NameBasedInvocation) invocationRequest.getParameter()); - if (null == nbi) { - throw new IllegalArgumentException("WS-InvocationRequest did not supply method."); - } - - //Split the protocol and figure out how to handle. - methodName = nbi.getMethodName(); - String[] methodInfo = methodName.split(":"); - - // Lookup the remote first, if it doesn't exist exit with error. - // This prevents remote clients from accessing the locals. - String jndiName = "rhq/" + methodInfo[0]; - Object target = ic.lookup(jndiName + "/remote"); - target = ic.lookup(jndiName + "/local"); - - //run down the method to invoke - String[] signature = nbi.getSignature(); - int signatureLength = signature.length; - Class<?>[] sig = new Class[signatureLength]; - for (int i = 0; i < signatureLength; i++) { - sig[i] = getClass(signature[i]); - } - - //RETAIN all of the above from original remoteInvocationHandler as JBossWs gets us into server - // side ... - - // //following functionality is meant to be replicated via static types generated. - Method m = target.getClass().getMethod(methodInfo[1], sig); - result = m.invoke(target, nbi.getParameters()); - // successful = true; - //to be commented above when all WS methods work correctly - - //Attempt to create static types and make the call reflectively - System.out.println("echo curr meth SIGNATURE:" + signature + ":size:" + signature.length); - for (int i = 0; i < signature.length; i++) { - System.out.println("SIG:" + signature[i] + ":"); - } - - try {//wrap everything in exceptions and handle accordingly - - /*Remote webservice object reference that the command is to be called against. In other words there is a - * static JAXB type that the ObjectFactory creates that we'll then run the command against. - */ - Object remoteWsRef = null; - // nbi.getMethodName() ex. [SubjectManagerBean:login] - //String remoteClassKey = "org.rhq.enterprise.server.ws." + methodInfo[0] + "Service"; - // Ex. SubjectManagerBeanService - - // String remoteClassKey = methodInfo[0] + "Service"; - //this is hard coded now - String remoteClassKey = "WebservicesManagerBeanService"; - - //locate the WsRemote references - if (!remoteList.containsKey(remoteClassKey)) {//if not there lazily instantiate - //locate Service - Class<?> located = Class.forName("org.rhq.enterprise.server.ws." + remoteClassKey); - System.out.println("Located service ref:" + located); - //Generate URL: is on local host as well. - URL sUrl = generateRemoteWebserviceURL(located, "127.0.0.1", 7080, false); - //Generate QName - QName sQName = generateRemoteWebserviceQName(located); - //locate constructor and call it - Constructor<?> constructor = located.getConstructor(URL.class, QName.class); - System.out.println("Constructor for service located:" + constructor); - //instantiate - Object servInstance = constructor.newInstance(sUrl, sQName); - System.out.println("ServiceInstance:" + servInstance); - //Finally get the remote instance A.K.A port - //find method Ex. smService.getSubjectManagerBeanPort(); - // Method portMethod = servInstance.getClass().getMethod("get" + methodInfo[0] + "Port", null); - Method portMethod = servInstance.getClass().getMethod("getWebservicesManagerBeanPort", null); - - //call method - Object remoteInst = portMethod.invoke(servInstance, null); - System.out.println("Remote Instance:" + remoteInst); - remoteWsRef = remoteInst; - remoteList.put(remoteClassKey, remoteInst);//store away - System.out.println("Added key:" + remoteClassKey + " value:" + remoteInst); - //now cache remote for later user with key. - } else { //retrieve from cache - remoteWsRef = remoteList.get(remoteClassKey); - } - - //Now make call to the method passed in - //so need to translate rhq-signature into static jaxb type signature objects - Class<?>[] statSignature = new Class<?>[nbi.getSignature().length]; - int index = 0; - - for (String type : nbi.getSignature()) { - System.out.println("Original signature element:" + type + ":"); - //assume type names are unique and only need terminal string. - //Ex. org.rhq.core.domain.auth.Subject -> org.rhq.enterprise.server.ws.Subject - StringTokenizer bag = new StringTokenizer(type, "."); - System.out.println("Bag:" + bag + ":size:" + bag.countTokens()); - String terminal = ""; - while (bag.hasMoreTokens()) { - terminal = bag.nextToken(); - } - System.out.println("terminal bagToken:" + terminal + ":"); - //pull existing type information and use if it's non-RHQ or jaxb type - Class<?> newSignatureInstance = getClass(type); - Class<?> locatedWsClass = null; - if (!WS_MAP_CLASSES.containsKey(terminal)) {//check for signature elements with mappings - System.out.println("Map Key '" + terminal + "' is not located"); - //Check for class in ws.* package and if it exists then return it and store it. - try { - locatedWsClass = Class.forName("org.rhq.enterprise.server.ws." + terminal); - //overwrite with one from WS class - newSignatureInstance = locatedWsClass; - } catch (ClassNotFoundException cnfe) { - //do nothing - } - System.out.println("Located Class is :" + locatedWsClass + ":"); - if (locatedWsClass != null) { - WS_MAP_CLASSES.put(terminal, locatedWsClass); - } - - } else { - newSignatureInstance = WS_MAP_CLASSES.get(terminal); - } - statSignature[index++] = newSignatureInstance; - } - System.out.println("Static signature Map:" + statSignature); - for (int kl = 0; kl < statSignature.length; kl++) { - System.out.println("Signature :" + statSignature[kl] + ":"); - } - - //TODO: SP not sure if need to non rhq/jaxb types in here .. Ex. java.util.Set -> java.util.List. Revisit if signature mismatch occurs - //look up method - System.out.println("Meth lookup for:" + methodInfo[1] + ":" + statSignature + ":"); - Method methodCall = remoteWsRef.getClass().getMethod(methodInfo[1], statSignature); - System.out.println("Successfully found Method call:" + methodCall); - - //translate param values content: - Object[] values = new Object[nbi.getParameters().length]; - //iterate over params and translate/copy if neccesary - for (int k = 0; k < nbi.getParameters().length; k++) { - Object passedIn = nbi.getParameters()[k]; - System.out.println("Object passed in :" + passedIn + ":class:" + passedIn.getClass()); - Object translated = copyValue(passedIn); - System.out.println("Object translated:" + translated + ":class:" + translated.getClass()); - //now pass in the new values - values[k] = translated; - } - //finally call the jaxb static ws method with parameters - Object wsResult = methodCall.invoke(remoteWsRef, values); - System.out.println("Type Returned is:" + wsResult + ":class:" + wsResult.getClass()); - System.out.println("OrigType Returned is:" + result + ":class:" + result.getClass()); - - //Now translate back and override return type appropriately - Object updated = updateRhqType(wsResult, result); - System.out.println("Updated type returned:" + updated); - //now over write the result to be returned - result = updated; - successful = true; - - } catch (Exception ex) { - //TODO: SP wrap these exception in correct type for jbossremoting? - System.out.println("Exception [" + methodInfo[0] + "Service]" + " is:" + ex); - throw new InvocationTargetException(ex); - } - - } catch (InvocationTargetException e) { - log.error("WS-Failed to invoke remote request", e); - return e.getTargetException(); - } catch (Exception e) { - log.error("WS-Failed to invoke remote request", e); - return e; - } finally { - if (result != null) { - // set the strategy guiding how the return information is serialized - ExternalizableStrategy.setStrategy(ExternalizableStrategy.Subsystem.REFLECTIVE_SERIALIZATION); - - // scrub the return data if Hibernate proxies - try { - HibernateDetachUtility.nullOutUninitializedFields(result, - HibernateDetachUtility.SerializationType.SERIALIZATION); - } catch (Exception e) { - log.error("Failed to null out uninitialized fields", e); - // this.metrics.addData(methodName, System.currentTimeMillis() - time, false); - return e; - } - } - - // want to calculate this after the hibernate util so we take that into account too - long executionTime = System.currentTimeMillis() - time; - // this.metrics.addData(methodName, executionTime, successful); - if (log.isDebugEnabled()) { - log.debug("Remote request [" + methodName + "] execution time (ms): " + executionTime); - } - } - - return result; - } - - private Object copyValue(Object passedIn) throws ClassNotFoundException, SecurityException, NoSuchMethodException, - IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException { - System.out.println("In copyValue the translation method:"); - Object translated = passedIn; //start out with untranslated .. may not need to. - - //check for passed in class type - String type = passedIn.getClass().getName(); - System.out.println("Type passed in is:" + type + ":"); - StringTokenizer bag = new StringTokenizer(type, "."); - System.out.println("Bag:" + bag + ":size:" + bag.countTokens()); - String terminal = ""; - while (bag.hasMoreTokens()) { - terminal = bag.nextToken(); - } - - System.out.println("Terminal value is :" + terminal); - System.out.println("Does map contain key:" + WS_MAP_CLASSES.containsKey(terminal) + ":"); - //check to see if parameter passed needs JAXB translation - if (WS_MAP_CLASSES.containsKey(terminal)) { - //create the comparable jaxb type but need objectFactory - if (!WS_MAP_CLASSES.containsKey("objectFactory")) { - // Ex. objFactory = new ObjectFactory(); - if (objFactory == null) { - //Get Object from classpath - Class<?> ofRef = Class.forName("org.rhq.enterprise.server.ws.ObjectFactory"); - System.out.println("Located object factory class:" + ofRef + ":"); - Constructor<?> ofConstructor = ofRef.getConstructor(null); - // Ex. objFactory = (Class) ofConstructor.newInstance(null); - Object retValue = ofConstructor.newInstance(null); - System.out.println("ObjectFactory instantiated:" + retValue + ":"); - objFactory = retValue; - } - } - - //Ex. - // if (terminal.equals(Subject.class.getSimpleName())) { - // org.rhq.enterprise.server.ws.Subject to = objFactory.createSubject(); - // Subject from = (Subject) passedIn; - // //manually copy... ugh! - // to.setDepartment(from.getDepartment()); - // to.setEmailAddress(from.getEmailAddress()); - // to.setFactive(from.getFactive()); - // to.setFirstName(from.getFirstName()); - // to.setFsystem(from.getFsystem()); - // to.setId(from.getId()); - // to.setLastName(from.getLastName()); - // to.setName(from.getName()); - // to.setPhoneNumber(from.getPhoneNumber()); - // to.setSessionId(from.getSessionId()); - // to.setSmsAddress(from.getSmsAddress()); - // // to.setUserConfiguration(from.getUserConfiguration()); - // translated = to; - // } - - //create Type - //locate Method to create type Ex. org.rhq.enterprise.server.ws.ObjectFactory.createSubject() - Method mJxbType = objFactory.getClass().getMethod("create" + terminal, null); - System.out.println("Located CreateMethod for type passed in:" + mJxbType + ":"); - //instantiate jaxb type - Object jaxbType = mJxbType.invoke(objFactory, null); - System.out.println("Jaxb Type created:" + jaxbType + ":"); - - //get all 'set' methods for jaxbType. Seems to be sufficient TODO: verify assumption here for generated types. - Method[] jxbTypeMethList = jaxbType.getClass().getDeclaredMethods(); - //retrieve rhqTypeMethods - Method[] rhqTypeMethList = passedIn.getClass().getDeclaredMethods(); - // HashMap<String, Method> getRhqMethmap = createReferenceMap(rhqTypeMethList, "get"); - HashMap<String, Method> getRhqMethmap = createReferenceMap(rhqTypeMethList, ""); - - //iterate over rhqType get methods calling with values - for (int m = 0; m < jxbTypeMethList.length; m++) { - //only work on 'set' - String meth = jxbTypeMethList[m].getName(); - //TODO: put in special handling for non-trivial types. - if (meth.startsWith("set")) { - System.out.println("Working on method:" + meth + ":obj:" + jxbTypeMethList[m] + ":" - + meth.substring(3) + ":"); - //lookup get method on rhqType - Method getMethod = getRhqMethmap.get("get" + meth.substring(3)); - System.out.println("Just located coreMeth:" + getMethod + ":"); - if (getMethod == null) {//non set method detected - //look for 'is' prefixed getters as well - getMethod = getRhqMethmap.get("is" + meth.substring(3)); - System.out.println("2nd Attempt: Looked up coreMeth for rhq:" + getMethod + ": meth:" - + meth.substring(3) + ":F:" + meth); - //if still null check 'fetch' - if (getMethod == null) { - //look for 'fetch' prefixed getters as well - getMethod = getRhqMethmap.get("fetch" + meth.substring(3)); - System.out.println("3rd Attempt: Looked up coreMeth for rhq:" + getMethod + ": meth:" - + meth.substring(3) + ":F:" + meth); - } - } - - System.out.println("ABOUT to RUN with in/out:" + jxbTypeMethList[m].getParameterTypes()[0] - + " # with input " + getMethod.getReturnType()); - Class<?> inParam = jxbTypeMethList[m].getParameterTypes()[0]; - Class<?> outParam = getMethod.getReturnType(); - if (inParam.getCanonicalName().equals(outParam.getCanonicalName())) { - System.out.println("In/out parms equal.jx:" + jaxbType + " ## passedIn:" + passedIn); - //wrap get in set, aka... do the transfer - jxbTypeMethList[m].invoke(jaxbType, getMethod.invoke(passedIn, null)); - } else {//deal with the mismatch - System.out.println("@@@@@ copyVal in/out NOT MATCHING @@@@@@@@@@@"); - System.out.println("inP:" + inParam.getCanonicalName()); - System.out.println("outParam:" + outParam.getCanonicalName()); - //get return value out - Object returnValue = getMethod.invoke(passedIn, null); - if (returnValue == null) { - System.out.println("NULL VALUE DETECTED .. bailing .. not transfer necessary."); - } else { - //create input type it's supposed to be ex. org.rhq.enterprise.server.ws.InventoryStatus - String terminalString = locateTerminalString(inParam.getCanonicalName()); - System.out.println("Term Str:" + terminalString + " # meth: " + "create" + terminalString); - //CHECK for ENUM .. different approach. - if (inParam.getEnumConstants() == null) { - Method obFacMethod = objFactory.getClass().getMethod("create" + terminalString, null); - System.out.println("Located method:" + obFacMethod); - //TODO: need to finish this impl for non-enum or non-trivial types. See below. - System.out.println("UNFINISHED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - } else { - System.out.println("LOCATED an ENUM:... processing"); - //get instance of the passed in type .. aka returned value - Object rtype = getMethod.invoke(passedIn, null); - System.out.println("Input value evaluated:" + rtype + ":running :" + getMethod); - //get jaxbtype then do jaxbtype.valueOf(rtype); - Method valueOfMethod = inParam.getMethod("valueOf", String.class); - String value = rtype.toString(); - // Method valueMethod = rtype.getClass().getMethod("value", null); - System.out.println("RETRIEVED ENUM methods:" + valueOfMethod + "##" - + rtype.getClass().getCanonicalName() + "ValueAsString:" + value); - //assign to jaxbType - // jaxbType = valueOfMethod.invoke(inParam, valueOfMethod.invoke(rtype, String.class)); - // jaxbType = valueOfMethod.invoke(inParam, valueOfMethod.invoke(rtype, value)); - jaxbType = valueOfMethod.invoke(inParam, value); - System.out.println("Completed assignment...should be good:" + jaxbType); - } - } - // Method obFacMethod = objFactory.getClass().getMethod("create" + terminalString, null); - // System.out.println("Located method:" + obFacMethod); - // Object jaxbInst = obFacMethod.invoke(objFactory, null); - // System.out.println("Instantiated jaxbType:" + jaxbInst); - // //TODO: now copy over .. recurse? - // Object updated = updateRhqType(returnValue, jaxbInst); - // jxbTypeMethList[m].invoke(jaxbType, updated); - } - - // //wrap get in set, aka... do the transfer - // jxbTypeMethList[m].invoke(jaxbType, getMethod.invoke(passedIn, null)); - - // //split out the return type for easier type checking - // Object input = getMethod.invoke(passedIn, null); - // //now check to make sure types(input/output) are compatible - // if (methodOutputInputSame(jxbTypeMethList[m].getParameterTypes(), getMethod.getDeclaringClass())) { - // System.out.println("$$$$$$$$$ COPYVALUE TYPE mismatch detected $$$$$$$$$$$$"); - // //therefor operate on input value to fix. recursive? - // } - // jxbTypeMethList[m].invoke(jaxbType, input); - } - } - translated = jaxbType; - } - System.out.println("Exiting translation method."); - return translated; - } - - private String locateTerminalString(String canonicalName) { - String terminal = ""; - if ((canonicalName != null) && (canonicalName.trim().length() > 0)) { - StringTokenizer bag = new StringTokenizer(canonicalName, "."); - while (bag.hasMoreTokens()) { - terminal = bag.nextToken(); - } - } - return terminal; - } - - private Object updateRhqType(Object jaxbType, Object rhqType) throws ClassNotFoundException, SecurityException, - NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, - InvocationTargetException { - - System.out.println("In updateRhqType the translation method:"); - System.out.println("JAXBTYPE:" + jaxbType + ":class:" + jaxbType.getClass() + ":canon:" - + jaxbType.getClass().getCanonicalName()); - System.out.println("RHQTYPE:" + rhqType + ":class:" + rhqType.getClass() + ":canon:" - + rhqType.getClass().getCanonicalName()); - Object updated = rhqType; - - System.out.println("Jaxb Type passed in:" + jaxbType + ":"); - //get all 'get' methods for jaxbType: TODO: add 'is" to this list for boolean values. - Method[] jaxbTypeMethList = jaxbType.getClass().getDeclaredMethods(); - //retrieve rhqTypeMethod - Method[] rhqTypeMethList = rhqType.getClass().getDeclaredMethods(); - // //make sure method list is coming from right class level - // if (jaxbType.getClass().getCanonicalName().indexOf("java.lang.Class") > -1) { - // jaxbTypeMethList = ((Class) (jaxbType)).getDeclaredMethods(); - // rhqTypeMethList = ((Class) (rhqType)).getDeclaredMethods(); - // } - - //TODO: put in the correct filters 'get'set is, etc... - HashMap<String, Method> rMap = createReferenceMap(rhqTypeMethList, ""); - HashMap<String, Method> map = createReferenceMap(jaxbTypeMethList, ""); - System.out.println("Ref r-map created:" + rMap + ":"); - System.out.println("Ref j-map created:" + map + ":"); - - for (Method method : jaxbTypeMethList) { - //only work on methods that have a 'get' in jaxbtype - String meth = method.getName(); - //now look up Rhq set method - Method rhqSetMethod = rMap.get("set" + meth.substring(3)); - System.out.println("Looked up set method for rhq:" + rhqSetMethod + ": meth:" + meth.substring(3) + ":F:" - + meth); - //TODO: what about other method names - if (rhqSetMethod == null) {//non set method detected - //look for 'is' prefixed getters as well - rhqSetMethod = rMap.get("set" + meth.substring(2)); - System.out.println("2nd Attempt: Looked up set method for rhq:" + rhqSetMethod + ": meth:" - + meth.substring(2) + ":F:" + meth); - } - - //TODO: put in special handling for non-trivial types. - // if (meth.startsWith("get")) { - if (meth.startsWith("get") || meth.startsWith("is")) { - System.out.println("Working on j-get-method:" + meth + ":obj:" + method + ":" + meth.substring(3) - + ":f:" + meth); - System.out.println("Working on r-set-method:" + meth + ":obj:" + rhqSetMethod + ":" + meth.substring(3) - + ":f:" + meth); - //wrap get in set - - // rhqSetMethod.invoke(rhqType, method.invoke(jaxbType, null)); - // insert check for parameter type mismatch - if (methodOutputInputSame(rhqSetMethod.getParameterTypes(), method.getReturnType())) { - rhqSetMethod.invoke(rhqType, method.invoke(jaxbType, null)); - } else {// extract param and translate then invoke - System.out.println("$$$$$$$$$$$ PROBLEM@@@ type mismatch "); - String from = method.getReturnType().getCanonicalName(); - String to = rhqSetMethod.getParameterTypes()[0].getCanonicalName(); - - //copy data over - System.out.println("moving:" + method.getReturnType() + ": data to " - + rhqSetMethod.getParameterTypes()[0]); - if (from.equals("java.util.List") && to.equals("java.util.Set")) {//This is common enough case just hard code. - Set input = new HashSet(); - //retrieve return type data as object - Object jxbReturnValue = method.invoke(jaxbType, null); - //copy all data over as target type - input.addAll((Collection) jxbReturnValue); - //now make the call with translated type - rhqSetMethod.invoke(rhqType, input); - System.out.println("Completed List to Set translation."); - } else { - System.out.println("Assuming a JAXB -> RHQ copy needs to occur"); - //recursive call to method to handle non-trivial types... - // Object updatedRhqValue = updateRhqType(method.getReturnType(), - // rhqSetMethod.getParameterTypes()[0]); - System.out.println("JAXBtype:" + jaxbType + ":method:" + meth + ":"); - Object jxbNonTrivType = method.invoke(jaxbType, null); - System.out.println("Retrieved non-trivial jxb type:" + jxbNonTrivType + ":"); - if (jxbNonTrivType != null) { - //Now get instance of type from RHQtype .. otherwise transfer not possible - //locate method to instantiate/retrieve it - Method rhqNonTrivTypeMethod = rMap.get("get" + rhqSetMethod.getName().substring(3)); - System.out.println("Retrieved Meth for non-triv type:" + rhqNonTrivTypeMethod + ":"); - Object rhqNonTrivTypeInst = rhqNonTrivTypeMethod.invoke(rhqType, null); - //now recurse ... - Object updatedRhqValue = updateRhqType(jxbNonTrivType, rhqNonTrivTypeInst); - //now make the call with translated type - rhqSetMethod.invoke(rhqType, updatedRhqValue); - System.out.println("Completed RHQ type update."); - } else { - System.out.println("NULL value detected. Not copying result of method:" + method); - } - } - - // Object[] translated = translateNonTrivialTypeToObjectArray(method.invoke(jaxbType,null),); - } - } - } - - updated = rhqType; - // } - System.out.println("Exiting update method."); - return updated; - } - - private boolean methodOutputInputSame(Class<?>[] rhqParamTypeList, Class<?> paramTypeList) { - boolean paramsEqual = true; - //iterate over parameters in order and - if (rhqParamTypeList.length > 1) { - System.out.println("##### parameter count mismatch!!! ATTENTION REQUIRED."); - return false; - } - for (int i = 0; i < rhqParamTypeList.length; i++) { - // System.out.println("PARAM-R-" + i + ":" + rhqParamTypeList[i].getCanonicalName()); - // System.out.println("PARAM-J-" + i + ":" + paramTypeList.getCanonicalName()); - if (!rhqParamTypeList[i].getCanonicalName().equals(paramTypeList.getCanonicalName())) { - paramsEqual = false; - System.out.println("###########Mismatch detected####################"); - System.out.println("PARAM-R-" + i + ":" + rhqParamTypeList[i].getCanonicalName()); - System.out.println("PARAM-J-" + i + ":" + paramTypeList.getCanonicalName()); - } - } - return paramsEqual; - } - - //TODO: modify prefix to be a list of comma separated filter prefixes - private HashMap<String, Method> createReferenceMap(Method[] rhqTypeMethList, String prefix) { - HashMap<String, Method> map = new HashMap<String, Method>(); - for (int i = 0; i < rhqTypeMethList.length; i++) { - if ((prefix != null) && (prefix.trim().length() > 0)) { - if (rhqTypeMethList[i].getName().startsWith(prefix)) { - map.put(rhqTypeMethList[i].getName(), rhqTypeMethList[i]); - } - } else { //else add all methods - map.put(rhqTypeMethList[i].getName(), rhqTypeMethList[i]); - } - } - return map; - } - - Class<?> getClass(String name) throws ClassNotFoundException { - // TODO GH: Doesn't support arrays - if (PRIMITIVE_CLASSES.containsKey(name)) { - return PRIMITIVE_CLASSES.get(name); - } else { - return Class.forName(name); - } - } - - /**Dynamically builds the WSDL URL to connect to a remote server. - * - * @param remote class correctly annotated with Webservice reference. - * @return valid URL - * @throws MalformedURLException - */ - public static URL generateRemoteWebserviceURL(Class remote, String host, int port, boolean useHttps) - throws MalformedURLException { - - URL wsdlLocation = null; - //TODO: what to do about exceptions/messaging? throw illegalArgs? - //insert checks for host, port - if ((host == null) || (host.trim().length() == 0) || (port <= 0)) { - return wsdlLocation; - } - - //check for reference for right annotations - if ((remote != null) && remote.isAnnotationPresent(WebServiceClient.class)) { - String beanName = remote.getSimpleName(); - String protocol = "https://"; - if (!useHttps) { - protocol = "http://"; - } - wsdlLocation = new URL(protocol + host + ":" + port + "/rhq-rhq-enterprise-server-ejb3/" - + beanName.substring(0, beanName.length() - "Service".length()) + "?wsdl"); - } - return wsdlLocation; - - } - - public static QName generateRemoteWebserviceQName(Class remote) { - - QName generated = null; - //check for reference with right annotation - if ((remote != null) && (remote.isAnnotationPresent(WebServiceClient.class))) { - String annotatedQnameValue = ""; - Annotation annot = remote.getAnnotation(WebServiceClient.class); - WebServiceClient annotated = (WebServiceClient) annot; - annotatedQnameValue = annotated.targetNamespace(); - String beanName = remote.getSimpleName(); - - generated = new QName(annotatedQnameValue, beanName); - } - return generated; - - } - - public void removeListener(InvokerCallbackHandler arg0) { - } - - public void setInvoker(ServerInvoker arg0) { - } - - public void setMBeanServer(MBeanServer arg0) { - } - -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerLocal.java index 1383329..8005034 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerLocal.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerLocal.java @@ -18,22 +18,18 @@ */ package org.rhq.enterprise.server.report;
-import org.rhq.core.domain.auth.Subject; -import org.rhq.core.domain.util.PageControl; +import java.util.List;
-import javax.jws.soap.SOAPBinding; -import javax.jws.WebService; -import javax.ejb.Remote; import javax.ejb.Local; -import java.util.List; + +import org.rhq.core.domain.auth.Subject; +import org.rhq.core.domain.util.PageControl;
@Local public interface DataAccessManagerLocal {
- public List<Object[]> executeQuery(Subject subject, String query);
public List<Object[]> executeQueryWithPageControl(Subject subject, String query, PageControl pageControl);
- } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerRemote.java index fe0cd33..fe629d8 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/report/DataAccessManagerRemote.java @@ -21,20 +21,13 @@ package org.rhq.enterprise.server.report; import java.util.List;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.util.PageControl; -import org.rhq.enterprise.server.system.ServerVersion;
/** * @author Greg Hinkle */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface DataAccessManagerRemote {
@@ -45,10 +38,8 @@ public interface DataAccessManagerRemote { * @param query the query to execute * @return a list of object results. Each entry in the rows array will represent an item from the select clause */ - @WebMethod public List<Object[]> executeQuery(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "query") String query); + Subject subject, String query);
/** * Execute a query filtered by a page control @@ -58,10 +49,7 @@ public interface DataAccessManagerRemote { * @param pageControl pages to load * @return list of object array results */ - @WebMethod public List<Object[]> executeQueryWithPageControl(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "query") String query, // - @WebParam(name = "pageControl") PageControl pageControl); + Subject subject, String query, PageControl pageControl);
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java index 9edd5d9..ad81fb1 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerBean.java @@ -33,7 +33,6 @@ import javax.persistence.EntityManager; import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -77,7 +76,6 @@ import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.content.ContentManagerHelper; import org.rhq.enterprise.server.content.ContentManagerLocal; import org.rhq.enterprise.server.core.AgentManagerLocal; -import org.rhq.enterprise.server.jaxb.adapter.ConfigurationAdapter;
/** * Bean to handle interaction with the resource factory subsystem of the plugin container. !! Warning, the factory @@ -131,9 +129,7 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal,
// There is some inconsistency if we're completing a request that was not in the database if (history == null) { - log - .error("Attempting to complete a request that was not found in the database: " - + response.getRequestId()); + log.error("Attempting to complete a request that was not found in the database: " + response.getRequestId()); return; }
@@ -442,10 +438,11 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, ResourceType newResourceType = entityManager.find(ResourceType.class, newResourceTypeId); PackageType newPackageType = contentManager.getResourceCreationPackageType(newResourceTypeId);
- if (!newResourceType.isCreatable() || (newResourceType.getCreationDataType() != ResourceCreationDataType.CONTENT)) { + if (!newResourceType.isCreatable() + || (newResourceType.getCreationDataType() != ResourceCreationDataType.CONTENT)) { throw new RuntimeException("Cannot create " + newResourceType + " child Resource under parent " - + parentResource + ", since the " + newResourceType - + " type does not support content-based Resource creation."); + + parentResource + ", since the " + newResourceType + + " type does not support content-based Resource creation."); }
abortResourceCreationIfExistingSingleton(parentResource, newResourceType); @@ -494,15 +491,17 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, Agent agent = parentResource.getAgent();
// Check permissions first - if (!authorizationManager.hasResourcePermission(user, Permission.CREATE_CHILD_RESOURCES, parentResource.getId())) { + if (!authorizationManager + .hasResourcePermission(user, Permission.CREATE_CHILD_RESOURCES, parentResource.getId())) { throw new PermissionException("User [" + user.getName() + "] does not have permission to create a child resource for resource [" + parentResource + "]"); }
- if (!resourceType.isCreatable() || (resourceType.getCreationDataType() != ResourceCreationDataType.CONFIGURATION)) { + if (!resourceType.isCreatable() + || (resourceType.getCreationDataType() != ResourceCreationDataType.CONFIGURATION)) { throw new RuntimeException("Cannot create " + resourceType + " child Resource under parent " - + parentResource + ", since the " + resourceType - + " type does not support configuration-based Resource creation."); + + parentResource + ", since the " + resourceType + + " type does not support configuration-based Resource creation."); }
abortResourceCreationIfExistingSingleton(parentResource, resourceType); @@ -537,24 +536,20 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal,
@Override public CreateResourceHistory createPackageBackedResource(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, byte[] packageBits, Integer timeout) { - - return createResource(subject, parentResourceId, newResourceTypeId, newResourceName,// - pluginConfiguration, packageName, packageVersionNumber, architectureId,// - deploymentTimeConfiguration, new ByteArrayInputStream(packageBits), (Map<String, String>) null, timeout); + int newResourceTypeId, String newResourceName, Configuration pluginConfiguration, String packageName, + String packageVersionNumber, Integer architectureId, Configuration deploymentTimeConfiguration, + byte[] packageBits, Integer timeout) { + + return createResource(subject, parentResourceId, newResourceTypeId, newResourceName, pluginConfiguration, + packageName, packageVersionNumber, architectureId, deploymentTimeConfiguration, new ByteArrayInputStream( + packageBits), (Map<String, String>) null, timeout); }
@Override public CreateResourceHistory createPackageBackedResource(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, String packageName, String packageVersionNumber, Integer architectureId,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, byte[] packageBits) { + int newResourceTypeId, String newResourceName, Configuration pluginConfiguration, String packageName, + String packageVersionNumber, Integer architectureId, Configuration deploymentTimeConfiguration, + byte[] packageBits) {
return createResource(subject, parentResourceId, newResourceTypeId, newResourceName, pluginConfiguration, packageName, packageVersionNumber, architectureId, deploymentTimeConfiguration, new ByteArrayInputStream( @@ -563,11 +558,8 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal,
@Override public CreateResourceHistory createPackageBackedResourceViaPackageVersion(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration,// - int packageVersionId) { + int newResourceTypeId, String newResourceName, Configuration pluginConfiguration, + Configuration deploymentTimeConfiguration, int packageVersionId) {
return createPackageBackedResourceViaPackageVersion(subject, parentResourceId, newResourceTypeId, newResourceName, pluginConfiguration, deploymentTimeConfiguration, packageVersionId, (Integer) null); @@ -575,18 +567,14 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal,
@Override public CreateResourceHistory createPackageBackedResourceViaPackageVersion(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration,// - int packageVersionId, Integer timeout) { + int newResourceTypeId, String newResourceName, Configuration pluginConfiguration, + Configuration deploymentTimeConfiguration, int packageVersionId, Integer timeout) {
Resource parentResource = entityManager.find(Resource.class, parentResourceId);
// Check permissions first - if (!authorizationManager.hasResourcePermission(subject, Permission.CREATE_CHILD_RESOURCES, parentResource - .getId())) { + if (!authorizationManager.hasResourcePermission(subject, Permission.CREATE_CHILD_RESOURCES, + parentResource.getId())) { throw new PermissionException("User [" + subject.getName() + "] does not have permission to create a child resource for resource [" + parentResource + "]"); } @@ -594,10 +582,11 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, ResourceType newResourceType = entityManager.find(ResourceType.class, newResourceTypeId); PackageVersion packageVersion = entityManager.find(PackageVersion.class, packageVersionId);
- if (!newResourceType.isCreatable() || (newResourceType.getCreationDataType() != ResourceCreationDataType.CONTENT)) { + if (!newResourceType.isCreatable() + || (newResourceType.getCreationDataType() != ResourceCreationDataType.CONTENT)) { throw new RuntimeException("Cannot create " + newResourceType + " child Resource under parent " - + parentResource + ", since the " + newResourceType - + " type does not support content-based Resource creation."); + + parentResource + ", since the " + newResourceType + + " type does not support content-based Resource creation."); }
abortResourceCreationIfExistingSingleton(parentResource, newResourceType); @@ -620,8 +609,9 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, }
// Persist in separate transaction so it is committed immediately, before the request is sent to the agent - CreateResourceHistory persistedHistory = resourceFactoryManager.persistCreateHistory(subject, parentResource - .getId(), newResourceType.getId(), newResourceName, packageVersion, deploymentTimeConfiguration); + CreateResourceHistory persistedHistory = resourceFactoryManager.persistCreateHistory(subject, + parentResource.getId(), newResourceType.getId(), newResourceName, packageVersion, + deploymentTimeConfiguration);
// Package into transfer object ResourcePackageDetails packageDetails = ContentManagerHelper.packageVersionToDetails(packageVersion); @@ -639,7 +629,7 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, } catch (NoResultException nre) { return null; //eat the exception. Some of the queries return no results if no package yet exists which is fine. - } catch(CannotConnectException e) { + } catch (CannotConnectException e) { log.error("Error while sending create resource request to agent service", e);
// Submit the error as a failure response @@ -699,7 +689,7 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, resourceFactoryAgentService.deleteResource(request);
return persistedHistory; - } catch(CannotConnectException e) { + } catch (CannotConnectException e) { log.error("Error while sending delete resource request to agent service", e);
// Submit the error as a failure response @@ -727,14 +717,14 @@ public class ResourceFactoryManagerBean implements ResourceFactoryManagerLocal, ResourceCriteria resourceCriteria = new ResourceCriteria(); resourceCriteria.addFilterParentResourceId(parentResource.getId()); resourceCriteria.addFilterResourceTypeId(resourceType.getId()); - PageList<Resource> childResourcesOfType = resourceManager.findResourcesByCriteria(subjectManager.getOverlord(), - resourceCriteria); + PageList<Resource> childResourcesOfType = resourceManager.findResourcesByCriteria( + subjectManager.getOverlord(), resourceCriteria); if (childResourcesOfType.size() >= 1) { throw new RuntimeException("Cannot create " + resourceType + " child Resource under parent " - + parentResource + ", since " + resourceType - + " is a singleton type, and there is already a child Resource of that type. " - + "If the existing child Resource corresponds to a managed Resource which no longer exists, " - + "uninventory it and then try again."); + + parentResource + ", since " + resourceType + + " is a singleton type, and there is already a child Resource of that type. " + + "If the existing child Resource corresponds to a managed Resource which no longer exists, " + + "uninventory it and then try again."); } } } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerRemote.java index d92883f..d0c4d18 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceFactoryManagerRemote.java @@ -21,11 +21,6 @@ package org.rhq.enterprise.server.resource; import java.util.List;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.configuration.Configuration; @@ -35,14 +30,10 @@ import org.rhq.core.domain.resource.DeleteResourceHistory; import org.rhq.core.domain.resource.ResourceCreationDataType; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.jaxb.adapter.ConfigurationAdapter; -import org.rhq.enterprise.server.system.ServerVersion;
/* * @author Jay Shaughnessy */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface ResourceFactoryManagerRemote {
@@ -63,15 +54,8 @@ public interface ResourceFactoryManagerRemote { * @param resourceConfiguration resource configuration for the new resource * @param timeout number of milliseconds before the agent suffers a timeout when creating the resource. If null uses default. */ - @WebMethod - CreateResourceHistory createResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "parentResourceId") int parentResourceId, // - @WebParam(name = "resourceTypeId") int resourceTypeId, // - @WebParam(name = "resourceName") String resourceName, // - @WebParam(name = "pluginConfiguration") Configuration pluginConfiguration, // - @WebParam(name = "resourceConfiguration") Configuration resourceConfiguration, // - @WebParam(name = "timeout") Integer timeout); + CreateResourceHistory createResource(Subject subject, int parentResourceId, int resourceTypeId, + String resourceName, Configuration pluginConfiguration, Configuration resourceConfiguration, Integer timeout);
/** * Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, @@ -95,23 +79,9 @@ public interface ResourceFactoryManagerRemote { * @param packageBits content of the package to create * @param timeout number of milliseconds before the agent suffers a timeout when creating the resource. If null uses default. */ - @WebMethod - CreateResourceHistory createPackageBackedResource(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "parentResourceId") int parentResourceId, // - @WebParam(name = "newResourceTypeId") int newResourceTypeId, // - @WebParam(name = "newResourceName") String newResourceName, // - @WebParam(name = "pluginConfiguration")// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, // - @WebParam(name = "packageName") String packageName, // - @WebParam(name = "packageVersion") String packageVersion, // - @WebParam(name = "architectureId") Integer architectureId, // - @WebParam(name = "deploymentTimeConfiguration")// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, // - @WebParam(name = "packageBits") byte[] packageBits, // - @WebParam(name = "timeout") Integer timeout); + CreateResourceHistory createPackageBackedResource(Subject subject, int parentResourceId, int newResourceTypeId, + String newResourceName, Configuration pluginConfiguration, String packageName, String packageVersion, + Integer architectureId, Configuration deploymentTimeConfiguration, byte[] packageBits, Integer timeout);
/** * Creates a new physical resource. The resource will be created as a child of the specified parent. In other words, @@ -132,20 +102,9 @@ public interface ResourceFactoryManagerRemote { * @param packageVersionId An existing package version to back this resource * @param timeout number of milliseconds before the agent suffers a timeout when creating the resource. If null uses default. */ - @WebMethod - public CreateResourceHistory createPackageBackedResourceViaPackageVersion(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "parentResourceId") int parentResourceId, // - @WebParam(name = "newResourceTypeId") int newResourceTypeId, // - @WebParam(name = "newResourceName") String newResourceName, // - @WebParam(name = "pluginConfiguration")// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, // - @WebParam(name = "deploymentTimeConfiguration")// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, // - @WebParam(name = "packageVersionId") int packageVersionId, // - @WebParam(name = "timeout") Integer timeout); + public CreateResourceHistory createPackageBackedResourceViaPackageVersion(Subject subject, int parentResourceId, + int newResourceTypeId, String newResourceName, Configuration pluginConfiguration, + Configuration deploymentTimeConfiguration, int packageVersionId, Integer timeout);
/** * Deletes a physical resource from the agent machine. After this call, the resource will no longer be accessible @@ -155,10 +114,7 @@ public interface ResourceFactoryManagerRemote { * @param subject user requesting the deletion. must have resource delete perm on the resource. * @param resourceId resource being deleted */ - @WebMethod - DeleteResourceHistory deleteResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + DeleteResourceHistory deleteResource(Subject subject, int resourceId);
/** * Deletes physical resources from the agent machine. After this call, the resource will no longer be accessible @@ -168,10 +124,7 @@ public interface ResourceFactoryManagerRemote { * @param subject user requesting the deletion. must have resource delete perm on the resources. * @param resourceIds the resources being deleted */ - @WebMethod - List<DeleteResourceHistory> deleteResources( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") int[] resourceIds); + List<DeleteResourceHistory> deleteResources(Subject subject, int[] resourceIds);
/** * Returns a pagination enabled list of requests for the creation of new child resources to the specified parent. @@ -186,13 +139,8 @@ public interface ResourceFactoryManagerRemote { * * @return list of requests */ - @WebMethod - PageList<CreateResourceHistory> findCreateChildResourceHistory( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "parentResourceId") int parentResourceId, // - @WebParam(name = "beginDate") Long beginDate, // - @WebParam(name = "endDate") Long endDate, // - @WebParam(name = "pageControl") PageControl pageControl); + PageList<CreateResourceHistory> findCreateChildResourceHistory(Subject subject, int parentResourceId, + Long beginDate, Long endDate, PageControl pageControl);
/** * Returns a pagination enabled list of requests to delete a child resource on the specified parent. These requests @@ -207,11 +155,6 @@ public interface ResourceFactoryManagerRemote { * * @return list of requests */ - @WebMethod - PageList<DeleteResourceHistory> findDeleteChildResourceHistory( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "parentResourceId") int parentResourceId, // - @WebParam(name = "beginDate") Long beginDate, // - @WebParam(name = "endDate") Long endDate, // - @WebParam(name = "pageControl") PageControl pageControl); + PageList<DeleteResourceHistory> findDeleteChildResourceHistory(Subject subject, int parentResourceId, + Long beginDate, Long endDate, PageControl pageControl); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java index a016f8e..2ad2680 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java @@ -39,7 +39,6 @@ import javax.persistence.EntityManager; import javax.persistence.NoResultException; import javax.persistence.PersistenceContext; import javax.persistence.Query; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -124,7 +123,6 @@ import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.authz.RequiredPermission; import org.rhq.enterprise.server.core.AgentManagerLocal; import org.rhq.enterprise.server.discovery.DiscoveryServerServiceImpl; -import org.rhq.enterprise.server.jaxb.adapter.ResourceListAdapter; import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal; import org.rhq.enterprise.server.resource.disambiguation.DisambiguationUpdateStrategy; import org.rhq.enterprise.server.resource.disambiguation.Disambiguator; @@ -2361,8 +2359,7 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage }
// lineage is a getXXX (not findXXX) because it logically returns a single object, but modeled as a list here - public @XmlJavaTypeAdapter(value = ResourceListAdapter.class) - List<Resource> findResourceLineage(Subject subject, int resourceId) { + public List<Resource> findResourceLineage(Subject subject, int resourceId) { List<Resource> result = getResourceLineage(resourceId);
for (Resource resource : result) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java index d49faff..3a0c282 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerRemote.java @@ -22,11 +22,6 @@ import java.util.List; import java.util.Map;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceCriteria; @@ -37,17 +32,12 @@ import org.rhq.core.domain.resource.ResourceAncestryFormat; import org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.jaxb.WebServiceMapAdapter; -import org.rhq.enterprise.server.jaxb.adapter.ResourceListAdapter; -import org.rhq.enterprise.server.system.ServerVersion;
/** - * @author Asaf Shakarchi * @author Jay Shaughnessy * @author Simeon Pinder + * @author Asaf Shakarchi */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface ResourceManagerRemote {
@@ -60,10 +50,7 @@ public interface ResourceManagerRemote { * * @return summary POJO */ - @WebMethod - ResourceAvailabilitySummary getAvailabilitySummary( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + ResourceAvailabilitySummary getAvailabilitySummary(Subject subject, int resourceId);
/** * Returns the availability of the resource with the specified id. @@ -80,10 +67,7 @@ public interface ResourceManagerRemote { * @throws FetchException if the resource represented by the resourceId parameter does not exist, or if the * passed subject does not have permission to view this resource. */ - @WebMethod - ResourceAvailability getLiveResourceAvailability( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + ResourceAvailability getLiveResourceAvailability(Subject subject, int resourceId);
/** * Returns the Resource with the specified id. @@ -95,10 +79,7 @@ public interface ResourceManagerRemote { * @throws FetchException if the resource represented by the resourceId parameter does not exist, or if the * passed subject does not have permission to view this resource. */ - @WebMethod - Resource getResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + Resource getResource(Subject subject, int resourceId);
/** * Returns the lineage of the Resource with the specified id. The lineage is represented as a List of Resources, @@ -112,11 +93,7 @@ public interface ResourceManagerRemote { * @return the lineage of the Resource with the specified id * @throws FetchException on any issue. Wraps ResourceNotFoundException when necessary. */ - @WebMethod - @XmlJavaTypeAdapter(value = ResourceListAdapter.class) - List<Resource> findResourceLineage( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + List<Resource> findResourceLineage(Subject subject, int resourceId);
/** * Update resource's editable properties (name, description, location). @@ -125,10 +102,7 @@ public interface ResourceManagerRemote { * @param resource the resource to update * @return the updated resource */ - @WebMethod - Resource updateResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resource") Resource resource); + Resource updateResource(Subject subject, Resource resource);
/** * Removes these resources from inventory. The resources may subsequently be rediscovered. Note that for @@ -138,26 +112,13 @@ public interface ResourceManagerRemote { * @param subject The logged in user's subject. * @param resourceIds The resources to uninventory. */ - @WebMethod - List<Integer> uninventoryResources( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") int[] resourceIds); - - @WebMethod - PageList<Resource> findResourcesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") ResourceCriteria criteria); - - @WebMethod - PageList<Resource> findChildResources( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "pageControl") PageControl pageControl); - - @WebMethod - Resource getParentResource( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId); + List<Integer> uninventoryResources(Subject subject, int[] resourceIds); + + PageList<Resource> findResourcesByCriteria(Subject subject, ResourceCriteria criteria); + + PageList<Resource> findChildResources(Subject subject, int resourceId, PageControl pageControl); + + Resource getParentResource(Subject subject, int resourceId);
/** * Resource.ancestry is an encoded value that holds the resource's parental ancestry. It is not suitable for display. @@ -170,12 +131,7 @@ public interface ResourceManagerRemote { * @param format * @return A Map of ResourceIds to FormattedAncestryStrings, one entry for each unique, valid, resourceId passed in. */ - @WebMethod - @XmlJavaTypeAdapter(value = WebServiceMapAdapter.class) - Map<Integer, String> getResourcesAncestry( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceIds") Integer[] resourceIds, // - @WebParam(name = "format") ResourceAncestryFormat format); + Map<Integer, String> getResourcesAncestry(Subject subject, Integer[] resourceIds, ResourceAncestryFormat format);
/** * Set these resources to {@link AvailabilityType.DISABLED}. While disabled resource availability reported @@ -191,9 +147,7 @@ public interface ResourceManagerRemote { * * @see #enableResources(Subject, int[]) */ - List<Integer> disableResources( // - Subject subject, // - int[] resourceIds); + List<Integer> disableResources(Subject subject, int[] resourceIds);
/** * Set these resources enabled. Resources already enabled are ignored. The availability will be set to UNKNOWN @@ -207,8 +161,6 @@ public interface ResourceManagerRemote { * * @see #disableResources(Subject, int[]) */ - List<Integer> enableResources( // - Subject subject, // - int[] resourceIds); + List<Integer> enableResources(Subject subject, int[] resourceIds);
} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerRemote.java index a879e05..673bfa6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceTypeManagerRemote.java @@ -19,27 +19,16 @@ package org.rhq.enterprise.server.resource;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceTypeCriteria; import org.rhq.core.domain.resource.ResourceType; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.system.ServerVersion;
-@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface ResourceTypeManagerRemote {
- @WebMethod - ResourceType getResourceTypeById(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceTypeId") int resourceTypeId) // - throws ResourceTypeNotFoundException; + ResourceType getResourceTypeById(Subject subject, int resourceTypeId) throws ResourceTypeNotFoundException;
/** * @param subject @@ -48,14 +37,7 @@ public interface ResourceTypeManagerRemote { * * @return the resource type by name and plugin or null if the type is not found */ - @WebMethod - ResourceType getResourceTypeByNameAndPlugin(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "name") String name, // - @WebParam(name = "plugin") String plugin); + ResourceType getResourceTypeByNameAndPlugin(Subject subject, String name, String plugin);
- @WebMethod - PageList<ResourceType> findResourceTypesByCriteria(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") ResourceTypeCriteria criteria); + PageList<ResourceType> findResourceTypesByCriteria(Subject subject, ResourceTypeCriteria criteria); } \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java index e05b1bb..8428e87 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerBean.java @@ -44,7 +44,6 @@ import javax.persistence.PersistenceContext; import javax.persistence.PersistenceException; import javax.persistence.Query; import javax.sql.DataSource; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -88,7 +87,6 @@ import org.rhq.enterprise.server.auth.SubjectManagerLocal; import org.rhq.enterprise.server.authz.AuthorizationManagerLocal; import org.rhq.enterprise.server.authz.PermissionException; import org.rhq.enterprise.server.authz.RequiredPermission; -import org.rhq.enterprise.server.jaxb.adapter.ResourceGroupAdapter; import org.rhq.enterprise.server.operation.OperationManagerLocal; import org.rhq.enterprise.server.resource.ResourceManagerLocal; import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; @@ -146,8 +144,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso } }
- public ResourceGroup createPrivateResourceGroup(Subject subject, // - @XmlJavaTypeAdapter(ResourceGroupAdapter.class) ResourceGroup group) { + public ResourceGroup createPrivateResourceGroup(Subject subject, ResourceGroup group) {
group.setSubject(subject); group.setRecursive(false); @@ -156,8 +153,7 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso }
@RequiredPermission(Permission.MANAGE_INVENTORY) - public ResourceGroup createResourceGroup(Subject user, // - @XmlJavaTypeAdapter(ResourceGroupAdapter.class) ResourceGroup group) { + public ResourceGroup createResourceGroup(Subject user, ResourceGroup group) {
// We are now allowing Groups where names collide if the group is not visible as for autogroups and clusters Query query = entityManager.createNamedQuery(ResourceGroup.QUERY_FIND_BY_NAME_VISIBLE_GROUP); @@ -356,10 +352,10 @@ public class ResourceGroupManagerBean implements ResourceGroupManagerLocal, Reso List<GroupOperationSchedule> ops = operationManager.findScheduledGroupOperations(overlord, group.getId());
for (GroupOperationSchedule schedule : ops) { - operationManager.unscheduleGroupOperation(overlord, schedule.getJobId().toString(), group.getId()); + operationManager.unscheduleGroupOperation(overlord, schedule.getJobId().toString(), group.getId()); } } catch (Exception e) { - throw new ResourceGroupDeleteException( "Failed to get jobs for a group being deleted [" + group + throw new ResourceGroupDeleteException("Failed to get jobs for a group being deleted [" + group + "]; will not attempt to unschedule anything", e); }
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java index 4071c39..ceffcac 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/group/ResourceGroupManagerRemote.java @@ -19,11 +19,6 @@ package org.rhq.enterprise.server.resource.group;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.ResourceGroupCriteria; @@ -31,76 +26,35 @@ import org.rhq.core.domain.resource.group.ResourceGroup; import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; import org.rhq.core.domain.util.PageControl; import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.jaxb.adapter.ResourceGroupAdapter; -import org.rhq.enterprise.server.system.ServerVersion;
/** * @author Jay Shaughnessy */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface ResourceGroupManagerRemote {
- @WebMethod - void addResourcesToGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "resourceIds") int[] resourceIds); + void addResourcesToGroup(Subject subject, int groupId, int[] resourceIds);
- @WebMethod - ResourceGroup createResourceGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceGroup")// - @XmlJavaTypeAdapter(ResourceGroupAdapter.class) ResourceGroup resourceGroup); + ResourceGroup createResourceGroup(Subject subject, ResourceGroup resourceGroup);
- @WebMethod - void deleteResourceGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId) throws ResourceGroupNotFoundException, ResourceGroupDeleteException; + void deleteResourceGroup(Subject subject, int groupId) throws ResourceGroupNotFoundException, + ResourceGroupDeleteException;
- @WebMethod - void deleteResourceGroups( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupIds") int[] groupIds) throws ResourceGroupNotFoundException, + void deleteResourceGroups(Subject subject, int[] groupIds) throws ResourceGroupNotFoundException, ResourceGroupDeleteException;
- @WebMethod - ResourceGroup getResourceGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId); + ResourceGroup getResourceGroup(Subject subject, int groupId);
- @WebMethod - ResourceGroupComposite getResourceGroupComposite( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId); + ResourceGroupComposite getResourceGroupComposite(Subject subject, int groupId);
- @WebMethod - PageList<ResourceGroup> findResourceGroupsForRole( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "roleId") int roleId, // - @WebParam(name = "pageControl") PageControl pc); + PageList<ResourceGroup> findResourceGroupsForRole(Subject subject, int roleId, PageControl pc);
- @WebMethod - void removeResourcesFromGroup(// - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "resourceIds") int[] resourceIds); + void removeResourcesFromGroup(Subject subject, int groupId, int[] resourceIds);
- @WebMethod - void setRecursive( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "groupId") int groupId, // - @WebParam(name = "isRecursive") boolean isRecursive); + void setRecursive(Subject subject, int groupId, boolean isRecursive);
- @WebMethod - ResourceGroup updateResourceGroup( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "newResourceGroup") ResourceGroup newResourceGroup); + ResourceGroup updateResourceGroup(Subject subject, ResourceGroup newResourceGroup);
- @WebMethod - PageList<ResourceGroup> findResourceGroupsByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") ResourceGroupCriteria criteria); + PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria);
} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java index cc878d7..96dbefe 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/search/SavedSearchManagerRemote.java @@ -19,25 +19,18 @@ package org.rhq.enterprise.server.search;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.criteria.SavedSearchCriteria; import org.rhq.core.domain.search.SavedSearch; import org.rhq.core.domain.util.PageList; import org.rhq.enterprise.server.authz.PermissionException; -import org.rhq.enterprise.server.system.ServerVersion;
/** * The remote interface to the SavedSearchManager. * * @author Joseph Marques */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) @Remote public interface SavedSearchManagerRemote {
@@ -51,10 +44,10 @@ public interface SavedSearchManagerRemote { * managers can create global saved searches. Regular users can only create {@link SavedSearch}es against * their own accounts. */ - @WebMethod + public int createSavedSearch( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "savedSearch") SavedSearch savedSearch); + Subject subject, // + SavedSearch savedSearch);
/** * Saves all changes to the passed {@link SavedSearch} database, correlating it to the record already @@ -68,10 +61,10 @@ public interface SavedSearchManagerRemote { * managers can update global saved searches. Regular users can only update {@link SavedSearch}es from * their own accounts. */ - @WebMethod + public boolean updateSavedSearch( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "savedSearch") SavedSearch savedSearch); + Subject subject, // + SavedSearch savedSearch);
/** * Deletes the {@link SavedSearch} with the given primary key @@ -83,10 +76,10 @@ public interface SavedSearchManagerRemote { * managers can delete global saved searches. Regular users can only delete {@link SavedSearch}es from * their own accounts. */ - @WebMethod + public void deleteSavedSearch( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "savedSearchId") int savedSearchId); + Subject subject, // + int savedSearchId);
/** * Returns the {@link SavedSearch} with the given primary key @@ -98,10 +91,8 @@ public interface SavedSearchManagerRemote { * @throws PermissionException if the user is not authorized to view the {@link SavedSearch}. Regular users can * only view {@link SavedSearch}es from their own accounts. */ - @WebMethod - public SavedSearch getSavedSearchById( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "savedSearchId") int savedSearchId); + + public SavedSearch getSavedSearchById(Subject subject, int savedSearchId);
/** * Returns the {@link PageList} of {@link SavedSearch} entities that match the criteria filters that are visible @@ -113,8 +104,6 @@ public interface SavedSearchManagerRemote { * @return the {@link PageList} of {@link SavedSearch} entities that match the criteria filters, an empty list * will be returned if no results were found or none matches the given filters */ - @WebMethod - public PageList<SavedSearch> findSavedSearchesByCriteria( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "criteria") SavedSearchCriteria criteria); + + public PageList<SavedSearch> findSavedSearchesByCriteria(Subject subject, SavedSearchCriteria criteria); } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerRemote.java index 1b8b00f..155347e 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/support/SupportManagerRemote.java @@ -21,12 +21,8 @@ package org.rhq.enterprise.server.support; import java.net.URL;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService;
import org.rhq.core.domain.auth.Subject; -import org.rhq.enterprise.server.system.ServerVersion;
/** * Provides some methods that are useful for supporting managed resources. This includes being @@ -35,7 +31,7 @@ import org.rhq.enterprise.server.system.ServerVersion; * * @author John Mazzitelli */ -@WebService(targetNamespace = ServerVersion.namespace) + @Remote public interface SupportManagerRemote { /** @@ -50,10 +46,5 @@ public interface SupportManagerRemote { * @return a URL that the caller can use to obtain the snapshot report * @throws Exception */ - @WebMethod - URL getSnapshotReport( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "resourceId") int resourceId, // - @WebParam(name = "name") String name, // - @WebParam(name = "description") String description) throws Exception; + URL getSnapshotReport(Subject subject, int resourceId, String name, String description) throws Exception; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/SynchronizationManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/SynchronizationManagerRemote.java index eb6b5c9..5bbe514 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/SynchronizationManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/sync/SynchronizationManagerRemote.java @@ -31,10 +31,9 @@ import org.rhq.core.domain.sync.ImportConfigurationDefinition; import org.rhq.core.domain.sync.ImportReport;
/** - * - * * @author Lukas Krejci */ + @Remote public interface SynchronizationManagerRemote {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java index 1f71b6f..7ed7004 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerRemote.java @@ -21,9 +21,6 @@ package org.rhq.enterprise.server.system; import java.util.Properties;
import javax.ejb.Remote; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.common.ProductInfo; @@ -33,7 +30,7 @@ import org.rhq.core.domain.common.composite.SystemSettings; /** * @author John Mazzitelli */ -@WebService(targetNamespace = ServerVersion.namespace) + @Remote public interface SystemManagerRemote { /** @@ -43,9 +40,7 @@ public interface SystemManagerRemote { * * @return the product info */ - @WebMethod - ProductInfo getProductInfo( // - @WebParam(name = "subject") Subject subject); + ProductInfo getProductInfo(Subject subject);
/** * Provides details (such as product version) of the server processing the request. Requires MANAGE_SETTINGS. @@ -54,17 +49,13 @@ public interface SystemManagerRemote { * * @return server details */ - @WebMethod - ServerDetails getServerDetails( // - @WebParam(name = "subject") Subject subject); + ServerDetails getServerDetails(Subject subject);
/** * @deprecated use {@link #getSystemSettings(Subject)} instead */ - @WebMethod @Deprecated - Properties getSystemConfiguration( // - @WebParam(name = "subject") Subject subject); + Properties getSystemConfiguration(Subject subject);
/** * Get the server cloud configuration. These are the server configurations that will be @@ -74,19 +65,14 @@ public interface SystemManagerRemote { * * @return the settings */ - SystemSettings getSystemSettings( - @WebParam(name = "subject") Subject subject); - + SystemSettings getSystemSettings(Subject subject); + /** * @deprecated use {@link #setSystemSettings(Subject, SystemSettings)} instead */ - @WebMethod @Deprecated - void setSystemConfiguration( // - @WebParam(name = "subject") Subject subject, // - @WebParam(name = "properties") Properties properties, // - @WebParam(name = "skipValidation") boolean skipValidation) throws Exception; - + void setSystemConfiguration(Subject subject, Properties properties, boolean skipValidation) throws Exception; + /** * Set the server cloud configuration. The given properties will be the new settings * for all servers in the HA server cloud. @@ -94,8 +80,5 @@ public interface SystemManagerRemote { * @param subject the user who wants to change the settings * @param settings the new system configuration settings */ - @WebMethod - void setSystemSettings( - @WebParam(name = "subject") Subject subject, - @WebParam(name = "settings") SystemSettings settings) throws Exception; + void setSystemSettings(Subject subject, SystemSettings settings) throws Exception; } diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestBean.java deleted file mode 100644 index 2ef4360..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestBean.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.util.List; - -import javax.ejb.Stateless; - -@Stateless -// @WebService(endpointInterface = "org.rhq.enterprise.server.test.WebServiceTestRemote") -public class WebServiceTestBean implements WebServiceTestLocal, WebServiceTestRemote { - public String addPerson(Person p) { - String result = "person (" + p.name.first + "," + p.name.last + ") at age " + p.age + " with phone numbers ("; - for (Phone pn : p.phone) { - result += (pn.npa + "-" + pn.nxx + "-" + pn.number); - result += ','; - } - - result += ") - added."; - return result; - } - - public AnotherPerson updatePerson(AnotherPerson p, Name n) { - p.name = n; - return p; - } - - public String testListArg(List<String> list) { - StringBuilder sb = new StringBuilder("list contains ("); - for (String item : list) { - sb.append(item); - sb.append(','); - } - - return sb.toString(); - } - - public Person getPersonByName(Name n) { - Person p = new Person(); - p.name = n; - p.age = 22; - p.phone.add(new Phone("919", "754", "4600")); - p.phone.add(new Phone("919", "754", "4601")); - p.phone.add(new Phone("919", "754", "4602")); - return p; - } - - public String echo(String s) { - return s; - } - - public String hello() { - return "Hello, welcome to web services."; - } - - public void testExceptions() throws TestException { - Name n = new Name(); - n.first = "Elmer"; - n.last = "Fudd"; - throw new TestException(n); - } - - public void testVoid() { - } -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestLocal.java deleted file mode 100644 index 52cda49..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestLocal.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import javax.ejb.Local; - -@Local -public interface WebServiceTestLocal { - String addPerson(Person person); - - AnotherPerson updatePerson(AnotherPerson person, Name name); - - Person getPersonByName(Name name); - - String echo(String s); - - String hello(); -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestRemote.java deleted file mode 100644 index 4753923..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/WebServiceTestRemote.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.test; - -import java.util.ArrayList; -import java.util.List; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; - -class Person { - public Name name; - public int age; - public List<Phone> phone = new ArrayList<Phone>(); -} - -class AnotherPerson { - public Name name; - public int age; - public List<Phone> phone = new ArrayList<Phone>(); -} - -class Name { - public Name() { - } - - public Name(String first, String last) { - this.first = first; - this.last = last; - } - - public String first; - public String last; -} - -class Phone { - public Phone() { - } - - public Phone(String npa, String nxx, String number) { - this.npa = npa; - this.nxx = nxx; - this.number = number; - } - - public String npa; - public String nxx; - public String number; -} - -class TestException extends Exception { - public TestException() { - super(); - } - - public TestException(Name owner) { - super(owner.first + owner.last); - this.owner = owner; - } - - public Name owner; - - public static final long serialVersionUID = 0L; -} - -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService -public interface WebServiceTestRemote { - @WebMethod - String addPerson(@WebParam(name = "person") - Person person); - - @WebMethod - String testListArg(@WebParam(name = "list") - List<String> list); - - @WebMethod - AnotherPerson updatePerson(@WebParam(name = "person") - AnotherPerson person, @WebParam(name = "name") - Name name); - - Person getPersonByName(@WebParam(name = "name") - Name name); - - @WebMethod - String echo(String s); - - @WebMethod - String hello(); - - @WebMethod - void testVoid(); - - @WebMethod - void testExceptions() throws TestException; -} \ No newline at end of file diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/RemoteAPIValidator.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/RemoteAPIValidator.java index ec0e4f7..fddc6c6 100644 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/RemoteAPIValidator.java +++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/RemoteAPIValidator.java @@ -26,9 +26,6 @@ import java.util.List; import java.util.Set;
import javax.ejb.Local; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService;
import org.rhq.core.domain.auth.Subject; import org.rhq.core.domain.util.PageControl; @@ -146,18 +143,8 @@ public class RemoteAPIValidator { localInterface = interfaces[1]; }
- WebService webService = remoteInterface.getAnnotation(WebService.class); - if (webService == null) { - errors.add(remoteInterface.getSimpleName() + ", missing @WebService class annotation"); - } - Method[] remoteMethods = remoteInterface.getMethods(); for (Method remoteMethod : remoteMethods) { - WebMethod webMethod = remoteMethod.getAnnotation(WebMethod.class); - if (webMethod == null) { - errors.add(format(remoteMethod) + ", missing @WebMethod method annotation"); - } - String methodName = remoteMethod.getName(); Class<?>[] parameterTypes = remoteMethod.getParameterTypes(); try { @@ -233,23 +220,6 @@ public class RemoteAPIValidator { return; } Annotation[] parameterAnnotations = remoteMethod.getParameterAnnotations()[parameterIndex]; - WebParam webParam = null; - for (int i = 0; i < parameterAnnotations.length; i++) { - if (parameterAnnotations[i] instanceof WebParam) { - webParam = (WebParam) parameterAnnotations[i]; - break; - } - } - if (webParam == null) { - errors.add(format(remoteMethod) + ", missing @WebParam parameter annotation for " - + parameterType.getSimpleName()); - return; - } - - String name = webParam.name(); - if (name.equals(namingConvention) == false) { - errors.add(format(remoteMethod) + ", convention should be @WebParam(name = "" + namingConvention + "")"); - } }
private static String format(Method method) { diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java deleted file mode 100644 index 123aa75..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesManagerBean.java +++ /dev/null @@ -1,1297 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License, version 2, as - * published by the Free Software Foundation, and/or the GNU Lesser - * General Public License, version 2.1, also as published by the Free - * Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License and the GNU Lesser General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License - * and the GNU Lesser General Public License along with this program; - * if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.rhq.enterprise.server.webservices; - -import java.io.File; -import java.io.InputStream; -import java.net.URL; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; - -import javax.ejb.Stateless; -import javax.jws.WebService; -import javax.xml.bind.annotation.XmlSeeAlso; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; - -import org.rhq.core.domain.alert.Alert; -import org.rhq.core.domain.alert.AlertDefinition; -import org.rhq.core.domain.alert.notification.AlertNotification; -import org.rhq.core.domain.auth.Subject; -import org.rhq.core.domain.authz.Role; -import org.rhq.core.domain.bundle.Bundle; -import org.rhq.core.domain.bundle.BundleDeployment; -import org.rhq.core.domain.bundle.BundleDestination; -import org.rhq.core.domain.bundle.BundleFile; -import org.rhq.core.domain.bundle.BundleResourceDeployment; -import org.rhq.core.domain.bundle.BundleType; -import org.rhq.core.domain.bundle.BundleVersion; -import org.rhq.core.domain.bundle.ResourceTypeBundleConfiguration; -import org.rhq.core.domain.bundle.composite.BundleWithLatestVersionComposite; -import org.rhq.core.domain.common.EntityContext; -import org.rhq.core.domain.common.ProductInfo; -import org.rhq.core.domain.common.ServerDetails; -import org.rhq.core.domain.common.composite.SystemSettings; -import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.configuration.PluginConfigurationUpdate; -import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; -import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.configuration.definition.PropertyDefinition; -import org.rhq.core.domain.configuration.definition.PropertyDefinitionList; -import org.rhq.core.domain.configuration.definition.PropertyDefinitionMap; -import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; -import org.rhq.core.domain.configuration.group.GroupPluginConfigurationUpdate; -import org.rhq.core.domain.configuration.group.GroupResourceConfigurationUpdate; -import org.rhq.core.domain.content.Architecture; -import org.rhq.core.domain.content.InstalledPackage; -import org.rhq.core.domain.content.Package; -import org.rhq.core.domain.content.PackageType; -import org.rhq.core.domain.content.PackageVersion; -import org.rhq.core.domain.content.Repo; -import org.rhq.core.domain.content.composite.PackageAndLatestVersionComposite; -import org.rhq.core.domain.content.composite.PackageTypeAndVersionFormatComposite; -import org.rhq.core.domain.content.transfer.SubscribedRepo; -import org.rhq.core.domain.criteria.AlertCriteria; -import org.rhq.core.domain.criteria.AlertDefinitionCriteria; -import org.rhq.core.domain.criteria.AvailabilityCriteria; -import org.rhq.core.domain.criteria.BundleCriteria; -import org.rhq.core.domain.criteria.BundleDeploymentCriteria; -import org.rhq.core.domain.criteria.BundleDestinationCriteria; -import org.rhq.core.domain.criteria.BundleFileCriteria; -import org.rhq.core.domain.criteria.BundleResourceDeploymentCriteria; -import org.rhq.core.domain.criteria.BundleVersionCriteria; -import org.rhq.core.domain.criteria.Criteria; -import org.rhq.core.domain.criteria.EventCriteria; -import org.rhq.core.domain.criteria.GroupOperationHistoryCriteria; -import org.rhq.core.domain.criteria.InstalledPackageCriteria; -import org.rhq.core.domain.criteria.MeasurementDataTraitCriteria; -import org.rhq.core.domain.criteria.MeasurementDefinitionCriteria; -import org.rhq.core.domain.criteria.MeasurementScheduleCriteria; -import org.rhq.core.domain.criteria.OperationDefinitionCriteria; -import org.rhq.core.domain.criteria.PackageCriteria; -import org.rhq.core.domain.criteria.PackageVersionCriteria; -import org.rhq.core.domain.criteria.RepoCriteria; -import org.rhq.core.domain.criteria.ResourceCriteria; -import org.rhq.core.domain.criteria.ResourceGroupCriteria; -import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria; -import org.rhq.core.domain.criteria.ResourceTypeCriteria; -import org.rhq.core.domain.criteria.RoleCriteria; -import org.rhq.core.domain.criteria.SubjectCriteria; -import org.rhq.core.domain.event.Event; -import org.rhq.core.domain.event.EventSeverity; -import org.rhq.core.domain.measurement.Availability; -import org.rhq.core.domain.measurement.DisplayType; -import org.rhq.core.domain.measurement.MeasurementBaseline; -import org.rhq.core.domain.measurement.MeasurementData; -import org.rhq.core.domain.measurement.MeasurementDataTrait; -import org.rhq.core.domain.measurement.MeasurementDefinition; -import org.rhq.core.domain.measurement.MeasurementSchedule; -import org.rhq.core.domain.measurement.ResourceAvailability; -import org.rhq.core.domain.measurement.calltime.CallTimeDataComposite; -import org.rhq.core.domain.measurement.composite.MeasurementDataNumericHighLowComposite; -import org.rhq.core.domain.operation.GroupOperationHistory; -import org.rhq.core.domain.operation.OperationDefinition; -import org.rhq.core.domain.operation.ResourceOperationHistory; -import org.rhq.core.domain.operation.bean.GroupOperationSchedule; -import org.rhq.core.domain.operation.bean.ResourceOperationSchedule; -import org.rhq.core.domain.resource.CreateResourceHistory; -import org.rhq.core.domain.resource.DeleteResourceHistory; -import org.rhq.core.domain.resource.Resource; -import org.rhq.core.domain.resource.ResourceAncestryFormat; -import org.rhq.core.domain.resource.ResourceType; -import org.rhq.core.domain.resource.composite.ProblemResourceComposite; -import org.rhq.core.domain.resource.composite.ResourceAvailabilitySummary; -import org.rhq.core.domain.resource.group.ResourceGroup; -import org.rhq.core.domain.resource.group.composite.ResourceGroupComposite; -import org.rhq.core.domain.sync.ExportReport; -import org.rhq.core.domain.sync.ImportConfiguration; -import org.rhq.core.domain.sync.ImportConfigurationDefinition; -import org.rhq.core.domain.sync.ImportReport; -import org.rhq.core.domain.util.PageControl; -import org.rhq.core.domain.util.PageList; -import org.rhq.enterprise.server.alert.AlertDefinitionManagerLocal; -import org.rhq.enterprise.server.alert.AlertManagerLocal; -import org.rhq.enterprise.server.auth.SubjectException; -import org.rhq.enterprise.server.auth.SubjectManagerLocal; -import org.rhq.enterprise.server.authz.RoleManagerLocal; -import org.rhq.enterprise.server.bundle.BundleManagerLocal; -import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal; -import org.rhq.enterprise.server.configuration.ConfigurationUpdateStillInProgressException; -import org.rhq.enterprise.server.content.ContentManagerLocal; -import org.rhq.enterprise.server.content.RepoException; -import org.rhq.enterprise.server.content.RepoManagerLocal; -import org.rhq.enterprise.server.discovery.DiscoveryBossLocal; -import org.rhq.enterprise.server.drift.DriftManagerLocal; -import org.rhq.enterprise.server.event.EventManagerLocal; -import org.rhq.enterprise.server.exception.LoginException; -import org.rhq.enterprise.server.exception.ScheduleException; -import org.rhq.enterprise.server.exception.UnscheduleException; -import org.rhq.enterprise.server.jaxb.adapter.ConfigurationAdapter; -import org.rhq.enterprise.server.jaxb.adapter.ResourceGroupAdapter; -import org.rhq.enterprise.server.measurement.AvailabilityManagerLocal; -import org.rhq.enterprise.server.measurement.CallTimeDataManagerLocal; -import org.rhq.enterprise.server.measurement.MeasurementAggregate; -import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal; -import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal; -import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerLocal; -import org.rhq.enterprise.server.measurement.MeasurementProblemManagerLocal; -import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal; -import org.rhq.enterprise.server.operation.OperationManagerLocal; -import org.rhq.enterprise.server.resource.ResourceFactoryManagerLocal; -import org.rhq.enterprise.server.resource.ResourceManagerLocal; -import org.rhq.enterprise.server.resource.ResourceNotFoundException; -import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal; -import org.rhq.enterprise.server.resource.ResourceTypeNotFoundException; -import org.rhq.enterprise.server.resource.group.ResourceGroupDeleteException; -import org.rhq.enterprise.server.resource.group.ResourceGroupManagerLocal; -import org.rhq.enterprise.server.resource.group.ResourceGroupNotFoundException; -import org.rhq.enterprise.server.support.SupportManagerLocal; -import org.rhq.enterprise.server.sync.ImportException; -import org.rhq.enterprise.server.sync.SynchronizationManagerLocal; -import org.rhq.enterprise.server.sync.ValidationException; -import org.rhq.enterprise.server.system.ServerVersion; -import org.rhq.enterprise.server.system.SystemManagerLocal; -import org.rhq.enterprise.server.util.LookupUtil; - -/** The purpose of this class is to aggregate all the EJB remote implementation into one - * class that can be annotated by JBossWS. Each annotated SLSB causes a full WSDL compile and - * publish by JBossWS which is very costly in terms of time. Deploy times went from 2 mins to 12 mins. - * - * @author Simeon Pinder - * - */ -@Stateless -@WebService(endpointInterface = "org.rhq.enterprise.server.webservices.WebservicesRemote", targetNamespace = ServerVersion.namespace) -@XmlSeeAlso({ PropertyDefinition.class, PropertyDefinitionSimple.class, PropertyDefinitionList.class, - PropertyDefinitionMap.class }) -public class WebservicesManagerBean implements WebservicesRemote { - - //Lookup the required beans as local references - private AlertManagerLocal alertManager = LookupUtil.getAlertManager(); - private AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager(); - private AvailabilityManagerLocal availabilityManager = LookupUtil.getAvailabilityManager(); - private BundleManagerLocal bundleManager = LookupUtil.getBundleManager(); - private CallTimeDataManagerLocal callTimeDataManager = LookupUtil.getCallTimeDataManager(); - private ConfigurationManagerLocal configurationManager = LookupUtil.getConfigurationManager(); - private ContentManagerLocal contentManager = LookupUtil.getContentManager(); - //removed as it is problematic for WS clients having XMLAny for Object. - // private DataAccessManagerLocal dataAccessManager = LookupUtil.getDataAccessManager(); - private DiscoveryBossLocal discoveryBoss = LookupUtil.getDiscoveryBoss(); - private DriftManagerLocal driftManager = LookupUtil.getDriftManager(); - private EventManagerLocal eventManager = LookupUtil.getEventManager(); - private MeasurementBaselineManagerLocal measurementBaselineManager = LookupUtil.getMeasurementBaselineManager(); - private MeasurementDataManagerLocal measurementDataManager = LookupUtil.getMeasurementDataManager(); - private MeasurementDefinitionManagerLocal measurementDefinitionManager = LookupUtil - .getMeasurementDefinitionManager(); - private MeasurementProblemManagerLocal measurementProblemManager = LookupUtil.getMeasurementProblemManager(); - private MeasurementScheduleManagerLocal measurementScheduleManager = LookupUtil.getMeasurementScheduleManager(); - private OperationManagerLocal operationManager = LookupUtil.getOperationManager(); - private RepoManagerLocal repoManager = LookupUtil.getRepoManagerLocal(); - private ResourceFactoryManagerLocal resourceFactoryManager = LookupUtil.getResourceFactoryManager(); - private ResourceManagerLocal resourceManager = LookupUtil.getResourceManager(); - private ResourceGroupManagerLocal resourceGroupManager = LookupUtil.getResourceGroupManager(); - private ResourceTypeManagerLocal resourceTypeManager = LookupUtil.getResourceTypeManager(); - private RoleManagerLocal roleManager = LookupUtil.getRoleManager(); - private SubjectManagerLocal subjectManager = LookupUtil.getSubjectManager(); - private SupportManagerLocal supportManager = LookupUtil.getSupportManager(); - private SystemManagerLocal systemManager = LookupUtil.getSystemManager(); - private SynchronizationManagerLocal synchronizationManager = LookupUtil.getSynchronizationManager(); - - //ALERTMANAGER: BEGIN ------------------------------------------ - public PageList<Alert> findAlertsByCriteria(Subject subject, AlertCriteria criteria) { - return alertManager.findAlertsByCriteria(subject, criteria); - } - - public int deleteAlerts(Subject subject, int[] alertIds) { - return alertManager.deleteAlerts(subject, alertIds); - } - - public int deleteAlertsByContext(Subject subject, EntityContext context) { - return alertManager.deleteAlertsByContext(subject, context); - } - - public int acknowledgeAlerts(Subject subject, int[] alertIds) { - return alertManager.acknowledgeAlerts(subject, alertIds); - } - - public int acknowledgeAlertsByContext(Subject subject, EntityContext context) { - return alertManager.acknowledgeAlertsByContext(subject, context); - } - - //ALERTMANAGER: END -------------------------------------------- - - //ALERTDEFINITIONMANAGER: BEGIN -------------------------------- - - public AlertDefinition getAlertDefinition(Subject subject, int alertDefinitionId) { - return alertDefinitionManager.getAlertDefinition(subject, alertDefinitionId); - } - - public PageList<AlertDefinition> findAlertDefinitionsByCriteria(Subject subject, AlertDefinitionCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return alertDefinitionManager.findAlertDefinitionsByCriteria(subject, criteria); - } - - public int enableAlertDefinitions(Subject subject, int[] alertDefinitionIds) { - return alertDefinitionManager.enableAlertDefinitions(subject, alertDefinitionIds); - } - - public int disableAlertDefinitions(Subject subject, int[] alertDefinitionIds) { - return alertDefinitionManager.disableAlertDefinitions(subject, alertDefinitionIds); - } - - public int removeAlertDefinitions(Subject subject, int[] alertDefinitionIds) { - return alertDefinitionManager.removeAlertDefinitions(subject, alertDefinitionIds); - } - - public String[] getAlertNotificationConfigurationPreview(Subject subject, AlertNotification[] alertNotifications) { - return alertDefinitionManager.getAlertNotificationConfigurationPreview(subject, alertNotifications); - } - - //ALERTDEFINITIONMANAGER: END ---------------------------------- - - //AVAILABILITYMANAGER: BEGIN ---------------------------------- - public PageList<Availability> findAvailabilityByCriteria(Subject subject, AvailabilityCriteria criteria) { - return availabilityManager.findAvailabilityByCriteria(subject, criteria); - } - - public PageList<Availability> findAvailabilityForResource(Subject subject, int resourceId, PageControl pc) { - return availabilityManager.findAvailabilityForResource(subject, resourceId, pc); - } - - public Availability getCurrentAvailabilityForResource(Subject subject, int resourceId) { - return availabilityManager.getCurrentAvailabilityForResource(subject, resourceId); - } - - //AVAILABILITYMANAGER: END ---------------------------------- - - //BUNDLEMANAGER: BEGIN ------------------------------------------ - - @Override - public ResourceTypeBundleConfiguration getResourceTypeBundleConfiguration(Subject subject, int compatGroupId) - throws Exception { - return bundleManager.getResourceTypeBundleConfiguration(subject, compatGroupId); - } - - public BundleFile addBundleFile(Subject subject, int bundleVersionId, String name, String version, - Architecture architecture, InputStream fileStream) throws Exception { - return bundleManager.addBundleFile(subject, bundleVersionId, name, version, architecture, fileStream); - } - - public BundleFile addBundleFileViaByteArray(Subject subject, int bundleVersionId, String name, String version, - Architecture architecture, byte[] fileBytes) throws Exception { - return bundleManager - .addBundleFileViaByteArray(subject, bundleVersionId, name, version, architecture, fileBytes); - } - - public BundleFile addBundleFileViaURL(Subject subject, int bundleVersionId, String name, String version, - Architecture architecture, String bundleFileUrl) throws Exception { - return bundleManager.addBundleFileViaURL(subject, bundleVersionId, name, version, architecture, bundleFileUrl); - } - - public BundleFile addBundleFileViaPackageVersion(Subject subject, int bundleVersionId, String name, - int packageVersionId) throws Exception { - return bundleManager.addBundleFileViaPackageVersion(subject, bundleVersionId, name, packageVersionId); - } - - public BundleDeployment createBundleDeployment(Subject subject, int bundleVersionId, int bundleDestinationId, - String description, Configuration configuration) throws Exception { - return bundleManager.createBundleDeployment(subject, bundleVersionId, bundleDestinationId, description, - configuration); - } - - public BundleDestination createBundleDestination(Subject subject, int bundleId, String name, String description, - String destBaseDirName, String deployDir, Integer groupId) throws Exception { - return bundleManager.createBundleDestination(subject, bundleId, name, description, destBaseDirName, deployDir, - groupId); - } - - public BundleVersion createBundleVersionViaRecipe(Subject subject, String recipe) throws Exception { - return bundleManager.createBundleVersionViaRecipe(subject, recipe); - } - - public BundleVersion createBundleVersionViaFile(Subject subject, File distributionFile) throws Exception { - return bundleManager.createBundleVersionViaFile(subject, distributionFile); - } - - public BundleVersion createBundleVersionViaByteArray(Subject subject, byte[] fileBytes) throws Exception { - return bundleManager.createBundleVersionViaByteArray(subject, fileBytes); - } - - public BundleVersion createBundleVersionViaURL(Subject subject, String distributionFileUrl) throws Exception { - return bundleManager.createBundleVersionViaURL(subject, distributionFileUrl); - } - - public void deleteBundles(Subject subject, int[] bundleIds) throws Exception { - bundleManager.deleteBundles(subject, bundleIds); - } - - public void deleteBundle(Subject subject, int bundleId) throws Exception { - bundleManager.deleteBundle(subject, bundleId); - } - - public void deleteBundleVersion(Subject subject, int bundleVersionId, boolean deleteBundleIfEmpty) throws Exception { - bundleManager.deleteBundleVersion(subject, bundleVersionId, deleteBundleIfEmpty); - } - - public PageList<BundleDeployment> findBundleDeploymentsByCriteria(Subject subject, BundleDeploymentCriteria criteria) { - return bundleManager.findBundleDeploymentsByCriteria(subject, criteria); - } - - public PageList<BundleDestination> findBundleDestinationsByCriteria(Subject subject, - BundleDestinationCriteria criteria) { - return bundleManager.findBundleDestinationsByCriteria(subject, criteria); - } - - public PageList<BundleResourceDeployment> findBundleResourceDeploymentsByCriteria(Subject subject, - BundleResourceDeploymentCriteria criteria) { - return bundleManager.findBundleResourceDeploymentsByCriteria(subject, criteria); - } - - public PageList<Bundle> findBundlesByCriteria(Subject subject, BundleCriteria criteria) { - return bundleManager.findBundlesByCriteria(subject, criteria); - } - - public PageList<BundleFile> findBundleFilesByCriteria(Subject subject, BundleFileCriteria criteria) { - return bundleManager.findBundleFilesByCriteria(subject, criteria); - } - - public PageList<BundleVersion> findBundleVersionsByCriteria(Subject subject, BundleVersionCriteria criteria) { - return bundleManager.findBundleVersionsByCriteria(subject, criteria); - } - - public PageList<BundleWithLatestVersionComposite> findBundlesWithLatestVersionCompositesByCriteria(Subject subject, - BundleCriteria criteria) { - return bundleManager.findBundlesWithLatestVersionCompositesByCriteria(subject, criteria); - } - - public List<BundleType> getAllBundleTypes(Subject subject) { - return bundleManager.getAllBundleTypes(subject); - } - - public BundleType getBundleType(Subject subject, String bundleTypeName) { - return bundleManager.getBundleType(subject, bundleTypeName); - } - - public Set<String> getBundleVersionFilenames(Subject subject, int bundleVersionId, boolean withoutBundleFileOnly) - throws Exception { - return bundleManager.getBundleVersionFilenames(subject, bundleVersionId, withoutBundleFileOnly); - } - - public BundleDeployment scheduleBundleDeployment(Subject subject, int bundleDeploymentId, boolean isCleanDeployment) - throws Exception { - return bundleManager.scheduleBundleDeployment(subject, bundleDeploymentId, isCleanDeployment); - } - - public BundleDeployment scheduleRevertBundleDeployment(Subject subject, int bundleDestinationId, - String deploymentDescription, boolean isCleanDeployment) throws Exception { - return bundleManager.scheduleRevertBundleDeployment(subject, bundleDestinationId, deploymentDescription, - isCleanDeployment); - } - - public void purgeBundleDestination(Subject subject, int bundleDestinationId) throws Exception { - bundleManager.purgeBundleDestination(subject, bundleDestinationId); - } - - //BUNDLEMANAGER: END ---------------------------------- - - //CALLTIMEDATAMANAGER: BEGIN ---------------------------------- - public PageList<CallTimeDataComposite> findCallTimeDataForResource(Subject subject, int scheduleId, long beginTime, - long endTime, PageControl pc) { - return callTimeDataManager.findCallTimeDataForResource(subject, scheduleId, beginTime, endTime, pc); - } - - //CALLTIMEDATAMANAGER: END ---------------------------------- - - //CONFIGURATIONMANAGER: BEGIN ---------------------------------- - public Configuration getConfiguration(Subject subject, int configurationId) { - return configurationManager.getConfiguration(subject, configurationId); - } - - public GroupPluginConfigurationUpdate getGroupPluginConfigurationUpdate(Subject subject, int configurationUpdateId) { - return configurationManager.getGroupPluginConfigurationUpdate(subject, configurationUpdateId); - } - - public GroupResourceConfigurationUpdate getGroupResourceConfigurationUpdate(Subject subject, - int configurationUpdateId) { - return configurationManager.getGroupResourceConfigurationUpdate(subject, configurationUpdateId); - } - - public PluginConfigurationUpdate getLatestPluginConfigurationUpdate(Subject subject, int resourceId) { - return configurationManager.getLatestPluginConfigurationUpdate(subject, resourceId); - } - - public ResourceConfigurationUpdate getLatestResourceConfigurationUpdate(Subject subject, int resourceId) { - return configurationManager.getLatestResourceConfigurationUpdate(subject, resourceId); - } - - public Configuration getLiveResourceConfiguration(Subject subject, int resourceId, boolean pingAgentFirst) - throws Exception { - return configurationManager.getLiveResourceConfiguration(subject, resourceId, pingAgentFirst); - } - - public @XmlJavaTypeAdapter(ConfigurationAdapter.class) - Configuration getPluginConfiguration(Subject subject, int resourceId) { - return configurationManager.getPluginConfiguration(subject, resourceId); - } - - public ConfigurationDefinition getPluginConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId) { - return configurationManager.getPluginConfigurationDefinitionForResourceType(subject, resourceTypeId); - } - - public @XmlJavaTypeAdapter(ConfigurationAdapter.class) - Configuration getResourceConfiguration(Subject subject, int resourceId) { - return configurationManager.getResourceConfiguration(subject, resourceId); - } - - public ConfigurationDefinition getResourceConfigurationDefinitionForResourceType(Subject subject, int resourceTypeId) { - return configurationManager.getResourceConfigurationDefinitionForResourceType(subject, resourceTypeId); - } - - public ConfigurationDefinition getResourceConfigurationDefinitionWithTemplatesForResourceType(Subject subject, - int resourceTypeId) { - return configurationManager.getResourceConfigurationDefinitionWithTemplatesForResourceType(subject, - resourceTypeId); - } - - public boolean isGroupResourceConfigurationUpdateInProgress(Subject subject, int resourceGroupId) { - return configurationManager.isGroupResourceConfigurationUpdateInProgress(subject, resourceGroupId); - } - - public boolean isResourceConfigurationUpdateInProgress(Subject subject, int resourceId) { - return configurationManager.isResourceConfigurationUpdateInProgress(subject, resourceId); - } - - public int scheduleGroupResourceConfigurationUpdate(Subject subject, int compatibleGroupId, - Map<Integer, Configuration> newResourceConfigurationMap) { - return configurationManager.scheduleGroupResourceConfigurationUpdate(subject, compatibleGroupId, - newResourceConfigurationMap); - } - - public PluginConfigurationUpdate updatePluginConfiguration(Subject subject, int resourceId, - @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration newConfiguration) - throws ResourceNotFoundException { - return configurationManager.updatePluginConfiguration(subject, resourceId, newConfiguration); - } - - public ResourceConfigurationUpdate updateResourceConfiguration(Subject subject, int resourceId, - @XmlJavaTypeAdapter(ConfigurationAdapter.class) Configuration newConfiguration) - throws ResourceNotFoundException, ConfigurationUpdateStillInProgressException { - return configurationManager.updateResourceConfiguration(subject, resourceId, newConfiguration); - } - - public ConfigurationDefinition getPackageTypeConfigurationDefinition(Subject subject, int packageTypeId) { - return configurationManager.getPackageTypeConfigurationDefinition(subject, packageTypeId); - } - - public Configuration translateResourceConfiguration(Subject subject, int resourceId, Configuration configuration, - boolean fromStructured) throws ResourceNotFoundException { - return configurationManager.translateResourceConfiguration(subject, resourceId, configuration, fromStructured); - } - - //CONFIGURATIONMANAGER: END ---------------------------------- - - //CONTENTMANAGER: BEGIN ---------------------------------- - public PackageVersion createPackageVersion(Subject subject, String packageName, int packageTypeId, String version, - Integer architectureId, byte[] packageBytes) { - return contentManager.createPackageVersionWithDisplayVersion(subject, packageName, packageTypeId, version, - null, architectureId, packageBytes); - } - - public PackageVersion createPackageVersionWithDisplayVersion(Subject subject, String packageName, - int packageTypeId, String version, String displayVersion, Integer architectureId, byte[] packageBytes) { - return contentManager.createPackageVersionWithDisplayVersion(subject, packageName, packageTypeId, version, - displayVersion, architectureId, packageBytes); - } - - public void deletePackages(Subject subject, int resourceId, int[] installedPackageIds, String requestNotes) { - contentManager.deletePackages(subject, resourceId, installedPackageIds, requestNotes); - } - - public void deletePackageVersion(Subject subject, int packageVersionId) { - contentManager.deletePackageVersion(subject, packageVersionId); - } - - public void deployPackages(Subject subject, int[] resourceIds, int[] packageVersionIds) { - contentManager.deployPackagesWithNote(subject, resourceIds, packageVersionIds, null); - } - - public void deployPackagesWithNote(Subject subject, int[] resourceIds, int[] packageVersionIds, String requestNotes) { - contentManager.deployPackagesWithNote(subject, resourceIds, packageVersionIds, requestNotes); - } - - public List<Architecture> findArchitectures(Subject subject) { - return contentManager.findArchitectures(subject); - } - - public PageList<InstalledPackage> findInstalledPackagesByCriteria(Subject subject, InstalledPackageCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return contentManager.findInstalledPackagesByCriteria(subject, criteria); - } - - public List<PackageType> findPackageTypes(Subject subject, String resourceTypeName, String pluginName) - throws ResourceTypeNotFoundException { - return contentManager.findPackageTypes(subject, resourceTypeName, pluginName); - } - - public PackageType findPackageType(Subject subject, Integer resourceTypeId, String packageTypeName) { - return contentManager.findPackageType(subject, resourceTypeId, packageTypeName); - } - - public PackageTypeAndVersionFormatComposite findPackageTypeWithVersionFormat(Subject subject, - Integer resourceTypeId, String packageTypeName) { - return contentManager.findPackageTypeWithVersionFormat(subject, resourceTypeId, packageTypeName); - } - - public InstalledPackage getBackingPackageForResource(Subject subject, int resourceId) { - return contentManager.getBackingPackageForResource(subject, resourceId); - } - - public byte[] getPackageBytes(Subject subject, int resourceId, int installedPackageId) { - return contentManager.getPackageBytes(subject, resourceId, installedPackageId); - } - - public PageList<Package> findPackagesByCriteria(Subject subject, PackageCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return contentManager.findPackagesByCriteria(subject, criteria); - } - - public PageList<PackageAndLatestVersionComposite> findPackagesWithLatestVersion(Subject subject, - PackageCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return contentManager.findPackagesWithLatestVersion(subject, criteria); - } - - //CONTENTMANAGER: END ---------------------------------- - - // //DATAACCESSMANAGER: BEGIN ---------------------------------- - // public List<Object[]> executeQuery(Subject subject, String query) { - // return dataAccessManager.executeQuery(subject, query); - // } - // - // public List<Object[]> executeQueryWithPageControl(Subject subject, String query, PageControl pageControl) { - // return dataAccessManager.executeQueryWithPageControl(subject, query, pageControl); - // } - - //DATAACCESSMANAGER: END ---------------------------------- - - //DISCOVERYBOSS: BEGIN ------------------------------------ - public void ignoreResources(Subject subject, int[] resourceIds) { - discoveryBoss.ignoreResources(subject, resourceIds); - } - - public void importResources(Subject subject, int[] resourceIds) { - discoveryBoss.importResources(subject, resourceIds); - } - - public void unignoreResources(Subject subject, int[] resourceIds) { - discoveryBoss.unignoreResources(subject, resourceIds); - } - - public Resource manuallyAddResource(Subject subject, int resourceTypeId, int parentResourceId, - Configuration pluginConfiguration) throws Exception { - return discoveryBoss.manuallyAddResource(subject, resourceTypeId, parentResourceId, pluginConfiguration); - } - - //DISCOVERYBOSS: END ------------------------------------ - - //EVENTMANAGER: BEGIN ---------------------------------- - public PageList<Event> findEventsByCriteria(Subject subject, EventCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return eventManager.findEventsByCriteria(subject, criteria); - } - - public EventSeverity[] getSeverityBuckets(Subject subject, int resourceId, long begin, long end, int numBuckets) { - return eventManager.getSeverityBuckets(subject, resourceId, begin, end, numBuckets); - } - - public EventSeverity[] getSeverityBucketsForAutoGroup(Subject subject, int parentResourceId, int resourceTypeId, - long begin, long end, int numBuckets) { - return eventManager.getSeverityBucketsForAutoGroup(subject, parentResourceId, resourceTypeId, begin, end, - numBuckets); - } - - public EventSeverity[] getSeverityBucketsForCompGroup(Subject subject, int resourceGroupId, long begin, long end, - int numBuckets) { - return eventManager.getSeverityBucketsForCompGroup(subject, resourceGroupId, begin, end, numBuckets); - } - - //EVENTMANAGER: END ---------------------------------- - - //MEASUREMENTBASELINEMANAGER: BEGIN ---------------------------------- - public List<MeasurementBaseline> findBaselinesForResource(Subject subject, int resourceId) { - return measurementBaselineManager.findBaselinesForResource(subject, resourceId); - } - - //MEASUREMENTBASELINEMANAGER: END ---------------------------------- - - //MEASUREMENTDATAMANAGER: BEGIN ---------------------------------- - public List<MeasurementDataTrait> findCurrentTraitsForResource(Subject subject, int resourceId, - DisplayType displayType) { - return measurementDataManager.findCurrentTraitsForResource(subject, resourceId, displayType); - } - - public List<List<MeasurementDataNumericHighLowComposite>> findDataForCompatibleGroup(Subject subject, int groupId, - int definitionId, long beginTime, long endTime, int numPoints) { - return measurementDataManager.findDataForCompatibleGroup(subject, groupId, definitionId, beginTime, endTime, - numPoints); - } - - public List<List<MeasurementDataNumericHighLowComposite>> findDataForResource(Subject subject, int resourceId, - int[] definitionIds, long beginTime, long endTime, int numPoints) { - return measurementDataManager.findDataForResource(subject, resourceId, definitionIds, beginTime, endTime, - numPoints); - } - - public Set<MeasurementData> findLiveData(Subject subject, int resourceId, int[] definitionIds) { - return measurementDataManager.findLiveData(subject, resourceId, definitionIds); - } - - public Set<MeasurementData> findLiveDataForGroup(Subject subject, int groupId, int[] resourceId, int[] definitionIds) { - return measurementDataManager.findLiveDataForGroup(subject, groupId, resourceId, definitionIds); - } - - public List<MeasurementDataTrait> findTraits(Subject subject, int resourceId, int definitionId) { - return measurementDataManager.findTraits(subject, resourceId, definitionId); - } - - public MeasurementAggregate getAggregate(Subject subject, int scheduleId, long startTime, long endTime) { - return measurementDataManager.getAggregate(subject, scheduleId, startTime, endTime); - } - - public PageList<MeasurementDataTrait> findTraitsByCriteria(Subject subject, MeasurementDataTraitCriteria criteria) { - return measurementDataManager.findTraitsByCriteria(subject, criteria); - } - - //MEASUREMENTDATAMANAGER: END ---------------------------------- - - //MEASUREMENTDEFINITIONMANAGER: BEGIN ---------------------------------- - public PageList<MeasurementDefinition> findMeasurementDefinitionsByCriteria(Subject subject, - MeasurementDefinitionCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return measurementDefinitionManager.findMeasurementDefinitionsByCriteria(subject, criteria); - } - - public MeasurementDefinition getMeasurementDefinition(Subject subject, int definitionId) { - return measurementDefinitionManager.getMeasurementDefinition(subject, definitionId); - } - - //MEASUREMENTDEFINITIONMANAGER: END ---------------------------------- - - //MEASUREMENTPROBLEMMANAGER: BEGIN ---------------------------------- - public PageList<ProblemResourceComposite> findProblemResources(Subject subject, long oldestDate, PageControl pc) { - return measurementProblemManager.findProblemResources(subject, oldestDate, pc); - } - - //MEASUREMENTPROBLEMMANAGER: END ---------------------------------- - - //MEASUREMENTSCHEDULEMANAGER: BEGIN ---------------------------------- - public void disableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds) { - measurementScheduleManager.disableSchedulesForResource(subject, resourceId, measurementDefinitionIds); - } - - public void disableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds) { - measurementScheduleManager.disableSchedulesForCompatibleGroup(subject, groupId, measurementDefinitionIds); - } - - public void disableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds) { - measurementScheduleManager.disableMeasurementTemplates(subject, measurementDefinitionIds); - } - - public void enableSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds) { - measurementScheduleManager.enableSchedulesForResource(subject, resourceId, measurementDefinitionIds); - } - - public void enableSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds) { - measurementScheduleManager.enableSchedulesForCompatibleGroup(subject, groupId, measurementDefinitionIds); - } - - public void enableMeasurementTemplates(Subject subject, int[] measurementDefinitionIds) { - measurementScheduleManager.enableMeasurementTemplates(subject, measurementDefinitionIds); - } - - public void updateSchedule(Subject subject, MeasurementSchedule schedule) { - measurementScheduleManager.updateSchedule(subject, schedule); - } - - public void updateSchedulesForResource(Subject subject, int resourceId, int[] measurementDefinitionIds, - long collectionInterval) { - measurementScheduleManager.updateSchedulesForResource(subject, resourceId, measurementDefinitionIds, - collectionInterval); - } - - public void updateSchedulesForCompatibleGroup(Subject subject, int groupId, int[] measurementDefinitionIds, - long collectionInterval) { - measurementScheduleManager.updateSchedulesForCompatibleGroup(subject, groupId, measurementDefinitionIds, - collectionInterval); - } - - public void updateMeasurementTemplates(Subject subject, int[] measurementDefinitionIds, long collectionInterval) { - measurementScheduleManager.updateMeasurementTemplates(subject, measurementDefinitionIds, collectionInterval); - } - - public PageList<MeasurementSchedule> findSchedulesByCriteria(Subject subject, MeasurementScheduleCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return measurementScheduleManager.findSchedulesByCriteria(subject, criteria); - } - - public void disableSchedulesForResourceType(Subject subject, int[] measurementDefinitionIds, - boolean updateExistingSchedules) { - measurementScheduleManager.disableSchedulesForResourceType(subject, measurementDefinitionIds, - updateExistingSchedules); - } - - public void enableSchedulesForResourceType(Subject subject, int[] measurementDefinitionIds, - boolean updateExistingSchedules) { - measurementScheduleManager.enableSchedulesForResourceType(subject, measurementDefinitionIds, - updateExistingSchedules); - } - - public void updateSchedulesForResourceType(Subject subject, int[] measurementDefinitionIds, - long collectionInterval, boolean updateExistingSchedules) { - measurementScheduleManager.updateSchedulesForResourceType(subject, measurementDefinitionIds, - collectionInterval, updateExistingSchedules); - } - - //MEASUREMENTSCHEDULEMANAGER: END ---------------------------------- - - //OPERATIONMANAGER: BEGIN ---------------------------------- - public void cancelOperationHistory(Subject subject, int operationHistoryId, boolean ignoreAgentErrors) { - operationManager.cancelOperationHistory(subject, operationHistoryId, ignoreAgentErrors); - } - - public void deleteOperationHistory(Subject subject, int operationHistoryId, boolean purgeInProgress) { - operationManager.deleteOperationHistory(subject, operationHistoryId, purgeInProgress); - } - - public PageList<GroupOperationHistory> findGroupOperationHistoriesByCriteria(Subject subject, - GroupOperationHistoryCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return operationManager.findGroupOperationHistoriesByCriteria(subject, criteria); - } - - public List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject, - OperationDefinitionCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return operationManager.findOperationDefinitionsByCriteria(subject, criteria); - } - - public PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject, - ResourceOperationHistoryCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return operationManager.findResourceOperationHistoriesByCriteria(subject, criteria); - } - - public List<GroupOperationSchedule> findScheduledGroupOperations(Subject subject, int groupId) throws Exception { - return operationManager.findScheduledGroupOperations(subject, groupId); - } - - public List<ResourceOperationSchedule> findScheduledResourceOperations(Subject subject, int resourceId) - throws Exception { - return operationManager.findScheduledResourceOperations(subject, resourceId); - } - - public GroupOperationSchedule scheduleGroupOperation(Subject subject, int groupId, int[] executionOrderResourceIds, - boolean haltOnFailure, String operationName, Configuration parameters, long delay, long repeatInterval, - int repeatCount, int timeout, String description) throws ScheduleException { - return operationManager.scheduleGroupOperation(subject, groupId, executionOrderResourceIds, haltOnFailure, - operationName, parameters, delay, repeatInterval, repeatCount, timeout, description); - } - - public ResourceOperationSchedule scheduleResourceOperation(Subject subject, int resourceId, String operationName, - long delay, long repeatInterval, int repeatCount, int timeout,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration parameters, String description) throws ScheduleException { - return operationManager.scheduleResourceOperation(subject, resourceId, operationName, delay, repeatInterval, - repeatCount, timeout, parameters, description); - } - - public void unscheduleGroupOperation(Subject subject, String jobId, int resourceGroupId) throws UnscheduleException { - operationManager.unscheduleGroupOperation(subject, jobId, resourceGroupId); - } - - public void unscheduleResourceOperation(Subject subject, String jobId, int resourceId) throws UnscheduleException { - operationManager.unscheduleResourceOperation(subject, jobId, resourceId); - } - - //OPERATIONMANAGER: END ---------------------------------- - - //REPOMANAGER: BEGIN ---------------------------------- - public void addPackageVersionsToRepo(Subject subject, int repoId, int[] packageVersionIds) { - repoManager.addPackageVersionsToRepo(subject, repoId, packageVersionIds); - } - - public Repo createRepo(Subject subject, Repo repo) throws RepoException { - return repoManager.createRepo(subject, repo); - } - - public void deleteRepo(Subject subject, int repoId) { - repoManager.deleteRepo(subject, repoId); - } - - public PageList<Repo> findRepos(Subject subject, PageControl pc) { - return repoManager.findRepos(subject, pc); - } - - public PageList<Repo> findReposByCriteria(Subject subject, RepoCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return repoManager.findReposByCriteria(subject, criteria); - } - - public PageList<PackageVersion> findPackageVersionsInRepo(Subject subject, int repoId, String filter, PageControl pc) { - return repoManager.findPackageVersionsInRepo(subject, repoId, filter, pc); - } - - public PageList<PackageVersion> findPackageVersionsInRepoByCriteria(Subject subject, PackageVersionCriteria criteria) { - return repoManager.findPackageVersionsInRepoByCriteria(subject, criteria); - } - - public PackageVersion getLatestPackageVersion(Subject subject, int packageId, int repoId) { - return repoManager.getLatestPackageVersion(subject, packageId, repoId); - } - - public boolean deletePackageVersionsFromRepo(Subject subject, int repoId, int[] packageVersionIds) { - return repoManager.deletePackageVersionsFromRepo(subject, repoId, packageVersionIds); - } - - public PageList<Resource> findSubscribedResources(Subject subject, int repoId, PageControl pc) { - return repoManager.findSubscribedResources(subject, repoId, pc); - } - - public List<SubscribedRepo> findSubscriptions(Subject subject, int resourceId) { - return repoManager.findSubscriptions(subject, resourceId); - } - - public Repo getRepo(Subject subject, int repoId) { - return repoManager.getRepo(subject, repoId); - } - - public void subscribeResourceToRepos(Subject subject, int resourceId, int[] repoIds) { - repoManager.subscribeResourceToRepos(subject, resourceId, repoIds); - } - - public void unsubscribeResourceFromRepos(Subject subject, int resourceId, int[] repoIds) { - repoManager.unsubscribeResourceFromRepos(subject, resourceId, repoIds); - } - - public Repo updateRepo(Subject subject, Repo repo) throws RepoException { - return repoManager.updateRepo(subject, repo); - } - - public PageList<PackageVersion> findPackageVersionsByCriteria(Subject subject, PackageVersionCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return repoManager.findPackageVersionsInRepoByCriteria(subject, criteria); - } - - public int synchronizeRepos(Subject subject, int[] repoIds) throws Exception { - return repoManager.synchronizeRepos(subject, repoIds); - } - - public byte[] getPackageVersionBytes(Subject user, int repoId, int packageVersionId) { - return repoManager.getPackageVersionBytes(user, repoId, packageVersionId); - } - - //REPOMANAGER: END ---------------------------------- - - //RESOURCEFACTORYMANAGER: BEGIN ---------------------------------- - public CreateResourceHistory createResource(Subject subject, int parentResourceId, int resourceTypeId, - String resourceName, Configuration pluginConfiguration, Configuration resourceConfiguration) { - return resourceFactoryManager.createResource(subject, parentResourceId, resourceTypeId, resourceName, - pluginConfiguration, resourceConfiguration); - } - - public CreateResourceHistory createResource(Subject subject, int parentResourceId, int resourceTypeId, - String resourceName, Configuration pluginConfiguration, Configuration resourceConfiguration, Integer timeout) { - return resourceFactoryManager.createResource(subject, parentResourceId, resourceTypeId, resourceName, - pluginConfiguration, resourceConfiguration, timeout); - } - - public CreateResourceHistory createPackageBackedResource(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, String packageName, String packageVersion, Integer architectureId,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, byte[] packageBits) { - return resourceFactoryManager.createPackageBackedResource(subject, parentResourceId, newResourceTypeId, - newResourceName, pluginConfiguration, packageName, packageVersion, architectureId, - deploymentTimeConfiguration, packageBits); - } - - public CreateResourceHistory createPackageBackedResource(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, String packageName, String packageVersion, Integer architectureId,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, byte[] packageBits, Integer timeout) { - return resourceFactoryManager.createPackageBackedResource(subject, parentResourceId, newResourceTypeId, - newResourceName, pluginConfiguration, packageName, packageVersion, architectureId, - deploymentTimeConfiguration, packageBits, timeout); - } - - public CreateResourceHistory createPackageBackedResourceViaPackageVersion(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, // - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, int packageVersionId) { - return resourceFactoryManager.createPackageBackedResourceViaPackageVersion(subject, parentResourceId, - newResourceTypeId, newResourceName, pluginConfiguration, deploymentTimeConfiguration, packageVersionId); - } - - public CreateResourceHistory createPackageBackedResourceViaPackageVersion(Subject subject, int parentResourceId, - int newResourceTypeId, String newResourceName,// - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration pluginConfiguration, // - @XmlJavaTypeAdapter(value = ConfigurationAdapter.class)// - Configuration deploymentTimeConfiguration, int packageVersionId, Integer timeout) { - return resourceFactoryManager.createPackageBackedResourceViaPackageVersion(subject, parentResourceId, - newResourceTypeId, newResourceName, pluginConfiguration, deploymentTimeConfiguration, packageVersionId, - timeout); - } - - public DeleteResourceHistory deleteResource(Subject subject, int resourceId) { - return resourceFactoryManager.deleteResource(subject, resourceId); - } - - public List<DeleteResourceHistory> deleteResources(Subject subject, int[] resourceIds) { - return resourceFactoryManager.deleteResources(subject, resourceIds); - } - - public PageList<CreateResourceHistory> findCreateChildResourceHistory(Subject subject, int parentResourceId, - Long beginDate, Long endDate, PageControl pageControl) { - return resourceFactoryManager.findCreateChildResourceHistory(subject, parentResourceId, beginDate, endDate, - pageControl); - } - - public PageList<DeleteResourceHistory> findDeleteChildResourceHistory(Subject subject, int parentResourceId, - Long beginDate, Long endDate, PageControl pageControl) { - return resourceFactoryManager.findDeleteChildResourceHistory(subject, parentResourceId, beginDate, endDate, - pageControl); - } - - //RESOURCEMANAGER: BEGIN ---------------------------------- - - public List<Resource> findResourceLineage(Subject subject, int resourceId) { - return resourceManager.findResourceLineage(subject, resourceId); - } - - @Override - public ResourceAvailabilitySummary getAvailabilitySummary(Subject subject, int resourceId) { - return resourceManager.getAvailabilitySummary(subject, resourceId); - } - - public PageList<Resource> findResourcesByCriteria(Subject subject, ResourceCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return resourceManager.findResourcesByCriteria(subject, criteria); - } - - public PageList<Resource> findChildResources(Subject subject, int resourceId, PageControl pageControl) { - return resourceManager.findChildResources(subject, resourceId, pageControl); - } - - public Resource getParentResource(Subject subject, int resourceId) { - return resourceManager.getParentResource(subject, resourceId); - } - - public ResourceAvailability getLiveResourceAvailability(Subject subject, int resourceId) { - return resourceManager.getLiveResourceAvailability(subject, resourceId); - } - - public Resource getResource(Subject subject, int resourceId) { - return resourceManager.getResource(subject, resourceId); - } - - public Map<Integer, String> getResourcesAncestry(Subject subject, Integer[] resourceIds, - ResourceAncestryFormat format) { - return resourceManager.getResourcesAncestry(subject, resourceIds, format); - } - - public List<Integer> uninventoryResources(Subject subject, int[] resourceIds) { - return resourceManager.uninventoryResources(subject, resourceIds); - } - - public Resource updateResource(Subject subject, Resource resource) { - return resourceManager.updateResource(subject, resource); - } - - public List<Integer> disableResources(Subject subject, int[] resourceIds) { - return resourceManager.disableResources(subject, resourceIds); - } - - public List<Integer> enableResources(Subject subject, int[] resourceIds) { - return resourceManager.enableResources(subject, resourceIds); - } - - //RESOURCEMANAGER: END ---------------------------------- - - //RESOURCEGROUPMANAGER: BEGIN ---------------------------------- - public void addResourcesToGroup(Subject subject, int groupId, int[] resourceIds) { - resourceGroupManager.addResourcesToGroup(subject, groupId, resourceIds); - } - - public ResourceGroup createResourceGroup(Subject subject, // - @XmlJavaTypeAdapter(ResourceGroupAdapter.class) ResourceGroup resourceGroup) { - return resourceGroupManager.createResourceGroup(subject, resourceGroup); - } - - public void deleteResourceGroup(Subject subject, int groupId) throws ResourceGroupNotFoundException, - ResourceGroupDeleteException { - resourceGroupManager.deleteResourceGroup(subject, groupId); - } - - public void deleteResourceGroups(Subject subject, int[] groupIds) throws ResourceGroupNotFoundException, - ResourceGroupDeleteException { - resourceGroupManager.deleteResourceGroups(subject, groupIds); - } - - public PageList<ResourceGroup> findResourceGroupsByCriteria(Subject subject, ResourceGroupCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return resourceGroupManager.findResourceGroupsByCriteria(subject, criteria); - } - - public PageList<ResourceGroup> findResourceGroupsForRole(Subject subject, int roleId, PageControl pc) { - return resourceGroupManager.findResourceGroupsForRole(subject, roleId, pc); - } - - public ResourceGroup getResourceGroup(Subject subject, int groupId) { - return resourceGroupManager.getResourceGroup(subject, groupId); - } - - public ResourceGroupComposite getResourceGroupComposite(Subject subject, int groupId) { - return resourceGroupManager.getResourceGroupComposite(subject, groupId); - } - - public void removeResourcesFromGroup(Subject subject, int groupId, int[] resourceIds) { - resourceGroupManager.removeResourcesFromGroup(subject, groupId, resourceIds); - } - - public void setRecursive(Subject subject, int groupId, boolean isRecursive) { - resourceGroupManager.setRecursive(subject, groupId, isRecursive); - } - - public ResourceGroup updateResourceGroup(Subject subject, ResourceGroup newResourceGroup) { - return resourceGroupManager.updateResourceGroup(subject, newResourceGroup); - } - - //RESOURCEGROUPMANAGER: END ---------------------------------- - - //RESOURCETYPEMANAGER: BEGIN ------------------------------------ - public PageList<ResourceType> findResourceTypesByCriteria(Subject subject, ResourceTypeCriteria criteria) { - return resourceTypeManager.findResourceTypesByCriteria(subject, criteria); - } - - public ResourceType getResourceTypeById(Subject subject, int resourceTypeId) throws ResourceTypeNotFoundException { - return resourceTypeManager.getResourceTypeById(subject, resourceTypeId); - } - - public ResourceType getResourceTypeByNameAndPlugin(Subject subject, String name, String plugin) { - return resourceTypeManager.getResourceTypeByNameAndPlugin(subject, name, plugin); - } - - //RESOURCETYPEMANAGER: END ------------------------------------ - - //ROLEMANAGER: BEGIN ---------------------------------- - public void addResourceGroupsToRole(Subject subject, int roleId, int[] pendingGroupIds) { - roleManager.addResourceGroupsToRole(subject, roleId, pendingGroupIds); - } - - public void addRolesToResourceGroup(Subject subject, int groupId, int[] roleIds) { - roleManager.addRolesToResourceGroup(subject, groupId, roleIds); - } - - public void addRolesToSubject(Subject subject, int subjectId, int[] roleIds) { - roleManager.addRolesToSubject(subject, subjectId, roleIds); - } - - public void addSubjectsToRole(Subject subject, int roleId, int[] subjectIds) { - roleManager.addSubjectsToRole(subject, roleId, subjectIds); - } - - public void setAssignedSubjectRoles(Subject subject, int subjectId, int[] roleIds) { - roleManager.setAssignedSubjectRoles(subject, subjectId, roleIds); - } - - public PageList<Role> findRolesByCriteria(Subject subject, RoleCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return roleManager.findRolesByCriteria(subject, criteria); - } - - public PageList<Role> findSubjectAssignedRoles(Subject subject, int subjectId, PageControl pc) { - return roleManager.findSubjectAssignedRoles(subject, subjectId, pc); - } - - public PageList<Role> findSubjectUnassignedRoles(Subject subject, int subjectId, PageControl pc) { - return roleManager.findSubjectUnassignedRoles(subject, subjectId, pc); - } - - public Role getRole(Subject subject, int roleId) { - return roleManager.getRole(subject, roleId); - } - - public Role createRole(Subject subject, Role newRole) { - return roleManager.createRole(subject, newRole); - } - - public void deleteRoles(Subject subject, int[] roleIds) { - roleManager.deleteRoles(subject, roleIds); - } - - public Role updateRole(Subject subject, Role role) { - return roleManager.updateRole(subject, role); - } - - public void removeResourceGroupsFromRole(Subject subject, int roleId, int[] groupIds) { - roleManager.removeResourceGroupsFromRole(subject, roleId, groupIds); - } - - public void removeRolesFromResourceGroup(Subject subject, int groupId, int[] roleIds) { - roleManager.removeRolesFromResourceGroup(subject, groupId, roleIds); - } - - public void removeRolesFromSubject(Subject subject, int subjectId, int[] roleIds) { - roleManager.removeRolesFromSubject(subject, subjectId, roleIds); - } - - public void removeSubjectsFromRole(Subject subject, int roleId, int[] subjectIds) { - roleManager.removeSubjectsFromRole(subject, roleId, subjectIds); - } - - public void setAssignedResourceGroups(Subject subject, int roleId, int[] groupIds) { - roleManager.setAssignedResourceGroups(subject, roleId, groupIds); - } - - //ROLEMANAGER: END ---------------------------------- - - //SUBJECT MANAGER: BEGIN --------------------------------------- - public void changePassword(Subject subject, String username, String password) { - subjectManager.changePassword(subject, username, password); - } - - public void createPrincipal(Subject subject, String username, String password) throws SubjectException { - subjectManager.createPrincipal(subject, username, password); - } - - public Subject createSubject(Subject subject, Subject subjectToCreate) throws SubjectException { - return subjectManager.createSubject(subject, subjectToCreate); - } - - public void deleteSubjects(Subject subject, int[] subjectIds) { - subjectManager.deleteSubjects(subject, subjectIds); - } - - public PageList<Subject> findSubjectsByCriteria(Subject subject, SubjectCriteria criteria) { - checkParametersPassedIn(subject, criteria); - return subjectManager.findSubjectsByCriteria(subject, criteria); - } - - public Subject getSubjectByName(String username) { - return subjectManager.getSubjectByName(username); - } - - public Subject getSubjectByNameAndSessionId(String username, int sessionId) throws Exception { - return subjectManager.getSubjectByNameAndSessionId(username, sessionId); - } - - public Subject login(String username, String password) throws LoginException { - return subjectManager.login(username, password); - } - - public void logout(Subject subject) { - subjectManager.logout(subject); - } - - public Subject updateSubject(Subject subject, Subject subjectToModify) { - return subjectManager.updateSubject(subject, subjectToModify); - } - - //SUBJECTMANAGER: END ------------------------------------ - - //SUPPORTMANAGER: BEGIN ------------------------------------ - public URL getSnapshotReport(Subject subject, int resourceId, String name, String description) throws Exception { - return supportManager.getSnapshotReport(subject, resourceId, name, description); - } - - //SUPPORTMANAGER: END ------------------------------------ - - //SYSTEMMANAGER: BEGIN ------------------------------------ - - public ProductInfo getProductInfo(Subject subject) { - return systemManager.getProductInfo(subject); - } - - public ServerDetails getServerDetails(Subject subject) { - return systemManager.getServerDetails(subject); - } - - public Properties getSystemConfiguration(Subject subject) { - return systemManager.getSystemConfiguration(subject); - } - - public void setSystemConfiguration(Subject subject, Properties properties, boolean skipValidation) throws Exception { - systemManager.setSystemConfiguration(subject, properties, skipValidation); - } - - public SystemSettings getSystemSettings(Subject subject) { - return systemManager.getSystemSettings(subject); - } - - public void setSystemSettings(Subject subject, SystemSettings settings) throws Exception { - systemManager.setSystemSettings(subject, settings); - } - - //SYSTEMMANAGER: END ------------------------------------ - - //SYNCHRONIZATIONMANANGER: BEGIN ------------------------- - - public ExportReport exportAllSubsystems(Subject subject) { - return synchronizationManager.exportAllSubsystems(subject); - } - - public void validate(Subject subject, byte[] exportFile) throws ValidationException { - synchronizationManager.validate(subject, exportFile); - } - - public List<ImportConfigurationDefinition> getImportConfigurationDefinitionOfAllSynchronizers() { - return synchronizationManager.getImportConfigurationDefinitionOfAllSynchronizers(); - } - - public ImportConfigurationDefinition getImportConfigurationDefinition(String importerClass) { - return synchronizationManager.getImportConfigurationDefinition(importerClass); - } - - public ImportReport importAllSubsystems(Subject subject, byte[] exportFile, - List<ImportConfiguration> importerConfigurations) throws ValidationException, ImportException { - return synchronizationManager.importAllSubsystems(subject, exportFile, importerConfigurations); - } - - //SYNCHRONIZATIONMANANGER: END ------------------------- - private void checkParametersPassedIn(Subject subject, Criteria criteria) { - if (subject == null) { - throw new IllegalArgumentException("Subject cannot be null."); - } - if (criteria == null) { - throw new IllegalArgumentException("Criteria cannot be null."); - } - } - -} diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesRemote.java deleted file mode 100644 index 410276c..0000000 --- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/webservices/WebservicesRemote.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.rhq.enterprise.server.webservices; - -import javax.ejb.Remote; -import javax.jws.WebService; -import javax.jws.soap.SOAPBinding; - -import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote; -import org.rhq.enterprise.server.alert.AlertManagerRemote; -import org.rhq.enterprise.server.auth.SubjectManagerRemote; -import org.rhq.enterprise.server.authz.RoleManagerRemote; -import org.rhq.enterprise.server.bundle.BundleManagerRemote; -import org.rhq.enterprise.server.configuration.ConfigurationManagerRemote; -import org.rhq.enterprise.server.content.ContentManagerRemote; -import org.rhq.enterprise.server.content.RepoManagerRemote; -import org.rhq.enterprise.server.discovery.DiscoveryBossRemote; -import org.rhq.enterprise.server.drift.DriftManagerRemote; -import org.rhq.enterprise.server.event.EventManagerRemote; -import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote; -import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote; -import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote; -import org.rhq.enterprise.server.measurement.MeasurementDataManagerRemote; -import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerRemote; -import org.rhq.enterprise.server.measurement.MeasurementProblemManagerRemote; -import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerRemote; -import org.rhq.enterprise.server.operation.OperationManagerRemote; -import org.rhq.enterprise.server.resource.ResourceFactoryManagerRemote; -import org.rhq.enterprise.server.resource.ResourceManagerRemote; -import org.rhq.enterprise.server.resource.ResourceTypeManagerRemote; -import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote; -import org.rhq.enterprise.server.support.SupportManagerRemote; -import org.rhq.enterprise.server.sync.SynchronizationManagerRemote; -import org.rhq.enterprise.server.system.ServerVersion; -import org.rhq.enterprise.server.system.SystemManagerRemote; - -/** - * The remote API supported by a WebService Interface. - * - * @author jay shaughnessy - * - */ -@SOAPBinding(style = SOAPBinding.Style.DOCUMENT) -@WebService(targetNamespace = ServerVersion.namespace) -@Remote -public interface WebservicesRemote extends // - AlertManagerRemote, // - AlertDefinitionManagerRemote, // - AvailabilityManagerRemote,// - BundleManagerRemote,// - CallTimeDataManagerRemote,// - RepoManagerRemote,// - ConfigurationManagerRemote,// - ContentManagerRemote,// - //Removed as it was problematic for WS clients. Not sure if this well be re-enabled. - // DataAccessManagerRemote,// - DiscoveryBossRemote,// - EventManagerRemote,// - MeasurementBaselineManagerRemote,// - MeasurementDataManagerRemote,// - MeasurementDefinitionManagerRemote,// - MeasurementProblemManagerRemote,// - MeasurementScheduleManagerRemote,// - OperationManagerRemote,// - ResourceFactoryManagerRemote,// - ResourceGroupManagerRemote,// - ResourceManagerRemote,// - ResourceTypeManagerRemote,// - RoleManagerRemote,// - SubjectManagerRemote,// - SupportManagerRemote,// - SystemManagerRemote, - SynchronizationManagerRemote { -} diff --git a/modules/enterprise/server/safe-invoker/pom.xml b/modules/enterprise/server/safe-invoker/pom.xml index 6c0d86d..f1cccf2 100644 --- a/modules/enterprise/server/safe-invoker/pom.xml +++ b/modules/enterprise/server/safe-invoker/pom.xml @@ -13,24 +13,12 @@ <artifactId>safe-invoker</artifactId> <packaging>jar</packaging>
- <name>RHQ Enterprise Safe WebService Invoker</name> - <description>A webservice invoker that safely calls returns ejb3 pojo's with lazy attributes</description> + <name>RHQ Enterprise Safe Invoker</name> + <description>TODO: Remove this invoker and move HibernateDetachUtility</description>
<dependencies>
<dependency> - <groupId>org.jboss.jbossws</groupId> - <artifactId>jbossws-native-core</artifactId> - <version>${jbossws-native-dist.version}</version> - </dependency> - - <dependency> - <groupId>org.jboss</groupId> - <artifactId>jbossws-spi</artifactId> - <version>1.1.1.GA</version> - </dependency> - - <dependency> <groupId>hibernate</groupId> <artifactId>hibernate3</artifactId> <!-- NOTE: The version is defined in the root POM's dependencyManagement section. --> diff --git a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvoker.java b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvoker.java deleted file mode 100644 index b236f5f..0000000 --- a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvoker.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.safeinvoker; - -import java.lang.reflect.Method; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.jboss.ws.core.EndpointInvocation; -import org.jboss.ws.core.server.ServiceEndpointInvoker; -import org.jboss.wsf.spi.invocation.InvocationContext; - -/** - * This invoker will take an uninitialized relationships or references from EJB3 pojo's and null them out so that we can - * pass them as normal objects to the webservice binding layer. (Avoiding LazyInitializationExceptions) - * - * @author Greg Hinkle - */ -public class EJB3SafeEndpointInvoker extends ServiceEndpointInvoker { - private static final Log LOG = LogFactory.getLog(EJB3SafeEndpointInvoker.class); - - @Override - public void invoke(InvocationContext invocationContext) throws Exception { - super.invoke(invocationContext); - EndpointInvocation inv = invocationContext.getAttachment(EndpointInvocation.class); - Object value = inv.getReturnValue(); - if (value != null) { - try { - Method m = value.getClass().getMethod("getReturn"); - if (m != null) { - HibernateDetachUtility.nullOutUninitializedFields(value, - HibernateDetachUtility.SerializationType.JAXB); - } - - inv.setReturnValue(value); - } catch (NoSuchMethodException nsme) { - // Expected for void return types - } - } - } -} \ No newline at end of file diff --git a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvokerDeploymentAspect.java b/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvokerDeploymentAspect.java deleted file mode 100644 index 9dd0264..0000000 --- a/modules/enterprise/server/safe-invoker/src/main/java/org/rhq/enterprise/server/safeinvoker/EJB3SafeEndpointInvokerDeploymentAspect.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * RHQ Management Platform - * Copyright (C) 2005-2008 Red Hat, Inc. - * All rights reserved. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation version 2 of the License. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ -package org.rhq.enterprise.server.safeinvoker; - -import java.util.Iterator; - -import org.jboss.ws.core.server.ServiceEndpointInvoker; -import org.jboss.ws.core.server.ServiceEndpointInvokerEJB21; -import org.jboss.wsf.spi.deployment.Deployment; -import org.jboss.wsf.spi.deployment.DeploymentAspect; -import org.jboss.wsf.spi.deployment.Endpoint; - -/** - * This class installs the EJB3SafeEndpointInvoker into the deployment aspect for the endpoint. - * - * @author Greg Hinkle - */ -public class EJB3SafeEndpointInvokerDeploymentAspect extends DeploymentAspect { - @Override - public void start(Deployment dep) { - Iterator i$ = dep.getService().getEndpoints().iterator(); - do { - if (!i$.hasNext()) { - break; - } - - Endpoint ep = (Endpoint) i$.next(); - ServiceEndpointInvoker epInvoker = ep.getAttachment(ServiceEndpointInvoker.class); - if (epInvoker == null) { - org.jboss.wsf.spi.deployment.Deployment.DeploymentType depType = ep.getService().getDeployment() - .getType(); - if (depType == org.jboss.wsf.spi.deployment.Deployment.DeploymentType.JAXRPC_EJB21) { - epInvoker = new ServiceEndpointInvokerEJB21(); - } else { - epInvoker = new EJB3SafeEndpointInvoker(); - } - - ep.addAttachment(org.jboss.ws.core.server.ServiceEndpointInvoker.class, epInvoker); - epInvoker.init(ep); - } - } while (true); - } -} \ No newline at end of file diff --git a/pom.xml b/pom.xml index f6bd80d..eedd32b 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,6 @@ <jboss-remoting.version>2.2.2.SP8</jboss-remoting.version> <jboss-serialization.version>1.0.3.GA</jboss-serialization.version> <jboss-javassist.version>3.9.0.GA</jboss-javassist.version> - <jbossws-native-dist.version>3.1.1.GA</jbossws-native-dist.version> <!-- End: JBoss AS Dependency Versions -->
<commons-logging.version>1.1.0.jboss</commons-logging.version> @@ -199,13 +198,6 @@ <type>zip</type> </dependency>
- <dependency> - <groupId>org.jboss.jbossws</groupId> - <artifactId>jbossws-native-dist</artifactId> - <version>${jbossws-native-dist.version}</version> - <type>zip</type> - </dependency> - <dependency> <groupId>jboss</groupId> <artifactId>jboss-all-client</artifactId>
rhq-commits@lists.fedorahosted.org