[rhq] Branch 'rhq-on-as7' - modules/common modules/enterprise
by mazz
modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SocketBindingJBossASClient.java | 166 ++++++++++
modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java | 7
modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java | 67 ++++
modules/enterprise/server/appserver/src/main/scripts/rhq-container.build.xml | 35 +-
4 files changed, 261 insertions(+), 14 deletions(-)
New commits:
commit cf4b61137ffc434db9243bca6a24f7a284f5dd92
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Sep 25 14:03:26 2012 -0400
set the ports as defined in rhq-server.properties
diff --git a/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SocketBindingJBossASClient.java b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SocketBindingJBossASClient.java
new file mode 100644
index 0000000..247eefe
--- /dev/null
+++ b/modules/common/jboss-as-dmr-client/src/main/java/org/rhq/common/jbossas/client/controller/SocketBindingJBossASClient.java
@@ -0,0 +1,166 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 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.common.jbossas.client.controller;
+
+import org.jboss.as.controller.client.ModelControllerClient;
+import org.jboss.dmr.ModelNode;
+
+/**
+ * Provides convenience methods associated with socket binding management.
+ *
+ * @author John Mazzitelli
+ */
+public class SocketBindingJBossASClient extends JBossASClient {
+
+ public static final String SOCKET_BINDING_GROUP = "socket-binding-group";
+ public static final String SOCKET_BINDING = "socket-binding";
+ public static final String PORT = "port";
+ public static final String PORT_OFFSET = "port-offset";
+ public static final String STANDARD_SOCKETS = "standard-sockets";
+ public static final String JBOSS_SYSPROP_PORT_OFFSET = "jboss.socket.binding.port-offset";
+ public static final String DEFAULT_BINDING_MGMT_NATIVE = "management-native";
+ public static final String DEFAULT_BINDING_MGMT_HTTP = "management-http";
+ public static final String DEFAULT_BINDING_MGMT_HTTPS = "management-https";
+ public static final String DEFAULT_BINDING_AJP = "ajp";
+ public static final String DEFAULT_BINDING_HTTP = "http";
+ public static final String DEFAULT_BINDING_HTTPS = "https";
+ public static final String DEFAULT_BINDING_JACORB = "jacorb";
+ public static final String DEFAULT_BINDING_JACORB_SSL = "jacorb-ssl";
+ public static final String DEFAULT_BINDING_MESSAGING = "messaging";
+ public static final String DEFAULT_BINDING_MESSAGING_THRUPUT = "messaging-throughput";
+ public static final String DEFAULT_BINDING_OSGI_HTTP = "osgi-http";
+ public static final String DEFAULT_BINDING_REMOTING = "remoting";
+ public static final String DEFAULT_BINDING_TXN_RECOVERY_ENV = "txn-recovery-environment";
+ public static final String DEFAULT_BINDING_TXN_STATUS_MGR = "txn-status-manager";
+
+ public SocketBindingJBossASClient(ModelControllerClient client) {
+ super(client);
+ }
+
+ /**
+ * Sets the port offset for the socket bindings found in the standard socket binding group.
+ * This will configure the offset to be allowed to be overridden by the standard
+ * {@link #JBOSS_SYSPROP_PORT_OFFSET} system property.
+ *
+ * @param offset the new port offset
+ * @throws Exception
+ */
+ public void setStandardPortOffset(int offset) throws Exception {
+ setPortOffset(STANDARD_SOCKETS, JBOSS_SYSPROP_PORT_OFFSET, offset);
+ }
+
+ /**
+ * Sets the port offset for the socket bindings found in the named socket binding group.
+ * If sysPropName is null, this simply sets the offset explicitly to the given offset.
+ * If sysPropName is not null, this sets the offset to the expression "${sysPropName:offset}".
+ * You typically will want to use the standard {@link #JBOSS_SYSPROP_PORT_OFFSET} system property
+ * name as the sysPropName to follow the normal out-of-box JBossAS configuration, though you don't have to.
+ *
+ * @param socketBindingGroupName name of the socket binding group whose port offset is to be set
+ * @param sysPropName the name of the system property whose value is to be the port offset
+ * @param offset the default port offset if the sysPropName is not defined
+ * @throws Exception
+ */
+ public void setPortOffset(String socketBindingGroupName, String sysPropName, int offset) throws Exception {
+ String offsetValue;
+ if (sysPropName != null) {
+ offsetValue = "${" + sysPropName + ":" + offset + "}";
+ } else {
+ offsetValue = String.valueOf(offset);
+ }
+
+ Address addr = Address.root().add(SOCKET_BINDING_GROUP, socketBindingGroupName);
+ ModelNode request = createWriteAttributeRequest(PORT_OFFSET, offsetValue, addr);
+ ModelNode results = execute(request);
+ if (!isSuccess(results)) {
+ throw new FailureException(results);
+ }
+ return; // everything is OK
+ }
+
+ /**
+ * Sets the port number for the named standard socket binding.
+ *
+ * @param socketBindingName the name of the standard socket binding whose port is to be set
+ * @param port the new port number
+ * @throws Exception
+ */
+ public void setStandardSocketBindingPort(String socketBindingName, int port) throws Exception {
+ setStandardSocketBindingPortExpression(socketBindingName, null, port);
+ }
+
+ /**
+ * Sets the port number for the named standard socket binding.
+ * If sysPropName is null, this simply sets the port number explicitly to the given port number.
+ * If sysPropName is not null, this sets the port to the expression "${sysPropName:port}".
+ *
+ * @param socketBindingName the name of the standard socket binding whose port is to be set
+ * @param sysPropName the name of the system property whose value is to be the port number
+ * @param port the default port number if the sysPropName is not defined
+ * @throws Exception
+ */
+ public void setStandardSocketBindingPortExpression(String socketBindingName, String sysPropName, int port)
+ throws Exception {
+ setSocketBindingPortExpression(STANDARD_SOCKETS, socketBindingName, sysPropName, port);
+ }
+
+ /**
+ * Sets the port number for the named socket binding found in the named socket binding group.
+ *
+ * @param socketBindingGroupName the name of the socket binding group that has the named socket binding
+ * @param socketBindingName the name of the socket binding whose port is to be set
+ * @param port the new port number
+ * @throws Exception
+ */
+ public void setSocketBindingPort(String socketBindingGroupName, String socketBindingName, int port)
+ throws Exception {
+ setSocketBindingPortExpression(socketBindingGroupName, socketBindingName, null, port);
+ }
+
+ /**
+ * Sets the port number for the named socket binding found in the named socket binding group.
+ * If sysPropName is null, this simply sets the port number explicitly to the given port number.
+ * If sysPropName is not null, this sets the port to the expression "${sysPropName:port}".
+ *
+ * @param socketBindingGroupName the name of the socket binding group that has the named socket binding
+ * @param socketBindingName the name of the socket binding whose port is to be set
+ * @param sysPropName the name of the system property whose value is to be the port number
+ * @param port the default port number if the sysPropName is not defined
+ * @throws Exception
+ */
+ public void setSocketBindingPortExpression(String socketBindingGroupName, String socketBindingName,
+ String sysPropName, int port) throws Exception {
+
+ String portValue;
+ if (sysPropName != null) {
+ portValue = "${" + sysPropName + ":" + port + "}";
+ } else {
+ portValue = String.valueOf(port);
+ }
+
+ Address addr = Address.root().add(SOCKET_BINDING_GROUP, socketBindingGroupName, SOCKET_BINDING,
+ socketBindingName);
+ ModelNode request = createWriteAttributeRequest(PORT, portValue, addr);
+ ModelNode results = execute(request);
+ if (!isSuccess(results)) {
+ throw new FailureException(results);
+ }
+ return; // everything is OK
+ }
+}
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
index e285655..9c0f871 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/InstallerGWTServiceImpl.java
@@ -331,10 +331,15 @@ public class InstallerGWTServiceImpl extends RemoteServiceServlet implements Ins
// create a keystore whose cert has a CN of this server's public endpoint address
ServerInstallUtil.createKeystore(serverDetails, getAppServerConfigDir());
- // Make sure our deployment scanner is configured to be ready for deploy our services and application
+ // perform stuff that has to get done via the JBossAS management client
ModelControllerClient mcc = null;
try {
mcc = getModelControllerClient();
+
+ // ensure the server info is up to date and stored in the DB
+ ServerInstallUtil.setSocketBindings(mcc, serverProperties);
+
+ // Make sure our deployment scanner is configured to be ready for deploy our services and application
ServerInstallUtil.configureDeploymentScanner(mcc);
} finally {
safeClose(mcc);
diff --git a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java
index 1fc4388..aa3faff 100644
--- a/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java
+++ b/modules/enterprise/gui/installer/src/main/java/org/rhq/enterprise/gui/installer/server/servlet/ServerInstallUtil.java
@@ -54,6 +54,7 @@ import org.rhq.common.jbossas.client.controller.InfinispanJBossASClient;
import org.rhq.common.jbossas.client.controller.JBossASClient;
import org.rhq.common.jbossas.client.controller.MessagingJBossASClient;
import org.rhq.common.jbossas.client.controller.SecurityDomainJBossASClient;
+import org.rhq.common.jbossas.client.controller.SocketBindingJBossASClient;
import org.rhq.core.db.DatabaseType;
import org.rhq.core.db.DatabaseTypeFactory;
import org.rhq.core.db.DbUtil;
@@ -97,6 +98,53 @@ public class ServerInstallUtil {
}
}
+ private static class SocketBindingInfo {
+ public String name;
+ public String sysprop;
+ public int port;
+
+ public SocketBindingInfo(String n, String s, int p) {
+ name = n;
+ sysprop = s;
+ port = p;
+ }
+ }
+
+ private static final ArrayList<SocketBindingInfo> defaultSocketBindings;
+ static {
+ // all ports are -1000 from out-of-box AS7 defaults
+ // except for the jboss.management ones - those are -3000 from their out-of-box defaults
+ defaultSocketBindings = new ArrayList<SocketBindingInfo>();
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_AJP,
+ "rhq.server.socket.binding.port.ajp", 7009));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_HTTP,
+ "rhq.server.socket.binding.port.http", 7080));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_HTTPS,
+ "rhq.server.socket.binding.port.https", 7443));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_JACORB,
+ "rhq.server.socket.binding.port.jacorb", 2528));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_JACORB_SSL,
+ "rhq.server.socket.binding.port.jacorb-ssl", 2529));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_MESSAGING,
+ "rhq.server.socket.binding.port.messaging", 4445));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_MESSAGING_THRUPUT,
+ "rhq.server.socket.binding.port.messaging-throughput", 4455));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_MGMT_HTTP,
+ "jboss.management.http.port", 6990));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_MGMT_HTTPS,
+ "jboss.management.https.port", 6443));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_MGMT_NATIVE,
+ "jboss.management.native.port", 6999));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_OSGI_HTTP,
+ "rhq.server.socket.binding.port.osgi-http", 7090));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_REMOTING,
+ "rhq.server.socket.binding.port.remoting", 3447));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_TXN_RECOVERY_ENV,
+ "rhq.server.socket.binding.port.txn-recovery-environment", 3712));
+ defaultSocketBindings.add(new SocketBindingInfo(SocketBindingJBossASClient.DEFAULT_BINDING_TXN_STATUS_MGR,
+ "rhq.server.socket.binding.port.txn-status-manager", 3713));
+ }
+
private static final String RHQ_DATASOURCE_NAME_NOTX = "NoTxRHQDS";
private static final String RHQ_DATASOURCE_NAME_XA = "RHQDS";
private static final String RHQ_DS_SECURITY_DOMAIN = "RHQDSSecurityDomain";
@@ -1203,4 +1251,23 @@ public class ServerInstallUtil {
return markerFile.exists();
}
+ public static void setSocketBindings(ModelControllerClient mcc, HashMap<String, String> serverProperties)
+ throws Exception {
+ final SocketBindingJBossASClient client = new SocketBindingJBossASClient(mcc);
+ for (SocketBindingInfo binding : defaultSocketBindings) {
+ // use the port defined by the server's properties if set, otherwise, just use our hardcoded default
+ int newPort = binding.port;
+ String overrideValue = serverProperties.get(binding.sysprop);
+ if (overrideValue != null) {
+ try {
+ newPort = Integer.parseInt(overrideValue);
+ } catch (Exception e) {
+ LOG.warn("Invalid port in system property [" + binding.sysprop + "]: " + overrideValue);
+ }
+ }
+ LOG.info(String.format("Setting socket binding [%s] to [${%s:%d}]", binding.name, binding.sysprop, newPort));
+ client.setStandardSocketBindingPortExpression(binding.name, binding.sysprop, newPort);
+ }
+ }
+
}
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 9bca2a2..f060121 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
@@ -356,29 +356,38 @@ rhq.server.quartz.driverDelegateClass=${rhq.server.quartz.driverDelegateClass}
rhq.server.quartz.selectWithLockSQL=${rhq.server.quartz.selectWithLockSQL}
rhq.server.quartz.lockHandlerClass=${rhq.server.quartz.lockHandlerClass}
-# Container configuration
+# Host and Port Bindings
+jboss.bind.address=0.0.0.0
+jboss.bind.address.management=127.0.0.1
+
+jboss.socket.binding.port-offset=0
+
+jboss.management.native.port=6999
+jboss.management.http.port=6990
+jboss.management.https.port=6443
+
+rhq.server.socket.binding.port.ajp=7009
+rhq.server.socket.binding.port.http=7080
+rhq.server.socket.binding.port.https=7443
+rhq.server.socket.binding.port.jacorb=2528
+rhq.server.socket.binding.port.jacorb-ssl=2529
+rhq.server.socket.binding.port.messaging=4445
+rhq.server.socket.binding.port.messaging-throughput=4455
+rhq.server.socket.binding.port.osgi-http=7090
+rhq.server.socket.binding.port.remoting=3447
+rhq.server.socket.binding.port.txn-recovery-environment=3712
+rhq.server.socket.binding.port.txn-status-manager=3713
+
# ********************************** NOTE ************************************
# If the jboss.bind.address property is set to anything besides 0.0.0.0,
# uncomment the java.rmi.server.hostname property below and set it to the same
# value - setting it to ${jboss.bind.address} will *not* work.
-jboss.bind.address=0.0.0.0
#java.rmi.server.hostname=0.0.0.0
# High Availability (HA)
rhq.server.high-availability.name=
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.namingservice.port=2099
-rhq.server.startup.namingservice.rmiport=2098
-rhq.server.startup.jrmpinvoker.rmiport=7444
-rhq.server.startup.pooledinvoker.rmiport=7445
-rhq.server.startup.ajp.port=9009
-rhq.server.startup.unifiedinvoker.port=5446
-rhq.server.startup.aspectdeployer.bind-port=4873
-
# RHQ Server's remote endpoint for agents to talk to
# bind-address and bind-port are derived from the HA server definition,
# if you set the address/port here, they will override the HA server definition found in the database
11 years, 7 months
[rhq] Branch 'rhq-on-as7' - modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
New commits:
commit 5aa21072c5a9102e87d376aefae15888315aee2b
Author: Jay Shaughnessy <jshaughn(a)jshaughn.csb>
Date: Tue Sep 25 12:12:48 2012 -0400
Play with fire, get burned. Fix usage of internal hibernate methods.
All test pages are rendering and most options are working, including
all of the options that seem important to me.
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp
index c81d8bd..200d0a6 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp
@@ -110,14 +110,14 @@
System.out.println("hql: " + hql);
List<String> sqlStrings = null;
Set<String> parameterNames = null;
- try {
+ try {
qt = new ASTQueryTranslatorFactory().createQueryTranslator(
- "test query",
+ "Test Query",
hql,
- null,
+ new HashMap(),
(SessionFactoryImplementor) s.getSessionFactory());
- qt.compile(null, false);
+ qt.compile(new HashMap(), false);
sqlStrings = qt.collectSqlStrings();
for (String nextSQL : sqlStrings) {
@@ -130,6 +130,8 @@
request.setAttribute("parameterNames", parameterNames);
}
} catch (Exception e) {
+ System.out.println("ERROR in hql: " + hql + " : " + e);
+ e.printStackTrace();
error = getExceptionString(e);
request.setAttribute("error", error);
}
11 years, 7 months
[rhq] Branch 'rhq-on-as7' - modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/portal-war/src/main/webapp/admin/test/browser.jsp | 9 +-
modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp | 8 +-
modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp | 27 ++++----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBeanLocal.java | 28 --------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java | 28 ++++++++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java | 2
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBeanLocal.java | 32 ----------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java | 32 ++++++++++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java | 8 +-
10 files changed, 89 insertions(+), 87 deletions(-)
New commits:
commit 943e4b42715c43b6bcadeb08de136a5185baaed8
Author: Jay Shaughnessy <jshaughn(a)jshaughn.csb>
Date: Tue Sep 25 10:24:03 2012 -0400
- Get Hibernate Test Page to render.
- translation is not yet working.
- Get Entity browser working
- Get Admin Control page rendering
- Rename *TestBeanLocal interfaces to *TestLocal to conform to our naming conventions
such that JNDI lookups work as expected
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/browser.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/browser.jsp
index e379377..fb0fd93 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/browser.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/browser.jsp
@@ -1,6 +1,7 @@
<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
-<%@ page import="org.hibernate.engine.SessionFactoryImplementor" %>
+<%@ page import="org.hibernate.engine.spi.SessionFactoryImplementor" %>
+<%@ page import="org.hibernate.metadata.ClassMetadata" %>
<%@ page import="org.rhq.core.domain.server.PersistenceUtility" %>
<%@ page import="org.rhq.enterprise.gui.legacy.util.SessionUtils" %>
<%@ page import="org.rhq.enterprise.server.util.LookupUtil" %>
@@ -46,8 +47,8 @@
<%
InitialContext ic = new InitialContext();
- EntityManagerFactory emf = (EntityManagerFactory) ic.lookup("java:/RHQEntityManagerFactory");
- EntityManager em = ((EntityManagerFactory) ic.lookup("java:/RHQEntityManagerFactory"))
+ EntityManagerFactory emf = (EntityManagerFactory) ic.lookup("java:jboss/RHQEntityManagerFactory");
+ EntityManager em = ((EntityManagerFactory) ic.lookup("java:jboss/RHQEntityManagerFactory"))
.createEntityManager();
@@ -62,7 +63,7 @@
<%
- Map<String, Object> metadata = sfi.getAllClassMetadata();
+ Map<String, ClassMetadata> metadata = sfi.getAllClassMetadata();
SortedSet<String> classes = new TreeSet<String>(metadata.keySet());
%>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp
index 1015894..f9bb541 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/control.jsp
@@ -14,8 +14,8 @@
<%@ page import="org.rhq.enterprise.server.test.CoreTestLocal" %>
<%@ page import="org.rhq.enterprise.server.test.DiscoveryTestLocal" %>
<%@ page import="org.rhq.enterprise.server.test.MeasurementTestLocal" %>
-<%@ page import="org.rhq.enterprise.server.test.ResourceGroupTestBeanLocal" %>
-<%@ page import="org.rhq.enterprise.server.test.SubjectRoleTestBeanLocal" %>
+<%@ page import="org.rhq.enterprise.server.test.ResourceGroupTestLocal" %>
+<%@ page import="org.rhq.enterprise.server.test.SubjectRoleTestLocal" %>
<%@ page import="org.rhq.enterprise.server.test.AlertTemplateTestLocal" %>
<%@ page import="org.rhq.enterprise.server.cloud.instance.ServerManagerLocal" %>
<%@ page import="org.rhq.enterprise.server.measurement.MeasurementBaselineManagerLocal" %>
@@ -50,8 +50,8 @@
CoreTestLocal coreTestBean;
DiscoveryTestLocal discoveryTestBean;
MeasurementTestLocal measurementTestBean;
- ResourceGroupTestBeanLocal resourceGroupTestBean;
- SubjectRoleTestBeanLocal subjectRoleTestBean;
+ ResourceGroupTestLocal resourceGroupTestBean;
+ SubjectRoleTestLocal subjectRoleTestBean;
ServerManagerLocal serverManager;
AlertTemplateTestLocal alertTemplateTestBean;
MeasurementBaselineManagerLocal measurementBaselineManager;
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp
index ce3f671..c81d8bd 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/test/hibernate.jsp
@@ -1,9 +1,9 @@
<%@ page import="org.hibernate.EmptyInterceptor" %>
-<%@ page import="org.hibernate.engine.NamedQueryDefinition" %>
-<%@ page import="org.hibernate.engine.SessionFactoryImplementor" %>
-<%@ page import="org.hibernate.hql.ParameterTranslations" %>
-<%@ page import="org.hibernate.hql.QueryTranslator" %>
-<%@ page import="org.hibernate.hql.ast.ASTQueryTranslatorFactory" %>
+<%@ page import="org.hibernate.engine.spi.NamedQueryDefinition" %>
+<%@ page import="org.hibernate.engine.spi.SessionFactoryImplementor" %>
+<%@ page import="org.hibernate.hql.spi.ParameterTranslations" %>
+<%@ page import="org.hibernate.hql.spi.QueryTranslator" %>
+<%@ page import="org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory" %>
<%@ page import="org.hibernate.type.IntegerType" %>
<%@ page import="org.hibernate.type.LongType" %>
<%@ page import="org.hibernate.type.Type" %>
@@ -34,7 +34,7 @@
<jsp:include page="/admin/include/adminTestLinks.html" flush="true" />
<%!
- public static final String ENTITY_MANAGER_FACTORY_JNDI = "java:/RHQEntityManagerFactory";
+ public static final String ENTITY_MANAGER_FACTORY_JNDI = "java:jboss/RHQEntityManagerFactory";
public static final int MAX_ROWS = 100;
%>
@@ -61,13 +61,14 @@
org.hibernate.Session s = getHibernateSession(em);
SessionFactoryImplementor sfi = (SessionFactoryImplementor) s.getSessionFactory();
-
- s = sfi.openSession(new EmptyInterceptor() {
- public String onPrepareStatement(String s) {
- executedSQL.add(s);
- return super.onPrepareStatement(s);
- }
- });
+
+ s = sfi.withOptions().interceptor(
+ new EmptyInterceptor() {
+ public String onPrepareStatement(String s) {
+ executedSQL.add(s);
+ return super.onPrepareStatement(s);
+ }
+ }).openSession();
if (namedQuery != null) {
NamedQueryDefinition queryDef = sfi.getNamedQuery(namedQuery);
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java
index 731a74d..89f9d0b 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBean.java
@@ -29,7 +29,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup;
import org.rhq.enterprise.server.RHQConstants;
@Stateless
-public class ResourceGroupTestBean implements ResourceGroupTestBeanLocal {
+public class ResourceGroupTestBean implements ResourceGroupTestLocal {
private static int compatCounter = 0;
private int getNextCompat() {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBeanLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBeanLocal.java
deleted file mode 100644
index 7e6143d..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestBeanLocal.java
+++ /dev/null
@@ -1,28 +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 ResourceGroupTestBeanLocal {
- public void setupUberMixedGroup();
-
- public void setupCompatibleGroups();
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java
new file mode 100644
index 0000000..eb426dc
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/ResourceGroupTestLocal.java
@@ -0,0 +1,28 @@
+/*
+ * 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 ResourceGroupTestLocal {
+ public void setupUberMixedGroup();
+
+ public void setupCompatibleGroups();
+}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java
index 59a2238..dedfc75 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBean.java
@@ -26,7 +26,7 @@ import org.rhq.core.domain.authz.Role;
import org.rhq.enterprise.server.RHQConstants;
@Stateless
-public class SubjectRoleTestBean implements SubjectRoleTestBeanLocal {
+public class SubjectRoleTestBean implements SubjectRoleTestLocal {
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
private EntityManager entityManager;
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBeanLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBeanLocal.java
deleted file mode 100644
index 2908dd7..0000000
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestBeanLocal.java
+++ /dev/null
@@ -1,32 +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 SubjectRoleTestBeanLocal {
- /**
- * creates roleCount*usersInRoleCount number of objects in the system
- *
- * @param roleCount the number of roles to create
- * @param usersInRoleCount the number of users to create and attach to each role
- */
- public void createRolesAndUsers(int roleCount, int usersInRoleCount);
-}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java
new file mode 100644
index 0000000..7a31234
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/test/SubjectRoleTestLocal.java
@@ -0,0 +1,32 @@
+/*
+ * 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 SubjectRoleTestLocal {
+ /**
+ * creates roleCount*usersInRoleCount number of objects in the system
+ *
+ * @param roleCount the number of roles to create
+ * @param usersInRoleCount the number of users to create and attach to each role
+ */
+ public void createRolesAndUsers(int roleCount, int usersInRoleCount);
+}
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
index 6fb47ea..5bc49dc 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/util/LookupUtil.java
@@ -206,9 +206,9 @@ import org.rhq.enterprise.server.test.DiscoveryTestLocal;
import org.rhq.enterprise.server.test.MeasurementTestBean;
import org.rhq.enterprise.server.test.MeasurementTestLocal;
import org.rhq.enterprise.server.test.ResourceGroupTestBean;
-import org.rhq.enterprise.server.test.ResourceGroupTestBeanLocal;
+import org.rhq.enterprise.server.test.ResourceGroupTestLocal;
import org.rhq.enterprise.server.test.SubjectRoleTestBean;
-import org.rhq.enterprise.server.test.SubjectRoleTestBeanLocal;
+import org.rhq.enterprise.server.test.SubjectRoleTestLocal;
/**
* Methods that allow POJO objects to obtain references to EJB/JPA objects. These convenience methods attempt to
@@ -559,7 +559,7 @@ public final class LookupUtil {
return lookupLocal(SubjectManagerBean.class);
}
- public static SubjectRoleTestBeanLocal getSubjectRoleTestBean() {
+ public static SubjectRoleTestLocal getSubjectRoleTestBean() {
return lookupLocal(SubjectRoleTestBean.class);
}
@@ -662,7 +662,7 @@ public final class LookupUtil {
return lookupLocal(MeasurementTestBean.class);
}
- public static ResourceGroupTestBeanLocal getResourceGroupTestBean() {
+ public static ResourceGroupTestLocal getResourceGroupTestBean() {
return lookupLocal(ResourceGroupTestBean.class);
}
11 years, 7 months
[rhq] Changes to 'jkremser/loginSaving'
by Jiri Kremser
New branch 'jkremser/loginSaving' available with the following commits:
commit dabf565d1bc40172f0288b338ac29e5ba5475389
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Tue Sep 25 15:20:38 2012 +0200
Grease Monkey script for auto-filling the credentials
commit 36668b80ee7f8caef63bc3b6bdc10768038031e2
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Tue Sep 25 15:19:55 2012 +0200
Hidden login form added to login page in order to let the browser ask for storing the credentials
11 years, 7 months
[rhq] modules/enterprise
by lkrejci
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit d41955c0175c795668d8e51ea7b742453a30b5ee
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Sep 24 16:44:28 2012 +0200
[BZ 859982] - Resetting the custom blur event handling before and after a popup dialog is shown in the configuration editor.
This prevents unhandled errors when for example entering an entry into the
list of maps multiple times.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
index 5687ded..bfddfcc 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java
@@ -1727,6 +1727,10 @@ public class ConfigurationEditor extends LocatableVLayout {
summaryTable.redraw();
}
+ //reset the custom blur event handling - we're destroying the new form here
+ blurUnsetItem = null;
+ blurValueItem = null;
+
layout.destroy();
popup.destroy();
}
@@ -1755,6 +1759,10 @@ public class ConfigurationEditor extends LocatableVLayout {
buttonBar.addMember(cancelButton);
}
+ //reset the custom blur event handling - we're creating a new form here
+ blurUnsetItem = null;
+ blurValueItem = null;
+
layout.addMember(buttonBar);
popup.addItem(layout);
popup.show();
11 years, 7 months
[rhq] Changes to 'local/bz/859982'
by lkrejci
New branch 'local/bz/859982' available with the following commits:
commit d41955c0175c795668d8e51ea7b742453a30b5ee
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Sep 24 16:44:28 2012 +0200
[BZ 859982] - Resetting the custom blur event handling before and after a popup dialog is shown in the configuration editor.
This prevents unhandled errors when for example entering an entry into the
list of maps multiple times.
11 years, 7 months
[rhq] 3 commits - etc/scripts .mailmap modules/enterprise
by Heiko W. Rupp
.mailmap | 74 ++
etc/scripts/createRelasenotes.pl | 38 +
modules/enterprise/gui/pom.xml | 1
modules/enterprise/gui/webdav-war/pom.xml | 286 ----------
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AuthenticatedCollectionResource.java | 36 -
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/Authenticator.java | 96 ---
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AvailabilityResource.java | 75 --
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/BasicResource.java | 89 ---
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ConfigResource.java | 95 ---
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/GetableBasicResource.java | 88 ---
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/MeasurementDataResource.java | 129 ----
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ResourceFolder.java | 120 ----
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/RootFolder.java | 120 ----
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/SafeEncoder.java | 45 -
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/TraitsResource.java | 106 ---
modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/WebDAVResourceFactory.java | 110 ---
modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/jboss-web.xml | 5
modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/web.xml | 27
modules/enterprise/remoting/pom.xml | 4
19 files changed, 115 insertions(+), 1429 deletions(-)
New commits:
commit 9e966129a566562bba0e6e0db8b5c0f7e029c29b
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Sep 25 10:31:58 2012 +0200
Remove to-be-removed webservices from the build.
diff --git a/modules/enterprise/remoting/pom.xml b/modules/enterprise/remoting/pom.xml
index 6de50d0..9c2f61d 100644
--- a/modules/enterprise/remoting/pom.xml
+++ b/modules/enterprise/remoting/pom.xml
@@ -29,11 +29,12 @@
<jdk>1.6</jdk>
</activation>
- <modules>
+ <modules>
<module>cli</module>
</modules>
</profile>
+<!--
<profile>
<id>enterprise</id>
@@ -47,6 +48,7 @@
<module>webservices</module>
</modules>
</profile>
+-->
</profiles>
commit 0b3703348583e70aa53cbaea9a4661a2fde49e1f
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Sep 25 10:30:03 2012 +0200
Add a script that creates a confluence-version of the git shortlog between two tags. Includes a mapping file for committers and their multiple accounts they commit from.
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 0000000..67f51f8
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,74 @@
+Adam Young <ayoung(a)redhat.com>
+Asaf Shakarchi <ashakarc(a)redhat.com>
+Bryan Kearney <bkearney(a)redhat.com> <bkearney(a)localhost.localdomain>
+Charles Crouch <ccrouch(a)redhat.com>
+Denis Krusko <kruskod(a)gmail.com>
+Devan Goodwin <dgoodwin(a)redhat.com>
+Elias Ross <elias_ross(a)apple.com>
+Elias Ross <elias_ross(a)apple.com> <genman(a)noderunner.net>
+Fady Matar <fmatar(a)redhat.com>
+Filip Drabek <fdrabek(a)redhat.com> <fdrabek(a)dhcp-lab-136.englab.brq.redhat.com>
+Fusayuki Minamoto <fminamot(a)redhat.com>
+Galder Zamarreno <rnd(a)zamarreno.com>
+Greg Hinkle <ghinkle(a)redhat.com>
+Heiko W. Rupp <hwr(a)redhat.com> <hrupp(a)snert.(none)>
+Heiko W. Rupp <hwr(a)redhat.com> <hwr(a)pilhuhn.de>
+Heiko W. Rupp <hwr(a)redhat.com> <hrupp(a)pintsize.home.pilhuhn.de>
+Heiko W. Rupp <hwr(a)redhat.com> <pilhuhn(a)fedorapeople.org>
+Heiko W. Rupp <hwr(a)redhat.com> <pilhuhn(a)fedoraproject.org>
+Heiko W. Rupp <hwr(a)redhat.com> <hrupp(a)redhat.com>
+Heiko W. Rupp <hwr(a)redhat.com>
+Hudson <jboss-qa-internal(a)redhat.com>
+Ian P. Springer <ian.springer(a)redhat.com> <ips(a)jetengine.(none)>
+Ian P. Springer <ian.springer(a)redhat.com> <ips(a)jetengine.springer.net>
+Ian P. Springer <ian.springer(a)redhat.com> <ispringe(a)redhat.com>
+Ian P. Springer <ian.springer(a)redhat.com> <ips@.(none)>
+Ian P. Springer <ian.springer(a)redhat.com> <ips(a)fedoraproject.org>
+James Livingston <jlivings(a)redhat.com>
+Jan Martiška <jmartisk(a)redhat.com>
+Jason Dobies <jason.dobies(a)redhat.com> <jdobies(a)redhat.com>
+Jay Shaughnessy <jshaughn(a)redhat.com>
+Jay Shaughnessy <jshaughn(a)redhat.com> <jshaughnessy@jshaughnessy-PC>
+Jay Shaughnessy <jshaughn(a)redhat.com> <jshaughnessy@.(none)>
+Jeff Ortel <jortel(a)redhat.com>
+Jessica Sant <jsant(a)redhat.com>
+Jijun Liu <lxjijun(a)gmail.com>
+Jirka Kremser <jkremser(a)redhat.com> <jkremser(a)jkremser-tp520.(none)>
+Jirka Kremser <jkremser(a)redhat.com>
+John Matthews <jmatthews(a)redhat.com>
+John Mazzitelli <mazz(a)redhat.com>
+John Sanda <jsanda(a)redhat.com> <john(a)John-Sandas-iMac.local>
+John Sanda <jsanda(a)redhat.com> <jsanda(a)localhost.localdomain>
+John Sanda <jsanda(a)redhat.com> <jsanda(a)Johns-MacBook-Pro.local>
+John Sanda <jsanda(a)redhat.com> <john(a)localhost.localdomain>
+John Sanda <jsanda(a)redhat.com>
+Joseph Marques <jmarques(a)redhat.com> <joseph(a)redhat.com>
+Justin Harris <jharris(a)redhat.com>
+Larry O'Leary <loleary(a)redhat.com>
+Lukas Krejci <lkrejci(a)redhat.com>
+Mark Spritzler <mspritzl(a)redhat.com>
+Mattias Nilsson Grip <matn(a)redpill-linpro.com>
+Mike McCune <mmccune(a)gibson.pdx.redhat.com>
+Mike Thompson <mithomps(a)redhat.com>
+Mike Thompson <mithomps(a)redhat.com> <mikecthompson(a)gmail.com>
+Mohamed Hamza Ben Mansour <>
+Noam Malki <nmalki(a)redhat.com>
+Partha Aji <paji(a)redhat.com>
+Pradeep Kilambi <pkilambi(a)redhat.com>
+Rafael Soares <rafaelcba(a)gmail.com> <rsoares(a)redhat.com>
+Richard Hensman <richard(a)onevisionconsulting.co.uk>
+Robert Buck <buck.robert.j(a)gmail.com> <rbuck(a)redhat.com>
+Sayli Karmarkar <skarmark(a)redhat.com>
+Shannon Hughes <shughes(a)redhat.com> <shughes(a)scooby.rdu.redhat.com>
+Shannon Hughes <shughes(a)redhat.com> <shughes(a)fred.hughes.lan>
+Simeon Pinder <spinder(a)redhat.com> <simeonpinder(a)gmail.com>
+Simeon Pinder <spinder(a)redhat.com> <spinder(a)cacaphonix.conchfritter.com>
+Simeon Pinder <spinder(a)redhat.com> <spinder(a)fulliautomatix.conchfritter.com>
+Simeon Pinder <spinder(a)redhat.com>
+Stefan Negrea <snegrea(a)redhat.com>
+Steve Millidge <smillidge(a)c2b2.co.uk>
+Ted Won 원종석 <tedd824(a)gmail.com>
+Test JON User <test_jon(a)jon01.qa.atl2.redhat.com>
+Todd B Sanders <tsanders(a)dhcp231-67.rdu.redhat.com>
+Torben Jäger <torben(a)jit-central.com>
+hudson auto <wnstb(a)yahoo.com>
diff --git a/etc/scripts/createRelasenotes.pl b/etc/scripts/createRelasenotes.pl
new file mode 100644
index 0000000..7984d8f
--- /dev/null
+++ b/etc/scripts/createRelasenotes.pl
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+#
+# Small script to create release notes from the git short log.
+# Parameters are old and new tag. If the new tag is omitted,
+# HEAD is used
+#
+# Output of the script can be pasted into the markup
+# release notes of confluence
+#
+# Sample command line:
+# $ perl etc/scripts/createRelasenotes.pl RHQ_4_4_0 RHQ_4_5_0
+#
+# Author: Heiko W. Rupp
+#
+
+
+die "Usage createReleasenotes FROM_TAG [TO_TAG]" unless $#ARGV>-1;
+$OLD_TAG=$ARGV[0];
+$TO_TAG=$ARGV[1];
+
+$COMMAND="git shortlog -e $OLD_TAG..$TO_TAG |";
+
+open(GIT,$COMMAND);
+
+while(<GIT>) {
+
+# print "IN: ", $_;
+ next if /^$/;
+ s/^[\s\[]*BZ\s([0-9]{5,7})(\]? .*)$/ [BZ $1|https:\/\/bugzilla.redhat.com\/show_bug.cgi\?id\=$1] $2/;
+ s/^[\s\[]*Bug\s([0-9]{5,7})(\]? .*)$/ [BZ $1|https:\/\/bugzilla.redhat.com\/show_bug.cgi\?id\=$1] $2/;
+ if (/ .*/) {
+ s/^ (.*)/** $1/;
+ } else {
+ s/(.*)/* $1/;
+ }
+ print $_;
+}
commit a12de7e6234039a99b68497505fe350bceda7eed
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Tue Sep 25 10:26:16 2012 +0200
Remove unused webdav source code.
diff --git a/modules/enterprise/gui/pom.xml b/modules/enterprise/gui/pom.xml
index ba83687..985ae9d 100644
--- a/modules/enterprise/gui/pom.xml
+++ b/modules/enterprise/gui/pom.xml
@@ -31,7 +31,6 @@
<module>installer-war</module>
<module>base-perspective-jar</module>
<module>base-perspective-war</module>
- <!--<module>webdav-war</module>-->
<module>content_http-war</module>
<module>coregui</module>
<module>rest-war</module>
diff --git a/modules/enterprise/gui/webdav-war/pom.xml b/modules/enterprise/gui/webdav-war/pom.xml
deleted file mode 100644
index 3ab00df..0000000
--- a/modules/enterprise/gui/webdav-war/pom.xml
+++ /dev/null
@@ -1,286 +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.3.0-SNAPSHOT</version>
- <relativePath>../../../../pom.xml</relativePath>
- </parent>
-
- <artifactId>rhq-webdav</artifactId>
- <packaging>war</packaging>
-
- <name>RHQ Enterprise WebDav</name>
- <description>The RHQ WebDav inventory access</description>
-
- <dependencies>
-
- <!-- Internal Deps -->
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-domain</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-gui</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope> <!-- by rhq.ear (as ejb-jar) -->
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-util</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope> <!-- by rhq.ear -->
- </dependency>
-
- <!-- 3rd Party Deps -->
- <dependency>
- <groupId>com.ettrema</groupId>
- <artifactId>milton-api</artifactId>
- <version>1.4.1</version>
- </dependency>
-
- <dependency>
- <groupId>com.ettrema</groupId>
- <artifactId>milton-servlet</artifactId>
- <version>1.4.1</version>
- </dependency>
-
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-jdk14</artifactId>
- <version>1.4.3</version>
- </dependency>
-
-
- <dependency>
- <groupId>hibernate</groupId>
- <artifactId>hibernate3</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <!-- used by a test JSP -->
- <dependency>
- <groupId>hibernate-entitymanager</groupId>
- <artifactId>hibernate-entitymanager</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <!-- needed for referenced domain entities that use Hibernate annotations (due to JDK5 bug) -->
- <dependency>
- <groupId>hibernate-annotations</groupId>
- <artifactId>hibernate-annotations</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
-
- <!-- needed for referenced domain entities that use JPA annotations (due to JDK5 bug) -->
- <dependency>
- <groupId>javax.persistence</groupId>
- <artifactId>persistence-api</artifactId>
- <version>1.0</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>jstl</artifactId>
- <version>1.1.2</version>
- </dependency>
-
- <!-- needed for EJB3 annotations (e.g. ApplicationException) -->
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-ejb3x</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-j2ee</artifactId>
- <!-- NOTE: The version is defined in the root POM's dependencyManagement section. -->
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
-
-
-
-
-
-
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2</version>
- </dependency>
-
- <dependency>
- <groupId>commons-httpclient</groupId>
- <artifactId>commons-httpclient</artifactId>
- <version>3.0.1</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3.1</version>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- <scope>provided</scope> <!-- by JBossAS -->
- </dependency>
-
- <dependency>
- <groupId>commons-validator</groupId>
- <artifactId>commons-validator</artifactId>
- <version>1.1.4</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <finalName>rhq-webdav</finalName>
- <plugins>
-
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.1-alpha-1</version>
- <configuration>
- <archive>
- <manifest>
- <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
- <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
- </manifest>
- <manifestEntries>
- <Build-Number>${buildNumber}</Build-Number>
- </manifestEntries>
- </archive>
- <webResources>
- <resource>
- <filtering>false</filtering>
- <directory>${basedir}/src/main/webapp</directory>
- </resource>
- </webResources>
- </configuration>
- </plugin>
-
- </plugins>
-
- </build>
-
- <profiles>
-
- <profile>
- <id>dev</id>
-
- <properties>
- <rhq.rootDir>../../../..</rhq.rootDir>
- <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
- <rhq.deploymentName>${project.build.finalName}.war</rhq.deploymentName>
- <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/${rhq.deploymentName}</rhq.deploymentDir>
- </properties>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
-
- <execution>
- <id>deploy-classes</id>
- <phase>compile</phase>
- <configuration>
- <target>
- <property name="classes.dir" location="${rhq.deploymentDir}/WEB-INF/classes" />
- <echo>*** Copying updated files from target/classes to ${classes.dir}...</echo>
- <copy todir="${classes.dir}" verbose="${rhq.verbose}">
- <fileset dir="target/classes" />
- </copy>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from src${file.separator}main${file.separator}webapp${file.separator} to ${deployment.dir}${file.separator}...</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="${basedir}/src/main/webapp" />
- </copy>
- <!-- TODO: Also copy the files from src/main/webapp-filtered/, and then filter them ourselves. -->
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>deploy</id>
- <phase>package</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Copying updated files from target${file.separator}${project.build.finalName}${file.separator} to ${deployment.dir}${file.separator}...</echo>
- <copy todir="${deployment.dir}" verbose="${rhq.verbose}">
- <fileset dir="${basedir}/target/${project.build.finalName}" />
- </copy>
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- <execution>
- <id>undeploy</id>
- <phase>clean</phase>
- <configuration>
- <target>
- <property name="deployment.dir" location="${rhq.deploymentDir}" />
- <echo>*** Deleting ${deployment.dir}${file.separator}...</echo>
- <delete dir="${deployment.dir}" />
- </target>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
- </profile>
-
- </profiles>
-
- <repositories>
- <repository>
- <id>ettrema</id>
- <url>http://www.ettrema.com/maven2</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
-</project>
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AuthenticatedCollectionResource.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AuthenticatedCollectionResource.java
deleted file mode 100644
index 5a86620..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AuthenticatedCollectionResource.java
+++ /dev/null
@@ -1,36 +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.gui.webdav;
-
-import java.util.List;
-
-import com.bradmcevoy.http.CollectionResource;
-import com.bradmcevoy.http.Resource;
-
-import org.rhq.core.domain.auth.Subject;
-
-/**
- * This is the {@link CollectionResource} interface with an additional ability
- * to obtain the collection given a specific subject.
- *
- * @author John Mazzitelli
- */
-public interface AuthenticatedCollectionResource extends CollectionResource {
- List<? extends Resource> getChildren(Subject subject);
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/Authenticator.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/Authenticator.java
deleted file mode 100644
index cb61cc42..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/Authenticator.java
+++ /dev/null
@@ -1,96 +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.gui.webdav;
-
-import javax.security.auth.login.LoginException;
-
-import com.bradmcevoy.http.Resource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Provides a utility object to perform user authentication.
- *
- * @author John Mazzitelli
- */
-public class Authenticator {
- private static final Log LOG = LogFactory.getLog(Authenticator.class);
-
- private Subject subject = null;
-
- public Authenticator(Subject subject) {
- this.subject = subject;
- }
-
- /**
- * If the user has successfully authenticated himself, this will return the Subject for that login.
- * If the user never logged in or failed to authenticate successfully, this will be <code>null</code>.
- *
- * @return the authenticated subject, or <code>null</code> if user is not authenticated
- */
- public Subject getSubject() {
- return this.subject;
- }
-
- /**
- * For those times when a user does not need to be authenticated to obtain data, use
- * the overlord user, which provides full superuser authentication.
- *
- * @return the overlord user
- */
- public Subject getOverlord() {
- return LookupUtil.getSubjectManager().getOverlord();
- }
-
- /**
- * Logs the user in with the given credentials.
- *
- * <i>This signature must match that of {@link Resource#authenticate(String, String)}</i>
- *
- * @param username
- * @param password
- *
- * @return the {@link Subject} of the authenticated user
- */
- public Object authenticate(String username, String password) {
- try {
- this.subject = LookupUtil.getSubjectManager().login(username, password);
- LOG.debug("User [" + username + "] logged into the webdav server");
- } catch (LoginException e) {
- LOG.warn("User [" + username + "] failed to log into the webdav server");
- this.subject = null;
- }
- return this.subject;
- }
-
- /**
- * Returns the security realm that the user must authenticate with.
- *
- * <i>This signature must match that of {@link Resource#getRealm()}</i>
- *
- * @return security realm name
- */
- public String getRealm() {
- return "Jopr Management Environment";
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AvailabilityResource.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AvailabilityResource.java
deleted file mode 100644
index 31eaf11..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/AvailabilityResource.java
+++ /dev/null
@@ -1,75 +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.gui.webdav;
-
-import java.util.Date;
-
-import com.bradmcevoy.http.PropFindableResource;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.measurement.Availability;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.server.measurement.AvailabilityManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * The property to indicate if the resource is up or down.
- *
- * @author Greg Hinkle
- * @author John Mazzitelli
- */
-public class AvailabilityResource extends BasicResource implements PropFindableResource {
- private Availability availability;
-
- public AvailabilityResource(Subject subject, Resource managedResource) {
- super(subject, managedResource);
- }
-
- public String getUniqueId() {
- return "avail_" + getAvailability().getId();
- }
-
- public String getName() {
- return "availability_is_" + getAvailability().getAvailabilityType().getName();
- }
-
- /**
- * The modified date is that when the current availability took effect.
- * This is the same as {@link #getCreateDate()}.
- */
- public Date getModifiedDate() {
- return getAvailability().getStartTime();
- }
-
- /**
- * The created date is that when the current availability took effect.
- * This is the same as {@link #getModifiedDate()}.
- */
- public Date getCreateDate() {
- return getModifiedDate();
- }
-
- private Availability getAvailability() {
- if (this.availability == null) {
- AvailabilityManagerLocal am = LookupUtil.getAvailabilityManager();
- this.availability = am.getCurrentAvailabilityForResource(getSubject(), getManagedResource().getId());
- }
- return this.availability;
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/BasicResource.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/BasicResource.java
deleted file mode 100644
index e21f026..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/BasicResource.java
+++ /dev/null
@@ -1,89 +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.gui.webdav;
-
-import com.bradmcevoy.http.Auth;
-import com.bradmcevoy.http.PropFindableResource;
-import com.bradmcevoy.http.Request;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Represents a basic managed resource. Provides some hooks to the authentication subsystem to
- * ensure the user is allowed to see the resource.
- *
- * @see ResourceFolder
- *
- * @author Greg Hinkle
- * @author John Mazzitelli
- */
-public abstract class BasicResource extends Authenticator implements PropFindableResource {
-
- private static final Log LOG = LogFactory.getLog(BasicResource.class);
-
- private final Resource managedResource;
-
- public BasicResource(Subject subject, Resource managedResource) {
- super(subject);
-
- if (managedResource == null) {
- throw new NullPointerException("managedResource == null");
- }
- this.managedResource = managedResource;
- }
-
- protected Resource getManagedResource() {
- return this.managedResource;
- }
-
- /**
- * This implementation of authorise simply assures that the user has authenticated himself
- * and the user is allowed to view the managed resource. Subclasses may wish to further
- * restrict the authorization (e.g. deny access if the configuration of the resource
- * is to be edited but the user is not allowed to change the configuration).
- */
- public boolean authorise(Request request, Request.Method method, Auth auth) {
- boolean authorized = false;
-
- if (auth != null) {
- Subject subject = (Subject) auth.getTag();
- if (subject != null) {
- AuthorizationManagerLocal authorizationManager = LookupUtil.getAuthorizationManager();
- authorized = authorizationManager.canViewResource(subject, getManagedResource().getId());
- }
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("BasicResource [" + getManagedResource() + "], auth=[" + auth.getTag() + "], isAuthorized="
- + authorized);
- }
- }
-
- return authorized;
- }
-
- public String checkRedirect(Request request) {
- return null; // no-op
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ConfigResource.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ConfigResource.java
deleted file mode 100644
index 1fc7ad5..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ConfigResource.java
+++ /dev/null
@@ -1,95 +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.gui.webdav;
-
-import java.io.ByteArrayOutputStream;
-import java.util.Date;
-
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.core.domain.configuration.Property;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.server.configuration.ConfigurationManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Provides the resource configuration XML for a given resource.
- *
- * @author Greg Hinkle
- * @author John Mazzitelli
- */
-public class ConfigResource extends GetableBasicResource {
-
- private Configuration configuration;
- private String content;
-
- public ConfigResource(Subject subject, Resource managedResource) {
- super(subject, managedResource);
- }
-
- public String getUniqueId() {
- return "config_" + getConfiguration().getId();
- }
-
- public String getName() {
- return "resource_configuration.xml";
- }
-
- /**
- * The modified date is that of the last time the configuration changed.
- */
- public Date getModifiedDate() {
- return new Date(getConfiguration().getModifiedTime());
- }
-
- /**
- * The creation date is that of the configuration itself, not of the managed resource.
- */
- public Date getCreateDate() {
- return new Date(getConfiguration().getCreatedTime());
- }
-
- protected String loadContent() {
- if (this.content == null) {
- try {
- JAXBContext context = JAXBContext.newInstance(Configuration.class, Property.class);
- Marshaller marshaller = context.createMarshaller();
- marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- marshaller.marshal(getConfiguration(), baos);
- this.content = baos.toString();
- } catch (JAXBException e) {
- throw new RuntimeException("Failed to translate configuration to XML", e);
- }
- }
- return this.content;
- }
-
- private Configuration getConfiguration() {
- if (this.configuration == null) {
- ConfigurationManagerLocal cm = LookupUtil.getConfigurationManager();
- this.configuration = cm.getResourceConfiguration(getManagedResource().getId());
- }
- return this.configuration;
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/GetableBasicResource.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/GetableBasicResource.java
deleted file mode 100644
index 870f52f..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/GetableBasicResource.java
+++ /dev/null
@@ -1,88 +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.gui.webdav;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Map;
-
-import com.bradmcevoy.http.Auth;
-import com.bradmcevoy.http.GetableResource;
-import com.bradmcevoy.http.Range;
-import com.bradmcevoy.http.exceptions.NotAuthorizedException;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.util.stream.StreamUtil;
-
-/**
- * Extends the {@link BasicResource} by providing hooks to stream file content to the user.
- *
- * @author John Mazzitelli
- */
-public abstract class GetableBasicResource extends BasicResource implements GetableResource {
-
- public GetableBasicResource(Subject subject, Resource managedResource) {
- super(subject, managedResource);
- }
-
- /**
- * This implementation assumes the content will be of type "text/xml".
- * Subclasses are free to override this behavior if they are returning content
- * other than XML data.
- */
- public String getContentType(String accepts) {
- return "text/xml";
- }
-
- public Long getContentLength() {
- return Long.valueOf(loadContent().length());
- }
-
- public void sendContent(OutputStream out, Range range, Map<String, String> params, String str) throws IOException,
- NotAuthorizedException {
-
- byte[] bytes = loadContent().getBytes();
- long start = (range != null) ? range.getStart() : 0L;
- long length = (range != null) ? ((range.getFinish() - start) + 1) : bytes.length;
-
- InputStream in = new ByteArrayInputStream(bytes);
- StreamUtil.copy(in, out, start, length);
- }
-
- /**
- * This implementation assumes the user client should not cache the content.
- * Subclasses are free to override this if they allow the content to be cached
- * on the client side.
- */
- public Long getMaxAgeSeconds(Auth auth) {
- return Long.valueOf(0L);
- }
-
- /**
- * Subclasses must implement this to return the content as a String. Note that this really
- * only supports small content since you don't want to load large files in memory. If you need
- * content that is large, implement {@link GetableResource} directly; do not use this abstract class.
- *
- * @return the content as a string, must never be <code>null</code>
- */
- protected abstract String loadContent();
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/MeasurementDataResource.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/MeasurementDataResource.java
deleted file mode 100644
index 8f095b8..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/MeasurementDataResource.java
+++ /dev/null
@@ -1,129 +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.gui.webdav;
-
-import java.util.Date;
-import java.util.List;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.measurement.DataType;
-import org.rhq.core.domain.measurement.MeasurementSchedule;
-import org.rhq.core.domain.measurement.ui.MetricDisplaySummary;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.server.measurement.MeasurementChartsManagerLocal;
-import org.rhq.enterprise.server.measurement.MeasurementPreferences;
-import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerLocal;
-import org.rhq.enterprise.server.measurement.MeasurementPreferences.MetricRangePreferences;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * The measurement data WebDAV resource that provides information on metrics of a managed resource.
- *
- * @author John Mazzitelli
- */
-public class MeasurementDataResource extends GetableBasicResource {
-
- private String content;
- private List<MetricDisplaySummary> measurements;
-
- public MeasurementDataResource(Subject subject, Resource managedResource) {
- super(subject, managedResource);
- }
-
- public String getUniqueId() {
- return "metrics_" + getManagedResource().getId();
- }
-
- public String getName() {
- return "measurement_data.xml";
- }
-
- /**
- * We do not reply with any relevent date. The only way for a relevent date to
- * be calculated is for us to actually query the database for the measurement data.
- * To avoid querying the DB t(which is expensive), we simply return the current
- * date, since the majority of the time, a new measurement collection interval
- * will have triggered in the time the user took between getting the measurement data.
- */
- public Date getModifiedDate() {
- return new Date();
- }
-
- /**
- * The created date is the date of the resource itself was created.
- */
- public Date getCreateDate() {
- return new Date(getManagedResource().getCtime());
- }
-
- protected String loadContent() {
- if (this.content == null) {
- StringBuilder str = new StringBuilder();
- str.append("<?xml version=\"1.0\"?>\n");
- str.append("<measurements>\n");
- for (MetricDisplaySummary meas : getMeasurements()) {
- str.append(" <measurement>\n");
- str.append(" <name>").append(meas.getLabel()).append("</name>\n");
- str.append(" <description>").append(meas.getDescription()).append("</description>\n");
- str.append(" <alert-count>").append(meas.getAlertCount()).append("</alert-count>\n");
- str.append(" <min-value>").append(meas.getMinMetric().getValue()).append("</min-value>\n");
- str.append(" <max-value>").append(meas.getMaxMetric().getValue()).append("</max-value>\n");
- str.append(" <avg-value>").append(meas.getAvgMetric().getValue()).append("</avg-value>\n");
- str.append(" <last-value>").append(meas.getLastMetric().getValue()).append("</last-value>\n");
- str.append(" <units>").append(meas.getUnits()).append("</units>\n");
- str.append(" <begin-time>").append(new Date(meas.getBeginTimeFrame())).append("</begin-time>\n");
- str.append(" <end-time>").append(new Date(meas.getEndTimeFrame())).append("</end-time>\n");
- str.append(" <schedule-id>").append(meas.getScheduleId()).append("</schedule-id>\n");
- str.append(" </measurement>\n");
- }
- str.append("</measurements>\n");
- this.content = str.toString();
- }
- return this.content;
- }
-
- private List<MetricDisplaySummary> getMeasurements() {
- if (this.measurements == null) {
-
- int resourceId = getManagedResource().getId();
-
- // determine the user's preferences so we know how far back to get the measurement data
- MeasurementPreferences measurementPrefs = new MeasurementPreferences(getSubject());
- MetricRangePreferences range = measurementPrefs.getMetricRangePreferences();
-
- // get all the enabled measurement schedules
- MeasurementScheduleManagerLocal sm = LookupUtil.getMeasurementScheduleManager();
- List<MeasurementSchedule> measurementSchedules = sm.findSchedulesForResourceAndType(getSubject(),
- resourceId, DataType.MEASUREMENT, null, true);
- int[] scheduleIds = new int[measurementSchedules.size()];
- int i = 0;
- for (MeasurementSchedule sched : measurementSchedules) {
- scheduleIds[i++] = sched.getId();
- }
-
- // now get the measurement data for all the scheduled as far back as the user's range preferences says so
- MeasurementChartsManagerLocal chartManager = LookupUtil.getMeasurementChartsManager();
- this.measurements = chartManager.getMetricDisplaySummariesForResource(getSubject(), resourceId,
- scheduleIds, range.begin, range.end);
- }
-
- return this.measurements;
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ResourceFolder.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ResourceFolder.java
deleted file mode 100644
index 73f55f1..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/ResourceFolder.java
+++ /dev/null
@@ -1,120 +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.gui.webdav;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import com.bradmcevoy.http.Resource;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.resource.InventoryStatus;
-import org.rhq.core.domain.resource.composite.ResourceFacets;
-import org.rhq.core.domain.util.PageControl;
-import org.rhq.core.domain.util.PageList;
-import org.rhq.enterprise.server.resource.ResourceManagerLocal;
-import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Represents a managed resource along with its children resources.
- *
- * @see BasicResource
- *
- * @author Greg Hinkle
- * @author John Mazzitelli
- */
-public class ResourceFolder extends BasicResource implements AuthenticatedCollectionResource {
-
- private List<Resource> children;
-
- public ResourceFolder(Subject subject, org.rhq.core.domain.resource.Resource managedResource) {
- super(subject, managedResource);
- }
-
- public String getUniqueId() {
- return String.valueOf(getManagedResource().getId());
- }
-
- public String getName() {
- String name = getManagedResource().getName();
- return SafeEncoder.encode(name);
- }
-
- public Date getModifiedDate() {
- return new Date(getManagedResource().getMtime());
- }
-
- public Date getCreateDate() {
- return new Date(getManagedResource().getCtime());
- }
-
- public Resource child(String childName) {
- List<? extends Resource> children = getChildren();
- for (Resource child : children) {
- if (childName.equals(child.getName())) {
- return child;
- }
- }
- return null;
- }
-
- public List<? extends Resource> getChildren() {
- return getChildren(getSubject());
- }
-
- public List<? extends Resource> getChildren(Subject subject) {
- if (this.children == null) {
- PageList<org.rhq.core.domain.resource.Resource> childs;
- ResourceManagerLocal rm = LookupUtil.getResourceManager();
- childs = rm.findChildResources(subject, getManagedResource().getId(), PageControl.getUnlimitedInstance());
-
- // inventory
- this.children = new ArrayList<Resource>(childs.size());
- for (org.rhq.core.domain.resource.Resource child : childs) {
- if (child.getInventoryStatus() == InventoryStatus.COMMITTED) {
- this.children.add(new ResourceFolder(subject, child));
- }
- }
-
- ResourceTypeManagerLocal rtm = LookupUtil.getResourceTypeManager();
- ResourceFacets facets = rtm.getResourceFacets(getManagedResource().getResourceType().getId());
-
- // availability
- this.children.add(new AvailabilityResource(subject, getManagedResource()));
-
- // resource configuration
- if (facets.isConfiguration()) {
- this.children.add(new ConfigResource(subject, getManagedResource()));
- }
-
- // traits
- if (facets.isMeasurement()) {
- this.children.add(new TraitsResource(subject, getManagedResource()));
- }
-
- // measurement data
- if (facets.isMeasurement()) {
- this.children.add(new MeasurementDataResource(subject, getManagedResource()));
- }
- }
- return this.children;
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/RootFolder.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/RootFolder.java
deleted file mode 100644
index 89c78fd..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/RootFolder.java
+++ /dev/null
@@ -1,120 +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.gui.webdav;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import com.bradmcevoy.http.Auth;
-import com.bradmcevoy.http.PropFindableResource;
-import com.bradmcevoy.http.Request;
-import com.bradmcevoy.http.Resource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.resource.ResourceCategory;
-import org.rhq.core.domain.resource.composite.ResourceComposite;
-import org.rhq.core.domain.util.PageControl;
-import org.rhq.enterprise.server.resource.ResourceManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * This represents the top of the managed environment (i.e. all of the top-level platforms being managed).
- *
- * @author Greg Hinkle
- * @author John Mazzitelli
- */
-public class RootFolder extends Authenticator implements AuthenticatedCollectionResource, PropFindableResource {
-
- private static final Log LOG = LogFactory.getLog(RootFolder.class);
-
- private List<ResourceFolder> roots;
-
- public RootFolder() {
- super(null);
- }
-
- public String getUniqueId() {
- return "/";
- }
-
- public String getName() {
- return "/";
- }
-
- public Date getModifiedDate() {
- return new Date();
- }
-
- public Date getCreateDate() {
- return new Date();
- }
-
- /**
- * This implementation of authorise simply assures that the user has authenticated himself.
- * If the user is logged in, <code>true</code> is returned; otherwise, <code>false</code> is returned.
- */
- public boolean authorise(Request request, Request.Method method, Auth auth) {
- boolean authorized = (auth != null) && (auth.getTag() != null);
- if (LOG.isDebugEnabled()) {
- LOG.debug("RootFolder auth=[" + ((auth != null) ? auth.getTag() : auth) + "], isAuthorized=" + authorized);
- }
- return authorized;
- }
-
- public String checkRedirect(Request request) {
- return null; // no-op
- }
-
- public Resource child(String childName) {
- List<? extends Resource> children = getChildren();
- for (Resource child : children) {
- if (childName.equals(child.getName())) {
- return child;
- }
- }
- return null;
- }
-
- public List<? extends Resource> getChildren() {
- return getChildren(getSubject());
- }
-
- public List<? extends Resource> getChildren(Subject subject) {
- if (this.roots == null) {
- ResourceManagerLocal rm = LookupUtil.getResourceManager();
-
- List<ResourceComposite> foundRoots = rm.findResourceComposites(subject, ResourceCategory.PLATFORM, null,
- null, null, null, true, PageControl.getUnlimitedInstance());
-
- if (foundRoots != null) {
- this.roots = new ArrayList<ResourceFolder>(foundRoots.size());
- for (ResourceComposite comp : foundRoots) {
- this.roots.add(new ResourceFolder(subject, comp.getResource()));
- }
- } else {
- this.roots = new ArrayList<ResourceFolder>();
- }
- }
- return this.roots;
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/SafeEncoder.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/SafeEncoder.java
deleted file mode 100644
index 8805335..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/SafeEncoder.java
+++ /dev/null
@@ -1,45 +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.gui.webdav;
-
-/**
- * Seems like some of our resource names aren't able to safely become URLs that contain characters
- * like \ or /. This utility will attempt to change names so they can safely be handled.
- *
- * @author John Mazzitelli
- */
-public abstract class SafeEncoder {
- // pick things that are at least half-sane, even if they doesn't look perfect
- private static final String[][] REPLACEMENTS = new String[][] { { "\\", "||" }, { "/", "|" } };
-
- public static String encode(String name) {
- for (String[] replacement : REPLACEMENTS) {
- name = name.replace(replacement[0], replacement[1]);
- }
- return name;
- }
-
- public static String decode(String name) {
- for (String[] replacement : REPLACEMENTS) {
- name = name.replace(replacement[1], replacement[0]);
- }
- return name;
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/TraitsResource.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/TraitsResource.java
deleted file mode 100644
index 9293127..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/TraitsResource.java
+++ /dev/null
@@ -1,106 +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.gui.webdav;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.measurement.MeasurementDataTrait;
-import org.rhq.core.domain.resource.Resource;
-import org.rhq.enterprise.server.measurement.MeasurementDataManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * The measurement traits resource that provides information on all traits of a managed resource.
- *
- * @author John Mazzitelli
- */
-public class TraitsResource extends GetableBasicResource {
-
- private List<MeasurementDataTrait> traits;
- private String content;
-
- public TraitsResource(Subject subject, Resource managedResource) {
- super(subject, managedResource);
- }
-
- public String getUniqueId() {
- return "traits_" + getManagedResource().getId();
- }
-
- public String getName() {
- return "measurement_traits.xml";
- }
-
- /**
- * The modified date is that of the last time a trait changed.
- */
- public Date getModifiedDate() {
- long latestTimestamp = 0L;
- for (MeasurementDataTrait trait : getTraits()) {
- if (latestTimestamp < trait.getTimestamp()) {
- latestTimestamp = trait.getTimestamp();
- }
- }
- return new Date(latestTimestamp);
- }
-
- /**
- * The created date is the date of the resource itself was created.
- */
- public Date getCreateDate() {
- return new Date(getManagedResource().getCtime());
- }
-
- protected String loadContent() {
- if (this.content == null) {
- StringBuilder str = new StringBuilder();
- str.append("<?xml version=\"1.0\"?>\n");
- str.append("<traits>\n");
- for (MeasurementDataTrait trait : getTraits()) {
- str.append(" <trait>\n");
- str.append(" <name>").append(trait.getName()).append("</name>\n");
- str.append(" <value>").append(trait.getValue()).append("</value>\n");
- str.append(" <last-changed>").append(new Date(trait.getTimestamp())).append("</last-changed>\n");
- str.append(" <schedule-id>").append(trait.getScheduleId()).append("</schedule-id>\n");
- str.append(" </trait>\n");
- }
- str.append("</traits>\n");
- this.content = str.toString();
- }
- return this.content;
- }
-
- private List<MeasurementDataTrait> getTraits() {
- if (this.traits == null) {
- MeasurementDataManagerLocal mdm = LookupUtil.getMeasurementDataManager();
- List<MeasurementDataTrait> traits = mdm.findCurrentTraitsForResource(getSubject(), getManagedResource()
- .getId(), null);
- if (traits != null) {
- this.traits = traits;
- } else {
- this.traits = new ArrayList<MeasurementDataTrait>();
- }
- }
- return this.traits;
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/WebDAVResourceFactory.java b/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/WebDAVResourceFactory.java
deleted file mode 100644
index bf1a584..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/java/org/rhq/gui/webdav/WebDAVResourceFactory.java
+++ /dev/null
@@ -1,110 +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.gui.webdav;
-
-import java.util.List;
-
-import com.bradmcevoy.http.Resource;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.util.collection.ArrayUtils;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * The main entry point when a WebDAV request comes in. This will examine
- * the URL being requested and convert that URL into a series of WebDAV
- * resources for the user to see.
- *
- * @author Greg Hinkle
- * @author John Mazzitelli
- */
-public class WebDAVResourceFactory implements com.bradmcevoy.http.ResourceFactory {
-
- private static final Log LOG = LogFactory.getLog(WebDAVResourceFactory.class);
-
- public Resource getResource(String host, String url) {
- Resource foundResource = null;
-
- // URL == /webdav/resource/<parent-resource-name>/<child-resource-name>/...
- // paths[] = [, webdav, resource, <parent-resource-name>, <child-resource-name>, ...]
- String[] paths = url.split("/");
-
- if (paths.length >= 3) {
- String webdavResourceType = paths[2];
- if ("resource".equals(webdavResourceType)) {
- foundResource = getResourceResource(getSubarray(paths, 3));
- }
- // TODO: some ideas for addition resource types
- // else if "group".equals(webdavResourceType)
- // else if "user".equals(webdavResourceType)
- // else if "role".equals(webdavResourceType)
- // else if "plugin".equals(webdavResourceType)
- // else if "systemconfig".equals(webdavResourceType)
- // else if "agentupdate/download".equals(webdavResourceType)
- // else if "agentupdate/version".equals(webdavResourceType)
- }
-
- if (foundResource == null) {
- LOG.warn("Couldn't find resource associated with webdav url [" + url + "]");
- }
-
- return foundResource;
- }
-
- public String getSupportedLevels() {
- return "1";
- }
-
- private String[] getSubarray(String[] full, int index) {
- return ArrayUtils.copyOfRange(full, index, full.length);
- }
-
- public Subject getOverlord() {
- return LookupUtil.getSubjectManager().getOverlord();
- }
-
- private Resource getResourceResource(String[] paths) {
- if (paths.length == 0 || paths[0] == null || paths[0].length() == 0) {
- return new RootFolder();
- } else {
- Resource resourceFolder = new RootFolder();
- for (int i = 0; i < paths.length; i++) {
- boolean found = false;
- if (resourceFolder instanceof AuthenticatedCollectionResource) {
- List<? extends Resource> children;
- children = ((AuthenticatedCollectionResource) resourceFolder).getChildren(getOverlord());
- for (Resource child : children) {
- String childName = child.getName();
- if (childName.equals(paths[i])) {
- resourceFolder = child;
- found = true;
- }
- }
- }
- if (!found) {
- return null;
- }
- }
- return resourceFolder;
- }
- }
-}
diff --git a/modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/jboss-web.xml b/modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/jboss-web.xml
deleted file mode 100644
index 0e4fa0f..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/jboss-web.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-
-<jboss-web>
- <context-root>webdav</context-root>
-</jboss-web>
diff --git a/modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/web.xml b/modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 2a445aa..0000000
--- a/modules/enterprise/gui/webdav-war/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<web-app xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- version="2.5">
-
- <display-name>RHQ WebDav</display-name>
-
-
- <!-- WebDAV support -->
- <servlet>
- <servlet-name>WebDAV</servlet-name>
- <servlet-class>com.bradmcevoy.http.MiltonServlet</servlet-class>
- <init-param>
- <param-name>resource.factory.class</param-name>
- <param-value>org.rhq.gui.webdav.WebDAVResourceFactory</param-value>
- </init-param>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>WebDAV</servlet-name>
- <url-pattern>/</url-pattern>
- </servlet-mapping>
-
-</web-app>
-
11 years, 7 months
[rhq] Branch 'rhq-on-as7' - modules/enterprise
by mazz
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
New commits:
commit 097a6c84c1ed00cd5ae8ae78b072aa8fc6578759
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Mon Sep 24 15:55:04 2012 -0400
use the new filesystem layout of AS7
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
index 922cd3c..5d7b3d1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/plugin/pc/ServerPluginService.java
@@ -23,7 +23,6 @@ import java.io.File;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -115,7 +114,7 @@ public class ServerPluginService implements ServerPluginServiceMBean {
public File getServerPluginsDirectory() {
File serverHomeDir = LookupUtil.getCoreServer().getJBossServerHomeDir();
- File pluginDir = new File(serverHomeDir, "deploy/" + RHQConstants.EAR_FILE_NAME + "/rhq-serverplugins");
+ File pluginDir = new File(serverHomeDir, "deployments/rhq.ear/rhq-serverplugins");
return pluginDir;
}
11 years, 7 months
[rhq] Branch 'rhq-on-as7' - modules/core
by Jay Shaughnessy
modules/core/dbutils/pom.xml | 2
modules/core/dbutils/src/main/scripts/dbsetup-build.xml | 2
modules/core/dbutils/src/main/scripts/dbsetup/jms-data.xml | 17 --
modules/core/dbutils/src/main/scripts/dbsetup/jms-schema.xml | 67 ----------
modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml | 9 +
modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 8 +
6 files changed, 18 insertions(+), 87 deletions(-)
New commits:
commit b69893f53ed0e9f6ecce40f4c3bb319759c0fc03
Author: Jay Shaughnessy <jshaughn(a)jshaughn.csb>
Date: Mon Sep 24 15:31:24 2012 -0400
Remove the JMS_* tables, they are not relevant to HornetQ.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml
index bb561bf..afaa176 100644
--- a/modules/core/dbutils/pom.xml
+++ b/modules/core/dbutils/pom.xml
@@ -17,7 +17,7 @@
<description>Database schema setup, upgrade and other utilities</description>
<properties>
- <db.schema.version>2.123</db.schema.version>
+ <db.schema.version>2.124</db.schema.version>
<rhq.ds.type-mapping>${rhq.test.ds.type-mapping}</rhq.ds.type-mapping>
<rhq.ds.server-name>${rhq.test.ds.server-name}</rhq.ds.server-name>
<rhq.ds.db-name>${rhq.test.ds.db-name}</rhq.ds.db-name>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup-build.xml b/modules/core/dbutils/src/main/scripts/dbsetup-build.xml
index 470fcc6..ee32017 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup-build.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup-build.xml
@@ -41,7 +41,7 @@ To run the default target, you must set one of the following properties to true:
<property name="dbsetup.scripts.dir" value="${basedir}/src/main/scripts/dbsetup" />
<property name="dbsetup.output.dir" value="${basedir}/target/dbsetup" /> <!-- away from classes so it doesn't go into the jar -->
<!-- define the setup creation processing order. note, removals are done in the reverse order -->
- <property name="dbsetup.subsystems" value="config,cluster,auth,inventory,authz,search,dashboard,operation,event,alert,sysconfig,scheduler,amps,measurement,content,resource-request,jms,obsolete"/>
+ <property name="dbsetup.subsystems" value="config,cluster,auth,inventory,authz,search,dashboard,operation,event,alert,sysconfig,scheduler,amps,measurement,content,resource-request,obsolete"/>
<property name="dbsetup.combined.schema" value="${dbsetup.output.dir}/all-schema.xml" />
<property name="dbsetup.combined.data" value="${dbsetup.output.dir}/all-data.xml" />
<property name="dbsetup.tstamp.file" value="${dbsetup.output.dir}/dbsetup-combine.tstamp" />
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/jms-data.xml b/modules/core/dbutils/src/main/scripts/dbsetup/jms-data.xml
deleted file mode 100644
index 51c369e..0000000
--- a/modules/core/dbutils/src/main/scripts/dbsetup/jms-data.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- the schema matches that which would be automatically created by the JMS subsystem -->
-<!-- see deploy/jms/rhq-jdbc-state-service.xml and rhq-jdbc2-service.xml -->
-<!-- the data must match that which is expected in conf/login-config.xml -->
-
-<dbsetup name="jms-data.xml">
-
- <table name="JMS_USERS">
- <data USERID="guest" PASSWD="guest" />
- </table>
-
- <table name="JMS_ROLES">
- <data ROLEID="guest" USERID="guest" />
- </table>
-
-</dbsetup>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/jms-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/jms-schema.xml
deleted file mode 100644
index e84bc00..0000000
--- a/modules/core/dbutils/src/main/scripts/dbsetup/jms-schema.xml
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- the schema matches that which would be automatically created by the JMS subsystem -->
-<!-- see deploy/jms/rhq-jdbc-state-service.xml and rhq-jdbc2-service.xml -->
-
-<dbsetup name="jms-schema.xml">
-
- <table name="JMS_MESSAGES">
- <column name="MESSAGEID" required="true" type="INTEGER" />
- <column name="DESTINATION" required="true" type="VARCHAR2" size="255" />
- <column name="TXID" required="false" type="INTEGER" />
- <column name="TXOP" required="false" type="CHAR" size="1" />
- <column name="MESSAGEBLOB" required="false" type="BLOB" />
-
- <constraint name="JMS_MESSAGES_PKEY">
- <primaryKey>
- <field ref="MESSAGEID"/>
- <field ref="DESTINATION"/>
- </primaryKey>
- </constraint>
-
- <index name="JMS_MESSAGES_TXOP_TXID">
- <field ref="TXOP"/>
- <field ref="TXID"/>
- </index>
- <index name="JMS_MESSAGES_DESTINATION">
- <field ref="DESTINATION"/>
- </index>
- </table>
-
- <table name="JMS_TRANSACTIONS">
- <column name="TXID" required="true" type="INTEGER" primarykey="true" />
- </table>
-
- <table name="JMS_USERS">
- <column name="USERID" required="true" type="VARCHAR2" size="32" primarykey="true" />
- <column name="PASSWD" required="true" type="VARCHAR2" size="32" />
- <column name="CLIENTID" required="false" type="VARCHAR2" size="128" />
- </table>
-
- <table name="JMS_ROLES">
- <column name="ROLEID" required="true" type="VARCHAR2" size="32" />
- <column name="USERID" required="true" type="VARCHAR2" size="32" />
-
- <constraint name="JMS_ROLES_PKEY">
- <primaryKey>
- <field ref="USERID"/>
- <field ref="ROLEID"/>
- </primaryKey>
- </constraint>
- </table>
-
- <table name="JMS_SUBSCRIPTIONS">
- <column name="CLIENTID" required="true" type="VARCHAR2" size="128" />
- <column name="SUBNAME" required="true" type="VARCHAR2" size="128" />
- <column name="TOPIC" required="true" type="VARCHAR2" size="255" />
- <column name="SELECTOR" required="false" type="VARCHAR2" size="255" />
-
- <constraint name="JMS_SUBSCRIPTIONS_PKEY">
- <primaryKey>
- <field ref="CLIENTID"/>
- <field ref="SUBNAME"/>
- </primaryKey>
- </constraint>
- </table>
-
-</dbsetup>
diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml
index 7562b7a..90d2e7e 100644
--- a/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml
+++ b/modules/core/dbutils/src/main/scripts/dbsetup/obsolete-schema.xml
@@ -6,7 +6,14 @@
<!-- NOTE: The tables will be dropped in the *** REVERSE ORDER *** as listed in this file! -->
<!-- NOTE: So, put the table you want dropped first at the bottom, and so on... -->
-
+ <!-- !!! JMS tables removed when moving to HornetQ -->
+
+ <table obsolete="true">JMS_SUBSCRIPTIONS</table>
+ <table obsolete="true">JMS_ROLES</table>
+ <table obsolete="true">JMS_USERS</table>
+ <table obsolete="true">JMS_TRANSACTIONS</table>
+ <table obsolete="true">JMS_MESSAGES</table>
+
<!-- !!! REMOVED FROM CONTENT-SCHEMA !!!! -->
<table name="RHQ_DRIFT_TEMPLATE_MAP" obsolete="true">
diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
index 1443b80..0864fde 100644
--- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
+++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml
@@ -4035,6 +4035,14 @@
<schema-addColumn table="RHQ_CONFIG_PROP_DEF" column="MAX_ENTRIES" columnType="INTEGER"/>
</schemaSpec>
+ <schemaSpec version="2.124">
+ <schema-dropTable table="JMS_MESSAGES" ignoreError="true" />
+ <schema-dropTable table="JMS_TRANSACTIONS" ignoreError="true" />
+ <schema-dropTable table="JMS_USERS" ignoreError="true" />
+ <schema-dropTable table="JMS_ROLES" ignoreError="true" />
+ <schema-dropTable table="JMS_SUBSCRIPTIONS" ignoreError="true" />
+ </schemaSpec>
+
</dbupgrade>
</target>
</project>
11 years, 7 months