modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java
| 58 -
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java
| 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.java
| 45
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.java
| 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java
| 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java
| 30
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java
| 35
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java
| 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java
| 518 ----------
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java
| 35
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.java
| 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java
| 33
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.java
| 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java
| 44
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java
| 62 -
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java
| 27
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java
| 35
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.java
| 32
modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java
| 35
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
| 8
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
| 11
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
| 1
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java
| 99 -
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java
| 57 -
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java
| 123 --
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java
| 117 --
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
| 17
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
| 10
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
| 23
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
| 9
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
| 14
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
| 8
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
| 15
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
| 52 -
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
| 5
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
| 5
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
| 24
modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
| 4
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
| 42
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
| 8
modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
| 8
modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
| 5
modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
| 8
modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
| 94 -
modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
| 60 -
modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
| 1
modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
| 7
modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
| 7
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
| 6
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
| 4
modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
| 4
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
| 5
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
| 6
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
| 2
modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
| 4
modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
| 6
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
| 10
modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
| 4
modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
| 5
modules/enterprise/server/ear/pom.xml
| 21
modules/enterprise/server/ear/src/main/license/license.xml
| 26
modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
| 1
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
| 8
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
| 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
| 20
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java
| 43
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java
| 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java
| 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.java
| 120 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java
| 42
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java
| 245 ----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java
| 340 ------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java
| 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java
| 313 ------
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java
| 55 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java
| 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java
| 214 ----
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java
| 108 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java
| 84 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java
| 103 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java
| 34
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java
| 81 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java
| 70 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java
| 90 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java
| 76 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java
| 37
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.java
| 36
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
| 10
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.java
| 36
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
| 126 --
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
| 13
modules/enterprise/server/license-gen/jar/pom.xml
| 88 -
modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java
| 267 -----
modules/enterprise/server/license-gen/maven-plugin/pom.xml
| 77 -
modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml
| 73 -
modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml
| 32
modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
| 12
modules/enterprise/server/pom.xml
| 2
99 files changed, 51 insertions(+), 5088 deletions(-)
New commits:
commit ec5b64e1cd0c61f616f10b807362e2da7cbdf423
Merge: fbde2b7... 069a61c...
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 8 23:35:18 2011 -0500
Merge branch 'no-license'
commit 069a61cde25d8dd80182c20547e510d7dcfd7823
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Tue Feb 8 23:34:18 2011 -0500
BZ 676060 - remove all licensing code so RHQ no longer uses or requires the license
file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java
deleted file mode 100644
index adacf8b..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttr.java
+++ /dev/null
@@ -1,58 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A class which defines an attribute and the conditions on which it is valid.
- */
-public class XmlAttr {
- public static final int REQUIRED = 0;
- public static final int OPTIONAL = 1;
-
- private String name;
- private int type;
-
- /**
- * Create a new XmlAttr attribute with the given name, and type.
- *
- * @param name The name of the XML tag attribute
- * @param type One of REQUIRED or OPTIONAL, indicating that the attribute is required
for the tag to be valid, or
- * optional, meaning it is allowed but not required.
- */
- public XmlAttr(String name, int type) {
- this.name = name;
- this.type = type;
-
- if ((type != REQUIRED) && (type != OPTIONAL)) {
- throw new IllegalArgumentException("Invalid type: " + type);
- }
- }
-
- public String getName() {
- return this.name;
- }
-
- public int getType() {
- return this.type;
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java
deleted file mode 100644
index 4c15d5a..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrException.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A base-class for other attribute based exceptions.
- */
-
-public class XmlAttrException extends XmlParseException {
- public XmlAttrException(String s) {
- super(s);
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.java
deleted file mode 100644
index 8011b17..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlAttrHandler.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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * An interface which classes much implement in order to have their attributes handled.
If this interface is not
- * implemented, then all attributes for a tag are considered to be 'unknown', and
the object must implement the
- * XmlUnAttrHandler to process them.
- */
-
-public interface XmlAttrHandler {
- /**
- * Get a list of attributes which the handler knows about.
- */
- public XmlAttr[] getAttributes();
-
- /**
- * Called when XmlParser finds a known attributes (as returned by getAttributes()).
- *
- * @param attrNumber An index into the array which was returned from getAttributes.
The index represents the found
- * attribute
- * @param value The value of the attribute
- */
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException;
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.java
deleted file mode 100644
index 17918a2..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlEndAttrHandler.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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * An object should implement this interface when it wishes to be notified then the
parser is done handling all of the
- * attributes for the associated tag.
- */
-
-public interface XmlEndAttrHandler {
- public void endAttributes() throws XmlAttrException;
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java
deleted file mode 100644
index 2b9904a..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFilterHandler.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * Before an objects XmlAttrHandler is called, this method will be invoked with the tag
which is holding the attribute,
- * the name of the attribute, and the value given for it. The handler should filter this
(do replacement, etc.) and
- * return the value that XmlParser should use to call into the attribute handler
routine.
- */
-
-public interface XmlFilterHandler {
- public String filterAttrValue(XmlTagHandler tag, String attrName, String attrValue);
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java
deleted file mode 100644
index 16e65d1..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlFullHandler.java
+++ /dev/null
@@ -1,30 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A convenience interface for tags wishing to support the full suite of XmlParser
interfaces.
- */
-public interface XmlFullHandler extends XmlAttrHandler, XmlEndAttrHandler, XmlTagHandler,
XmlUnAttrHandler,
- XmlTagEntryHandler, XmlTagExitHandler {
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java
deleted file mode 100644
index 9df3ca5..0000000
---
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlMissingTagException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * An exception which is thrown when a tag does not have a required child tag. This
exception can be thrown when a tag
- * is required and is missing, or has a ONE_OR_MORE and is missing.
- */
-public class XmlMissingTagException extends XmlTagException {
- XmlMissingTagException(Element e, String reqTag) {
- super("Tag <" + e.getName() + "> requires child tag
'" + reqTag + "'");
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java
deleted file mode 100644
index cf95256..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParseException.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * The superclass to all XmlParser parse exceptions.
- */
-
-public class XmlParseException extends Exception {
- XmlParseException(String s) {
- super(s);
- }
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java
deleted file mode 100644
index 6987cf5..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlParser.java
+++ /dev/null
@@ -1,518 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import java.io.File;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.jdom.Attribute;
-import org.jdom.Document;
-import org.jdom.Element;
-import org.jdom.input.SAXBuilder;
-import org.xml.sax.EntityResolver;
-import org.rhq.core.clientapi.util.StringUtil;
-
-/**
- * The main entry point && bulk of XmlParser. The parsing routine takes an
entry-point tag, which provides information
- * about subtags, attributes it takes, etc. Tags can implement various interfaces to tell
the parser to call back when
- * certain conditions are met. This class takes the role of both a minimal validator as
well as a traversal mechanism
- * for building data objects out of XML.
- *
- * @deprecated see
http://jira.jboss.com/jira/browse/JBNADM-2932
- */
-@Deprecated
-public class XmlParser {
- private XmlParser() {
- }
-
- private static void checkAttributes(Element elem, XmlTagHandler tag, XmlFilterHandler
filter)
- throws XmlAttrException {
- boolean handlesAttrs = tag instanceof XmlAttrHandler;
- XmlAttr[] attrs;
-
- if (handlesAttrs) {
- attrs = ((XmlAttrHandler) tag).getAttributes();
- } else {
- attrs = new XmlAttr[0];
- }
-
- // Ensure out all the required && optional attributes
- for (int i = 0; i < attrs.length; i++) {
- Attribute a = null;
- boolean found = false;
-
- for (Iterator j = elem.getAttributes().iterator(); j.hasNext();) {
- a = (Attribute) j.next();
-
- if (a.getName().equalsIgnoreCase(attrs[i].getName())) {
- found = true;
- break;
- }
- }
-
- if (!found && (attrs[i].getType() == XmlAttr.REQUIRED)) {
- throw new XmlRequiredAttrException(elem, attrs[i].getName());
- }
-
- if (found && handlesAttrs) {
- String val;
-
- val = filter.filterAttrValue(tag, a.getName(), a.getValue());
-
- ((XmlAttrHandler) tag).handleAttribute(i, val);
- }
- }
-
- // Second loop to handle unknown attributes
- for (Iterator i = elem.getAttributes().iterator(); i.hasNext();) {
- Attribute a = (Attribute) i.next();
- boolean found = false;
-
- for (int j = 0; j < attrs.length; j++) {
- if (a.getName().equalsIgnoreCase(attrs[j].getName())) {
- found = true;
- break;
- }
- }
-
- if (found) {
- continue;
- }
-
- if (tag instanceof XmlUnAttrHandler) {
- XmlUnAttrHandler handler;
- String val;
-
- val = filter.filterAttrValue(tag, a.getName(), a.getValue());
-
- handler = (XmlUnAttrHandler) tag;
- handler.handleUnknownAttribute(a.getName(), val);
- } else {
- throw new XmlUnknownAttrException(elem, a.getName());
- }
- }
-
- if (tag instanceof XmlEndAttrHandler) {
- ((XmlEndAttrHandler) tag).endAttributes();
- }
- }
-
- private static void checkSubNodes(Element elem, XmlTagHandler tag, XmlFilterHandler
filter)
- throws XmlAttrException, XmlTagException {
- XmlTagInfo[] subTags = tag.getSubTags();
- Map hash;
-
- hash = new HashMap();
-
- // First, count how many times each sub-tag is referenced
- for (Iterator i = elem.getChildren().iterator(); i.hasNext();) {
- Element e = (Element) i.next();
- String name;
- Integer val;
-
- name = e.getName().toLowerCase();
- if ((val = (Integer) hash.get(name)) == null) {
- val = new Integer(0);
- }
-
- val = new Integer(val.intValue() + 1);
- hash.put(name, val);
- }
-
- for (int i = 0; i < subTags.length; i++) {
- String name = subTags[i].getTag().getName().toLowerCase();
- Integer iVal = (Integer) hash.get(name);
- int threshold = 0;
- int val;
-
- val = (iVal == null) ? 0 : iVal.intValue();
-
- switch (subTags[i].getType()) {
- case XmlTagInfo.REQUIRED: {
- if (val == 0) {
- throw new XmlMissingTagException(elem, name);
- } else if (val != 1) {
- throw new XmlTooManyTagException(elem, name);
- }
-
- break;
- }
-
- case XmlTagInfo.OPTIONAL: {
- if (val > 1) {
- throw new XmlTooManyTagException(elem, name);
- }
-
- break;
- }
-
- case XmlTagInfo.ONE_OR_MORE: {
- threshold++;
- }
-
- case XmlTagInfo.ZERO_OR_MORE: {
- if (val < threshold) {
- throw new XmlMissingTagException(elem, name);
- }
-
- break;
- }
- }
-
- hash.remove(name);
- }
-
- // Now check for excess sub-tags
- if (hash.size() != 0) {
- Set keys = hash.keySet();
-
- throw new XmlTooManyTagException(elem, (String) keys.iterator().next());
- }
-
- // Recurse to all sub-tags
- for (Iterator i = elem.getChildren().iterator(); i.hasNext();) {
- Element child = (Element) i.next();
-
- for (int j = 0; j < subTags.length; j++) {
- XmlTagHandler subTag = subTags[j].getTag();
- String subName = subTag.getName();
-
- if (child.getName().equalsIgnoreCase(subName)) {
- XmlParser.processNode(child, subTag, filter);
- break;
- }
- }
- }
- }
-
- private static void processNode(Element elem, XmlTagHandler tag, XmlFilterHandler
filter) throws XmlAttrException,
- XmlTagException {
- if (tag instanceof XmlTagEntryHandler) {
- ((XmlTagEntryHandler) tag).enter();
- }
-
- if (tag instanceof XmlFilterHandler) {
- filter = (XmlFilterHandler) tag;
- }
-
- XmlParser.checkAttributes(elem, tag, filter);
- if (tag instanceof XmlTextHandler) {
- ((XmlTextHandler) tag).handleText(elem.getText());
- }
-
- XmlParser.checkSubNodes(elem, tag, filter);
-
- if (tag instanceof XmlTagExitHandler) {
- ((XmlTagExitHandler) tag).exit();
- }
- }
-
- private static class DummyFilter implements XmlFilterHandler {
- public String filterAttrValue(XmlTagHandler tag, String attrName, String
attrValue) {
- return attrValue;
- }
- }
-
- /**
- * Parse an input stream, otherwise the same as parsing a file
- */
- public static void parse(InputStream is, XmlTagHandler tag) throws XmlParseException
{
- parse(is, tag, null);
- }
-
- public static void parse(InputStream is, XmlTagHandler tag, EntityResolver resolver)
throws XmlParseException {
- SAXBuilder builder;
- Document doc;
-
- builder = new SAXBuilder();
-
- if (resolver != null) {
- builder.setEntityResolver(resolver);
- }
-
- try {
- if (resolver != null) {
- //WTF? seems relative entity URIs are allowed
- //by certain xerces impls. but fully qualified
- //file://... URLs trigger a NullPointerException
- //in others. setting base here worksaround
- doc = builder.build(is, "");
- } else {
- doc = builder.build(is);
- }
- } catch (Exception e) {
- throw new XmlParseException(e.getMessage());
- }
-
- generalParse(tag, doc);
- }
-
- /**
- * Parse a file, which should have a root which is the associated tag.
- *
- * @param in File to parse
- * @param tag Root tag which the parsed file should contain
- */
- public static void parse(File in, XmlTagHandler tag) throws XmlParseException {
- // JON: JDOM has a problem passing in a File that has spaces in dir name
- // (it escapes " " with "%20" and bombs out.
- // let's get the input stream ourselves and pass it to our parse() method
that takes a stream
- try {
- InputStream is = new java.io.BufferedInputStream(new
java.io.FileInputStream(in));
- parse(is, tag);
- } catch (java.io.FileNotFoundException exc) {
- throw new XmlParseException(exc.getMessage());
- }
- }
-
- /**
- * General parsing used by both parse methods above
- */
- private static void generalParse(XmlTagHandler tag, Document doc) throws
XmlParseException {
- Element root = doc.getRootElement();
- if (!root.getName().equalsIgnoreCase(tag.getName())) {
- throw new XmlParseException("Incorrect root tag. Expected <" +
tag.getName() + "> but got <"
- + root.getName() + ">");
- }
-
- XmlParser.processNode(root, tag, new DummyFilter());
- }
-
- private static void dumpAttrs(XmlAttr[] attrs, String typeName, int type, PrintStream
out, int indent) {
- String printMsg;
- boolean printed = false;
- int lineBase;
- int lineLen;
-
- if (attrs.length == 0) {
- return;
- }
-
- lineLen = 0;
- printMsg = "- Has " + typeName + " attributes: ";
- lineBase = indent + printMsg.length();
-
- // Required attributes
- for (int i = 0; i < attrs.length; i++) {
- String toPrint;
-
- if (attrs[i].getType() != type) {
- continue;
- }
-
- if (!printed) {
- toPrint = StringUtil.repeatChars(' ', indent) + "- Has
" + typeName + " attributes: ";
- out.print(toPrint);
- lineLen = toPrint.length();
- printed = true;
- }
-
- toPrint = attrs[i].getName() + ", ";
- lineLen += toPrint.length();
- out.print(toPrint);
- if (lineLen > 70) {
- out.println();
- out.print(StringUtil.repeatChars(' ', lineBase));
- lineLen = lineBase;
- }
- }
-
- if (printed) {
- out.println();
- }
- }
-
- private static void dumpNode(XmlTagHandler tag, PrintStream out, int indent) throws
XmlTagException {
- out.println(StringUtil.repeatChars(' ', indent) + "Tag <" +
tag.getName() + ">:");
- if (tag instanceof XmlAttrHandler) {
- XmlAttr[] attrs;
-
- attrs = ((XmlAttrHandler) tag).getAttributes();
- if (attrs.length == 0) {
- out.println(StringUtil.repeatChars(' ', indent) + "- has no
required or optional attributes");
- }
-
- XmlParser.dumpAttrs(attrs, "REQUIRED", XmlAttr.REQUIRED, out,
indent);
- XmlParser.dumpAttrs(attrs, "OPTIONAL", XmlAttr.OPTIONAL, out,
indent);
- } else {
- out.println(StringUtil.repeatChars(' ', indent) + "- has no
required or optional attributes");
- }
-
- if (tag instanceof XmlUnAttrHandler) {
- out.println(StringUtil.repeatChars(' ', indent) + "- handles
arbitrary attributes");
- }
-
- XmlTagInfo[] subTags = tag.getSubTags();
- if (subTags.length == 0) {
- out.println(StringUtil.repeatChars(' ', indent) + "- has no
subtags");
- } else {
- for (int i = 0; i < subTags.length; i++) {
- String name = subTags[i].getTag().getName();
- int type = subTags[i].getType();
-
- out.print(StringUtil.repeatChars(' ', indent) + "- has
subtag <" + name + ">, which ");
- switch (type) {
- case XmlTagInfo.REQUIRED: {
- out.println("is REQUIRED");
- break;
- }
-
- case XmlTagInfo.OPTIONAL: {
- out.println("is OPTIONAL");
- break;
- }
-
- case XmlTagInfo.ONE_OR_MORE: {
- out.println("is REQUIRED at least ONCE");
- break;
- }
-
- case XmlTagInfo.ZERO_OR_MORE: {
- out.println("can be specified any # of times");
- break;
- }
- }
-
- XmlParser.dumpNode(subTags[i].getTag(), out, indent + 4);
- }
- }
- }
-
- public static void dump(XmlTagHandler root, PrintStream out) {
- try {
- XmlParser.dumpNode(root, out, 0);
- } catch (XmlTagException exc) {
- out.println("Error traversing tags: " + exc.getMessage());
- }
- }
-
- private static String bold(String text) {
- return "<emphasis role=\"bold\">" + text +
"</emphasis>";
- }
-
- private static String tag(String name) {
- return bold("<" + name + ">");
- }
-
- private static String listitem(String name, String desc) {
- String item = "<listitem><para>" + name +
"</para>";
- if (desc != null) {
- item += "<para>" + desc + "</para>";
- }
-
- return item;
- }
-
- private static void dumpAttrsSGML(XmlAttr[] attrs, String typeName, int type,
PrintStream out, int indent) {
- boolean printed = false;
- if (attrs.length == 0) {
- return;
- }
-
- // Required attributes
- for (int i = 0; i < attrs.length; i++) {
- if (attrs[i].getType() != type) {
- continue;
- }
-
- if (!printed) {
- out.println(StringUtil.repeatChars(' ', indent) +
"<itemizedlist><listitem><para>" + typeName
- + " attributes: </para>\n" +
StringUtil.repeatChars(' ', indent) + "<itemizedlist>");
- printed = true;
- }
-
- out.println(StringUtil.repeatChars(' ', indent) +
listitem(bold(attrs[i].getName()), null) + "</listitem>");
- }
-
- if (printed) {
- out.println(StringUtil.repeatChars(' ', indent) +
"</itemizedlist></listitem></itemizedlist>");
- }
- }
-
- private static void dumpNodeSGML(XmlTagHandler tag, PrintStream out, int indent)
throws XmlTagException {
- if (indent == 0) {
- out.println(StringUtil.repeatChars(' ', indent) +
"<para>Tag " + tag(tag.getName()) + ":</para>");
- }
-
- if (tag instanceof XmlAttrHandler) {
- XmlAttr[] attrs;
-
- attrs = ((XmlAttrHandler) tag).getAttributes();
-
- dumpAttrsSGML(attrs, bold("REQUIRED"), XmlAttr.REQUIRED, out,
indent);
- dumpAttrsSGML(attrs, bold("OPTIONAL"), XmlAttr.OPTIONAL, out,
indent);
- }
-
- XmlTagInfo[] subTags = tag.getSubTags();
- if (subTags.length != 0) {
- out.println(StringUtil.repeatChars(' ', indent) +
"<itemizedlist>");
-
- for (int i = 0; i < subTags.length; i++) {
- String name = subTags[i].getTag().getName();
- int type = subTags[i].getType();
- String desc = "";
-
- switch (type) {
- case XmlTagInfo.REQUIRED: {
- desc = "REQUIRED";
- break;
- }
-
- case XmlTagInfo.OPTIONAL: {
- desc = "OPTIONAL";
- break;
- }
-
- case XmlTagInfo.ONE_OR_MORE: {
- desc = "REQUIRED at least ONCE";
- break;
- }
-
- case XmlTagInfo.ZERO_OR_MORE: {
- desc = "can be specified any # of times";
- break;
- }
- }
-
- out.print(StringUtil.repeatChars(' ', indent) +
listitem("Sub Tag " + tag(name) + " " + desc, null));
-
- dumpNodeSGML(subTags[i].getTag(), out, indent + 4);
- out.println(StringUtil.repeatChars(' ', indent) +
"</listitem>");
- }
-
- out.println(StringUtil.repeatChars(' ', indent) +
"</itemizedlist>");
- }
- }
-
- public static void dumpSGML(XmlTagHandler root, PrintStream out) {
- try {
- dumpNodeSGML(root, out, 0);
- } catch (XmlTagException exc) {
- out.println("Error traversing tags: " + exc.getMessage());
- }
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java
deleted file mode 100644
index b4b2205..0000000
---
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlRequiredAttrException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * This exception is thrown when a tag is missing a required attribute.
- */
-
-public class XmlRequiredAttrException extends XmlAttrException {
- XmlRequiredAttrException(Element e, String reqAttr) {
- super("Tag <" + e.getName() + "> requires attribute
'" + reqAttr + "'");
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.java
deleted file mode 100644
index fc19a85..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagEntryHandler.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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * Classes which wish to be notified when the parser has entered the parsing of the tag
should implement this interface.
- * Enter is called prior to any validation of attributes or subtags.
- */
-
-public interface XmlTagEntryHandler {
- public void enter();
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java
deleted file mode 100644
index 0160677..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagException.java
+++ /dev/null
@@ -1,33 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * A base-class for other tag based exceptions.
- */
-
-public class XmlTagException extends XmlParseException {
- public XmlTagException(String s) {
- super(s);
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.java
deleted file mode 100644
index dea7e37..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagExitHandler.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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * Classes which wish to be notified when the parser has exited the parsing of the tag
should implement this interface.
- * Exit is called after all attributes and subtags have been processed.
- */
-
-public interface XmlTagExitHandler {
- public void exit() throws XmlTagException;
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java
deleted file mode 100644
index c1ee9fd..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagHandler.java
+++ /dev/null
@@ -1,44 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * The major interface which all objects wishing to use XmlParser must implement. The
TagHander provides information
- * about the tags name, and which subtags are valid.
- */
-public interface XmlTagHandler {
- /**
- * Retrieve the name of the tag, without angled brackets. (i.e. "foo" for
tags named <foo>)
- *
- * @return The name of the tag
- */
- public String getName();
-
- /**
- * Retrieve information about which subtags are valid within the given tag. This
method will only be called once for
- * each object.
- *
- * @return An array of tag information objects, indicating which subtags are valid.
- */
- public XmlTagInfo[] getSubTags();
-}
\ No newline at end of file
diff --git a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java
deleted file mode 100644
index cb6b494..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTagInfo.java
+++ /dev/null
@@ -1,62 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * This class is used to describe which subtags a given tag supports. The object has a
'tag', which will be traversed
- * to, and a validity requirement, indicating if the subtag must exist in the tag, is
optional, is valid one or more
- * times, or is valid zero or more times.
- */
-
-public class XmlTagInfo {
- public static final int REQUIRED = 0;
- public static final int OPTIONAL = 1;
- public static final int ONE_OR_MORE = 2;
- public static final int ZERO_OR_MORE = 3;
-
- private XmlTagHandler tag;
- private int type;
-
- /**
- * Create a new tag info object with the specified tag and type.
- *
- * @param tag The sub tag which will be traversed to
- * @param type One of REQUIRED, OPTIONAL, ONE_OR_MORE, ZERO_OR_MORE
- */
- public XmlTagInfo(XmlTagHandler tag, int type) {
- this.tag = tag;
- this.type = type;
-
- if ((type < REQUIRED) || (type > ZERO_OR_MORE)) {
- throw new IllegalArgumentException("Unknown type: " + type);
- }
- }
-
- XmlTagHandler getTag() {
- return this.tag;
- }
-
- int getType() {
- return this.type;
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java
deleted file mode 100644
index 6c0e4fd..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTextHandler.java
+++ /dev/null
@@ -1,27 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-public interface XmlTextHandler {
- public void handleText(String text);
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java
deleted file mode 100644
index 6cafff5..0000000
---
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlTooManyTagException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * This exception is thrown if a subtag is found too many times within a tag. It can be
thrown if an unknown subtag was
- * found, or if the requirement of the subtag was exceeded.
- */
-public class XmlTooManyTagException extends XmlTagException {
- XmlTooManyTagException(Element e, String reqTag) {
- super("<" + e.getName() + "> tag contains too many
<" + reqTag + "> subtags");
- }
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.java
deleted file mode 100644
index 5185176..0000000
--- a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnAttrHandler.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, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-/**
- * This interface must be implemented for a class to handle unknown attributes (i.e
attributes not declared in the
- * AttrHandler)
- */
-
-public interface XmlUnAttrHandler {
- public void handleUnknownAttribute(String name, String value);
-}
\ No newline at end of file
diff --git
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java
b/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java
deleted file mode 100644
index 91d8135..0000000
---
a/modules/core/util/src/main/java/org/rhq/core/util/xmlparser/XmlUnknownAttrException.java
+++ /dev/null
@@ -1,35 +0,0 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-package org.rhq.core.util.xmlparser;
-
-import org.jdom.Element;
-
-/**
- * This exception is thrown when an unknown attribute is encountered.
- */
-
-public class XmlUnknownAttrException extends XmlAttrException {
- XmlUnknownAttrException(Element e, String attr) {
- super("<" + e.getName() + "> contains an unknown attribute,
'" + attr + "'");
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
index ff43a66..f0ef562 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/LinkManager.java
@@ -330,14 +330,6 @@ public class LinkManager {
return "/rhq/admin/downloads.xhtml";
}
- public static String getAdminLicenseLink() {
- if (GWT) {
- return "#Administration/Configuration/License";
- } else {
- return "/admin/license/LicenseAdmin.do?mode=view";
- }
- }
-
public static String getDebugSqlLink() {
return "/admin/test/sql.jsp";
}
diff --git
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
index 6e8da99..57bcb1c 100644
---
a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
+++
b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java
@@ -67,7 +67,6 @@ public class AdministrationView extends
AbstractSectionedLeftNavigationView {
.view_adminConfig_systemSettings());
public static final ViewName PAGE_TEMPLATES_VIEW_ID = new
ViewName("Templates", MSG.view_adminConfig_templates());
private static final ViewName PAGE_DOWNLOADS_VIEW_ID = new
ViewName("Downloads", MSG.view_adminConfig_downloads());
- private static final ViewName PAGE_LICENSE_VIEW_ID = new
ViewName("License", MSG.view_adminConfig_license());
private static final ViewName PAGE_PLUGINS_VIEW_ID = new
ViewName("Plugins", MSG.view_adminConfig_plugins());
// TODO these iframe page view ids should go away in favor of the gwt view page
view_id, when available
@@ -199,14 +198,6 @@ public class AdministrationView extends
AbstractSectionedLeftNavigationView {
}
});
- NavigationItem licenseItem = new NavigationItem(PAGE_LICENSE_VIEW_ID,
"subsystems/bundle/Details_11.png",
- new ViewFactory() {
- public Canvas createView() {
- return new
FullHTMLPane(extendLocatorId(PAGE_LICENSE_VIEW_ID.getName()),
-
"/admin/license/LicenseAdmin.do?mode=view&nomenu=true");
- }
- });
-
NavigationItem pluginsItem = new NavigationItem(PAGE_PLUGINS_VIEW_ID,
"global/Plugin_16.png",
new ViewFactory() {
public Canvas createView() {
@@ -216,7 +207,7 @@ public class AdministrationView extends
AbstractSectionedLeftNavigationView {
});
return new NavigationSection(SECTION_CONFIGURATION_VIEW_ID, systemSettingsItem,
templatesItem, downloadsItem,
- licenseItem, pluginsItem);
+ pluginsItem);
}
private NavigationSection buildContentSection() {
diff --git
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
index ff8d7bd..6ab3ce6 100644
---
a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
+++
b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties
@@ -525,7 +525,6 @@ view_adminTopology_remoteAgentInstall = Remote Agent Install
view_adminTopology_servers = Servers
view_adminConfig_downloads = Downloads
-view_adminConfig_license = License
view_adminConfig_plugins = Plugins
view_adminConfig_systemSettings = System Settings
view_adminConfig_templates = Templates
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java
deleted file mode 100644
index fd2c7f9..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseController.java
+++ /dev/null
@@ -1,99 +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.gui.action.license;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.servlet.http.HttpSession;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-import org.apache.struts.tiles.ComponentContext;
-import org.apache.struts.tiles.actions.TilesAction;
-
-import org.rhq.enterprise.gui.legacy.WebUser;
-import org.rhq.enterprise.gui.legacy.util.RequestUtils;
-import org.rhq.enterprise.gui.legacy.util.SessionUtils;
-import org.rhq.enterprise.server.license.License;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * Created by IntelliJ IDEA. User: ghinkle Date: Aug 5, 2005 Time: 9:41:08 AM To change
this template use File |
- * Settings | File Templates.
- */
-public class LicenseController extends TilesAction {
- private static final Log log =
LogFactory.getLog(org.rhq.enterprise.gui.action.license.LicenseController.class
- .getName());
-
- public static final String LICENSE = "license";
-
- @Override
- public ActionForward execute(ComponentContext context, ActionMapping mapping,
ActionForm form,
- HttpServletRequest request, HttpServletResponse response) throws Exception {
- ServletContext ctx = getServlet().getServletContext();
-
- HttpSession session = request.getSession();
-
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
-
- WebUser user = SessionUtils.getWebUser(session);
- request.setAttribute("userId", user.getId());
-
- License license = null;
- /*try
- *{*/
- license = systemManager.getLicense();
-
- // no license exists
- if (license == null) {
- RequestUtils.setError(request, "admin.license.LicenseNotLoaded");
-
- // license exists, but is expired
- } else if (license.getLicenseExpiration() < System.currentTimeMillis()) {
- RequestUtils.setError(request, "admin.license.LicenseExpired");
- }
-
- if (request.getParameter("update") != null) {
- RequestUtils.setConfirmation(request,
"admin.license.confirm.LicenseUpdated");
- }
-
- request.setAttribute(LICENSE, license);
-
- // TODO GH: Fix the rest of this
- /*}
- * catch (UpdateTrialLicenseException tlue) {
- */
- /*
- * can't perform an update with trial licenses unless you're
reinstalling, using the same one, and the trial
- * hasn't expired yet; thus, don't set the request attribute here
- */
- /*
- * RequestUtils.setError(request,
"admin.license.error.TrialLicenseNotUpdated"); } catch
- * (CorruptLicenseException cle) { RequestUtils.setError(request,
"admin.license.error.LicenseCorrupt"); } catch
- * (UnavailableLicenseException ule) { // the backing store was unavailable, let
them use it, set the license
- * attrib request.setAttribute(LICENSE, license);} */
-
- return null;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java
deleted file mode 100644
index bf860db..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseForm.java
+++ /dev/null
@@ -1,57 +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.gui.action.license;
-
-import org.apache.struts.upload.FormFile;
-import org.rhq.enterprise.gui.legacy.action.BaseValidatorForm;
-
-/**
- * Created by IntelliJ IDEA. User: ghinkle Date: Aug 15, 2005 Time: 2:25:26 PM To change
this template use File |
- * Settings | File Templates.
- */
-public class LicenseForm extends BaseValidatorForm {
- FormFile licenseFile;
-
- String portalUsername;
- String portalPassword;
-
- public FormFile getLicenseFile() {
- return licenseFile;
- }
-
- public void setLicenseFile(FormFile licenseFile) {
- this.licenseFile = licenseFile;
- }
-
- public String getPortalUsername() {
- return portalUsername;
- }
-
- public void setPortalUsername(String portalUsername) {
- this.portalUsername = portalUsername;
- }
-
- public String getPortalPassword() {
- return portalPassword;
- }
-
- public void setPortalPassword(String portalPassword) {
- this.portalPassword = portalPassword;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java
deleted file mode 100644
index d0d40d5..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicensePortalAction.java
+++ /dev/null
@@ -1,123 +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.gui.action.license;
-
-import java.util.HashMap;
-import java.util.Properties;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-
-import org.rhq.core.domain.authz.Permission;
-import org.rhq.enterprise.gui.legacy.Constants;
-import org.rhq.enterprise.gui.legacy.Portal;
-import org.rhq.enterprise.gui.legacy.action.BaseDispatchAction;
-import org.rhq.enterprise.gui.legacy.exception.ParameterNotFoundException;
-import org.rhq.enterprise.gui.legacy.util.ActionUtils;
-import org.rhq.enterprise.gui.legacy.util.BizappUtils;
-import org.rhq.enterprise.gui.legacy.util.RequestUtils;
-import org.rhq.enterprise.gui.legacy.util.SessionUtils;
-import org.rhq.enterprise.server.authz.PermissionException;
-
-/**
- * Created by IntelliJ IDEA. User: ghinkle Date: Aug 8, 2005 Time: 10:34:55 AM To change
this template use File |
- * Settings | File Templates.
- */
-public class LicensePortalAction extends BaseDispatchAction {
- private static final String TITLE_VIEW = "admin.license.ViewLicenseTitle";
- private static final String PORTLET_VIEW = ".admin.license.View";
-
- private static final String TITLE_EDIT = "admin.license.EditLicenseTitle";
- private static final String PORTLET_EDIT = ".admin.license.Edit";
-
- protected static Log log = LogFactory.getLog(LicensePortalAction.class.getName());
-
- private static Properties keyMethodMap = new Properties();
-
- static {
- keyMethodMap.setProperty(Constants.MODE_VIEW, "viewLicense");
- keyMethodMap.setProperty(Constants.MODE_EDIT, "editLicense");
- }
-
- @Override
- protected Properties getKeyMethodMap() {
- return keyMethodMap;
- }
-
- public ActionForward viewLicense(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
- HttpServletResponse response) throws Exception {
-
- setReturnPath(request, mapping, Constants.MODE_VIEW);
-
- Portal portal = Portal.createPortal(TITLE_VIEW, PORTLET_VIEW);
- portal.setWorkflowPortal(false);
- request.setAttribute(Constants.PORTAL_KEY, portal);
-
- return null;
- }
-
- public ActionForward editLicense(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- if (!BizappUtils.hasPermission(request, Permission.MANAGE_SETTINGS)) {
- throw new PermissionException("User not authorized to update the
license");
- }
-
- setReturnPath(request, mapping, Constants.MODE_VIEW);
-
- Portal portal = Portal.createPortal(TITLE_EDIT, PORTLET_EDIT);
- portal.setWorkflowPortal(false);
- request.setAttribute(Constants.PORTAL_KEY, portal);
-
- if (request.getParameter("error") != null) {
- RequestUtils.setError(request, "admin.license.error.NotUpdated");
- }
-
- return null;
- }
-
- /**
- * Set the return path for the current action, including the mode and (if necessary)
user id request parameters.
- *
- * @param request The request to get the session to store the return path into.
- * @param mapping The ActionMapping to get the return path from.
- * @param mode The name of the current display mode.
- */
- protected void setReturnPath(HttpServletRequest request, ActionMapping mapping,
String mode) throws Exception {
- HashMap params = new HashMap();
- params.put(Constants.MODE_PARAM, mode);
- try {
- params.put(Constants.USER_PARAM, RequestUtils.getUserId(request));
- } catch (ParameterNotFoundException e) {
- ; // not in a specific user's context
- }
-
- String returnPath = ActionUtils.findReturnPath(mapping, params);
- if (log.isTraceEnabled()) {
- log.trace("setting return path: " + returnPath);
- }
-
- SessionUtils.setReturnPath(request.getSession(), returnPath);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java
deleted file mode 100644
index f57f7e4..0000000
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/action/license/LicenseUpdateAction.java
+++ /dev/null
@@ -1,117 +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.gui.action.license;
-
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.struts.action.ActionForm;
-import org.apache.struts.action.ActionForward;
-import org.apache.struts.action.ActionMapping;
-
-import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.authz.Permission;
-import org.rhq.enterprise.gui.legacy.action.BaseAction;
-import org.rhq.enterprise.gui.legacy.util.ContextUtils;
-import org.rhq.enterprise.gui.legacy.util.RequestUtils;
-import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
-import org.rhq.enterprise.server.license.CorruptLicenseException;
-import org.rhq.enterprise.server.license.LicenseManager;
-import org.rhq.enterprise.server.license.UnavailableLicenseException;
-import org.rhq.enterprise.server.license.UpdateTrialLicenseException;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
-
-/**
- * This action receives an updated license file through form submission and saves it out
to the appropriate places in
- * the filesystem and then reloads the license manager system. License updates take force
immediately.
- *
- * @author Greg Hinkle
- */
-public class LicenseUpdateAction extends BaseAction {
- static Log log = LogFactory.getLog(LicenseUpdateAction.class.getName());
-
- // ---------------------------------------------------- Public Methods
-
- /**
- * Updates the installed license files on disk and invokes the LicenseManager's
initialization routines to immediate
- * provide workable access to the application.
- */
- @Override
- public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
- HttpServletResponse response) throws Exception {
- LicenseForm licenseForm = (LicenseForm) form;
-
- if (licenseForm.isCancelClicked()) {
- return returnCancelled(request, mapping);
- } else if (licenseForm.isResetClicked()) {
- return returnReset(request, mapping);
- } else if (licenseForm.isOkClicked()) {
- Subject subject = RequestUtils.getSubject(request);
- AuthorizationManagerLocal authzManager =
LookupUtil.getAuthorizationManager();
- if (!authzManager.hasGlobalPermission(subject, Permission.MANAGE_SETTINGS))
{
- log.error("License file can only be updated by users who have
permission to manage server settings");
- return returnFailure(request, mapping);
- }
-
- if ((licenseForm.licenseFile.getFileData() == null) ||
(licenseForm.licenseFile.getFileData().length == 0)) {
- return returnFailure(request, mapping);
- }
-
- log.debug("Updating license with uploaded file.");
-
- /*
- * Check to see if the license is valid, which means also checking whether
it's valid with respect to any
- * license that may already be in the backing store.
- */
- InputStream is = new
ByteArrayInputStream(licenseForm.licenseFile.getFileData());
- try {
- LicenseManager.checkLicense(is);
- } catch (CorruptLicenseException cle) {
- log.error("License file is corrupt or not in sync with previous
records");
- return returnFailure(request, mapping);
- } catch (UpdateTrialLicenseException tlue) {
- log.error("Licenses can not be updated by trial licenses");
- return returnFailure(request, mapping);
- } catch (UnavailableLicenseException ule) {
- log.error("Backing store unavailable, allowing license to be written
to disk unconditionally");
- } catch (Exception e) {
- log.error("Unable to update license file", e);
- return returnFailure(request, mapping);
- }
-
- log.debug("Uploaded license file validated");
-
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
-
- systemManager.updateLicense(subject, licenseForm.licenseFile.getFileData());
-
- RequestUtils.setConfirmation(request,
"admin.license.confirm.LicenseUpdated");
-
- ContextUtils.updateMonitoringEnabled(getServlet().getServletContext());
- }
-
- return returnSuccess(request, mapping);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
index 19d7bd3..ce44bb3 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/authentication/AuthenticateUserAction.java
@@ -38,7 +38,6 @@ import org.apache.struts.tiles.actions.TilesAction;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.core.domain.configuration.Configuration;
-import org.rhq.enterprise.gui.legacy.AttrConstants;
import org.rhq.enterprise.gui.legacy.Constants;
import org.rhq.enterprise.gui.legacy.WebUser;
import org.rhq.enterprise.gui.legacy.util.SessionUtils;
@@ -157,8 +156,6 @@ public class AuthenticateUserAction extends TilesAction {
session.setAttribute(Constants.PASSWORD_SES_ATTR,
logonForm.getJ_password());
}
- updateMonitoringEnabled(ctx);
-
return af;
}
@@ -215,18 +212,4 @@ public class AuthenticateUserAction extends TilesAction {
return (provider != null) &&
provider.equals(RHQConstants.LDAPJAASProvider);
}
-
- /**
- * Returns <code>true</code> if the RHQ Server's monitoring
capabilities has been enabled. A servlet context
- * attribute "monitorEnabled" is also set to this method's return
value.
- *
- * @param context
- *
- * @return <code>true</code> if all monitoring capabilities are allowed
- */
- public static boolean updateMonitoringEnabled(ServletContext context) {
- boolean enabled = LookupUtil.getSystemManager().isMonitoringEnabled();
- context.setAttribute(AttrConstants.MONITOR_ENABLED, Boolean.valueOf(enabled));
- return enabled;
- }
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
index 6c87a4f..3303617 100755
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AttrConstants.java
@@ -792,16 +792,6 @@ public interface AttrConstants {
public static final String MONITOR_CONFIG_OPTIONS =
"monitorConfigOptions";
/**
- * Servlet context attribute indicating whether the installed RHQ license enables
monitoring features.
- */
- public static final String MONITOR_ENABLED = "monitorEnabled";
-
- /**
- * Request attribute indicating whether monitoring is enabled for a resource.
- */
- public static final String MONITOR_ENABLED_ATTR = "monitorEnabledAttr";
-
- /**
* Request attribute to hold monitoring help text
*/
public static final String MONITOR_HELP = "monitorHelp";
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
index c30f7ce..8743a33 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/AuthenticationFilter.java
@@ -38,10 +38,6 @@ import org.rhq.enterprise.gui.legacy.util.SessionUtils;
import org.rhq.enterprise.server.auth.SessionManager;
import org.rhq.enterprise.server.auth.SessionNotFoundException;
import org.rhq.enterprise.server.auth.SessionTimeoutException;
-import org.rhq.enterprise.server.license.License;
-import org.rhq.enterprise.server.system.LicenseException;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
public final class AuthenticationFilter extends BaseFilter {
@@ -106,25 +102,6 @@ public final class AuthenticationFilter extends BaseFilter {
response.sendRedirect(request.getContextPath() + "/Login.do");
}
} else {
- // Now check if the license is up and running
- if (request.getRequestURI().indexOf("/admin/license") < 0) {
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- License license = null;
- try {
- license = systemManager.getLicense();
- } catch (LicenseException le) {
- /*
- * license will still be null because the exception is thrown out of
azboss.getLicense()
- * LicenseAdmin.do will take care of showing the appropriate
exception by delegating to
- * LicenseController
- */
- }
-
- if ((license == null) || (license.getLicenseExpiration() <
System.currentTimeMillis())) {
- response.sendRedirect(request.getContextPath() +
"/admin/license/LicenseAdmin.do?mode=view");
- }
- }
-
try {
chain.doFilter(request, response);
} catch (IOException e) {
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
index 3cb6ae7..73da3d7 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/DetermineLocationAction.java
@@ -20,14 +20,15 @@ package org.rhq.enterprise.gui.legacy.action.resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
+
import org.rhq.enterprise.gui.legacy.ParamConstants;
import org.rhq.enterprise.gui.legacy.action.BaseAction;
import org.rhq.enterprise.gui.legacy.util.RequestUtils;
import org.rhq.enterprise.gui.util.WebUtility;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* An <code>Action</code> that forwards a request to view a resource or group
on to the appropriate default action.
@@ -66,9 +67,9 @@ public class DetermineLocationAction extends BaseAction {
throw new IllegalArgumentException("Unknown type '" + type +
"' was passed to DetermineLocationAction");
}
- if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
- forwardConfigName += "-inventory";
- }
+ // if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ // forwardConfigName += "-inventory";
+ // }
return mapping.findForward(forwardConfigName);
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
index 823a2a8..37d2046 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/VisibilityPortalAction.java
@@ -33,7 +33,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionRedirect;
import org.rhq.enterprise.gui.legacy.AttrConstants;
import org.rhq.enterprise.gui.legacy.KeyConstants;
@@ -46,7 +45,6 @@ import
org.rhq.enterprise.gui.legacy.exception.ParameterNotFoundException;
import org.rhq.enterprise.gui.legacy.util.ActionUtils;
import org.rhq.enterprise.gui.legacy.util.SessionUtils;
import org.rhq.enterprise.gui.util.WebUtility;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* A <code>BaseDispatchAction</code> that sets up common monitor portals.
@@ -116,12 +114,12 @@ public class VisibilityPortalAction extends
ResourceVisibilityPortalAction {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) throws Exception {
ActionForward fwd = super.execute(mapping, form, request, response);
- if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
- ActionRedirect redirect = new
ActionRedirect(mapping.findForward("inventory-jsf"));
- redirect.addParameter("id", request.getParameter("id"));
- redirect.setRedirect(false);
- fwd = redirect;
- }
+ // if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ // ActionRedirect redirect = new
ActionRedirect(mapping.findForward("inventory-jsf"));
+ // redirect.addParameter("id",
request.getParameter("id"));
+ // redirect.setRedirect(false);
+ // fwd = redirect;
+ // }
return fwd;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
index 18183ac..0a5c133 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/common/monitor/config/ConfigMetricsFormPrepareAction.java
@@ -107,7 +107,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
}
measurementSchedules = new
PageList<MeasurementScheduleComposite>(composites, definitions.size(),
pageControl);
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, Boolean.FALSE);
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, Boolean.FALSE);
ResourceType rType = rtManager.getResourceTypeById(subject, resourceTypeId);
request.setAttribute(AttrConstants.RESOURCE_TYPE_ATTR, rType);
@@ -115,7 +115,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
} else {
int resourceId = WebUtility.getOptionalIntRequestParameter(request,
"id", -1);
if ((parent > 0) && (type > 0)) {
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true);
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true);
measurementSchedules =
scheduleManager.getMeasurementScheduleCompositesByContext(subject, EntityContext
.forAutoGroup(parent, type), pageControl);
@@ -126,7 +126,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
request.setAttribute("parentName", parentRes.getName());
} else if (resourceId > 0) {
boolean monitoringConfigured = isMonitoringConfigured(resourceId);
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR,
monitoringConfigured);
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR,
monitoringConfigured);
if (monitoringConfigured) {
log.debug("Obtaining metric schedules for resource " +
resourceId + "...");
measurementSchedules =
scheduleManager.getMeasurementScheduleCompositesByContext(subject,
@@ -134,7 +134,7 @@ public class ConfigMetricsFormPrepareAction extends TilesAction {
}
} else if (groupId > 0) {
boolean monitoringConfigured = true; //
isMonitoringConfiguredForGroup(groupId); // TODO implement the method, see below
- request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true); // TODO
change true -> monitoringConfigured
+ //request.setAttribute(AttrConstants.MONITOR_ENABLED_ATTR, true); // TODO
change true -> monitoringConfigured
if (monitoringConfigured) {
log.debug("Obtaining metric schedules for comp group " +
groupId + "...");
measurementSchedules =
scheduleManager.getMeasurementScheduleCompositesByContext(subject,
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
index fad2f78..57b55f5 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/action/resource/group/monitor/GroupVisibilityPortalAction.java
@@ -28,7 +28,6 @@ import org.apache.commons.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
-import org.apache.struts.action.ActionRedirect;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.resource.composite.ResourceWithAvailability;
@@ -94,13 +93,13 @@ public class GroupVisibilityPortalAction extends GroupController {
HttpServletResponse response) throws Exception {
ActionForward fwd = super.execute(mapping, form, request, response);
- if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
- ActionRedirect redirect = new
ActionRedirect(mapping.findForward("inventory-jsf"));
- redirect.addParameter("groupId",
request.getParameter("groupId"));
- redirect.addParameter("category",
request.getParameter("category"));
- redirect.setRedirect(false);
- fwd = redirect;
- }
+ // if (!LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ // ActionRedirect redirect = new
ActionRedirect(mapping.findForward("inventory-jsf"));
+ // redirect.addParameter("groupId",
request.getParameter("groupId"));
+ // redirect.addParameter("category",
request.getParameter("category"));
+ // redirect.setRedirect(false);
+ // fwd = redirect;
+ // }
return fwd;
}
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
index aaa7aae..fd42a3c 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/LicenseExpirationTag.java
@@ -18,66 +18,16 @@
*/
package org.rhq.enterprise.gui.legacy.taglib;
-import java.io.IOException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
import javax.servlet.jsp.JspException;
-import javax.servlet.jsp.JspTagException;
import javax.servlet.jsp.tagext.TagSupport;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
-import org.rhq.enterprise.server.util.LookupUtil;
+@Deprecated
public class LicenseExpirationTag extends TagSupport {
- private static long lastRead = 0;
- private static String expiration = null;
-
- public static final long MILLIS_IN_DAY = 1000 * 60 * 60 * 24;
- public static final long WARN_EXPIRE_DAYS = 30;
- public static final long REFRESH_MILLIS = 1000 * 60 * 60;
-
- public static final SimpleDateFormat DFORMAT = new SimpleDateFormat("MMMM dd,
yyyy");
-
- public static final String PREFIX = "<tr>" + "\n <td
colspan=\"9\" class=\"FooterRegular\">";
- public static final String SUFFIX = " <a
href=\"http://www.jboss.com\">Contact "
- + "JBoss</a> to renew your license!</td>\n</tr>";
-
public LicenseExpirationTag() {
super();
}
- private String loadExpiration() {
- long now = System.currentTimeMillis();
- if ((expiration != null) && ((now - lastRead) < REFRESH_MILLIS)) {
- return expiration;
- }
-
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- Date expiresDate = systemManager.getExpiration();
-
- if (expiresDate == null) {
- // No expiration
- return "";
- }
-
- long numDays = (expiresDate.getTime() - now) / MILLIS_IN_DAY;
- if (numDays > WARN_EXPIRE_DAYS) {
- return "";
- }
-
- if (numDays <= 0) {
- return PREFIX + "LICENSE EXPIRES TODAY!" + SUFFIX;
- } else {
- return PREFIX + "LICENSE EXPIRES IN " + numDays + " DAYS (on
" + DFORMAT.format(expiresDate) + ")" + SUFFIX;
- }
- }
-
public final int doStartTag() throws JspException {
- try {
- pageContext.getOut().write(loadExpiration());
- } catch (IOException e) {
- throw new JspTagException(e.toString());
- }
-
return SKIP_BODY;
}
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
index db96f03..56080ff 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/GroupQuicknavDecorator.java
@@ -31,7 +31,6 @@ import
org.rhq.core.domain.resource.group.composite.ResourceGroupComposite;
import org.rhq.core.gui.util.UrlUtility;
import org.rhq.enterprise.gui.legacy.HubConstants;
import org.rhq.enterprise.server.resource.ResourceFacetsCache;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* A {@link QuicknavDecorator} for {@link ResourceGroup}s.
@@ -127,7 +126,7 @@ public class GroupQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isMonitorAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; // LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
@@ -152,7 +151,7 @@ public class GroupQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isAlertAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; //LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
index 93e4d2e..ba7e44e 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/taglib/display/ResourceQuicknavDecorator.java
@@ -26,7 +26,6 @@ import org.rhq.core.domain.resource.composite.ResourceComposite;
import org.rhq.core.domain.resource.composite.ResourceFacets;
import org.rhq.enterprise.gui.legacy.ParamConstants;
import org.rhq.enterprise.server.resource.ResourceFacetsCache;
-import org.rhq.enterprise.server.util.LookupUtil;
/**
* A {@link QuicknavDecorator} for {@link Resource}s.
@@ -110,7 +109,7 @@ public class ResourceQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isMonitorAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; // LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
@@ -135,7 +134,7 @@ public class ResourceQuicknavDecorator extends QuicknavDecorator {
@Override
protected boolean isAlertAllowed() {
- return LookupUtil.getSystemManager().isMonitoringEnabled();
+ return true; //LookupUtil.getSystemManager().isMonitoringEnabled();
}
@Override
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
index 2c355bf..31d5fc4 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/legacy/util/ContextUtils.java
@@ -24,8 +24,9 @@ import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
+
import javax.servlet.ServletContext;
-import org.rhq.enterprise.gui.legacy.AttrConstants;
+
import org.rhq.enterprise.gui.legacy.Constants;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.util.LookupUtil;
@@ -254,25 +255,4 @@ public class ContextUtils {
return (provider != null) &&
provider.equals(RHQConstants.LDAPJAASProvider);
}
-
- public static boolean updateMonitoringEnabled(ServletContext context) {
- boolean enabled;
- try {
- enabled = LookupUtil.getSystemManager().isMonitoringEnabled();
- } catch (Exception e) {
- enabled = false;
- }
-
- context.setAttribute(AttrConstants.MONITOR_ENABLED, Boolean.valueOf(enabled));
- return enabled;
- }
-
- public static boolean monitoringEnabled(ServletContext context) {
- Boolean enabled = (Boolean) context.getAttribute(AttrConstants.MONITOR_ENABLED);
- if (enabled == null) {
- return updateMonitoringEnabled(context);
- } else {
- return enabled;
- }
- }
}
\ No newline at end of file
diff --git
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
index fcbc61b..46e5043 100644
---
a/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
+++
b/modules/enterprise/gui/portal-war/src/main/java/org/rhq/enterprise/gui/navigation/contextmenu/TreeContextMenuBase.java
@@ -107,7 +107,7 @@ public abstract class TreeContextMenuBase {
HtmlOutputLink link;
HtmlGraphicImage image;
- if (descriptor.getMonitoringUrl() != null &&
LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ if (descriptor.getMonitoringUrl() != null /* &&
LookupUtil.getSystemManager().isMonitoringEnabled()*/) {
link = FacesComponentUtility.addOutputLink(quickLinksItem, null,
descriptor.getMonitoringUrl());
image = FacesComponentUtility.addGraphicImage(link, null,
"/images/icons/Monitor_grey_16.png", "Monitor");
image.setStyle(STYLE_QUICK_LINKS_ICON);
@@ -120,7 +120,7 @@ public abstract class TreeContextMenuBase {
image.setStyle(STYLE_QUICK_LINKS_ICON);
}
- if (descriptor.getAlertsUrl() != null &&
LookupUtil.getSystemManager().isMonitoringEnabled()) {
+ if (descriptor.getAlertsUrl() != null /*&&
LookupUtil.getSystemManager().isMonitoringEnabled()*/) {
link = FacesComponentUtility.addOutputLink(quickLinksItem, null,
descriptor.getAlertsUrl());
image = FacesComponentUtility.addGraphicImage(link, null,
"/images/icons/Alert_grey_16.png", "Alerts");
image.setStyle(STYLE_QUICK_LINKS_ICON);
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
index 61a14fe..e98cc1e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/struts-config.xml
@@ -1880,48 +1880,6 @@
<set-property property="title" value="Start"/>
</action>
- <action path="/admin/license/LicenseAdmin"
- forward=".admin.license.layout">
- </action>
-
- <action path="/admin/license/View"
-
type="org.rhq.enterprise.gui.action.license.LicenseController">
- <set-property property="title" value="License"/>
- </action>
-
- <action path="/admin/license/LicensePortal"
- parameter="mode"
- input="/admin/license/LicenseAdmin.do"
-
type="org.rhq.enterprise.gui.action.license.LicensePortalAction">
- <set-property property="title" value="License"/>
- </action>
-
- <action path="/admin/license/UpdateLicense"
- name="LicenseAdminForm"
- scope="request"
- parameter="mode"
- type="org.rhq.enterprise.gui.action.license.LicenseUpdateAction"
- input="/admin/license/LicenseAdmin.do?mode=edit">
- <set-property property="title" value="License"/>
- <forward name="cancel"
path="/admin/license/LicenseAdmin.do?mode=view" redirect="true"/>
- <forward name="reset"
path="/admin/license/LicenseAdmin.do?mode=edit" redirect="true"/>
- <forward name="failure"
path="/admin/license/LicenseAdmin.do?mode=edit&error=true"
redirect="true"/>
- <forward name="success"
path="/admin/license/LicenseAdmin.do?mode=view&update=true"
redirect="true"/>
- </action>
-
- <action path="/admin/license/UpdateLicenseNoMenu"
- name="LicenseAdminForm"
- scope="request"
- parameter="mode"
- type="org.rhq.enterprise.gui.action.license.LicenseUpdateAction"
-
input="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true">
- <set-property property="title" value="License"/>
- <forward name="cancel"
path="/admin/license/LicenseAdmin.do?mode=view&nomenu=true"
redirect="true"/>
- <forward name="reset"
path="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true"
redirect="true"/>
- <forward name="failure"
path="/admin/license/LicenseAdmin.do?mode=edit&error=true&nomenu=true"
redirect="true"/>
- <forward name="success"
path="/admin/license/LicenseAdmin.do?mode=view&update=true&nomenu=true"
redirect="true"/>
- </action>
-
<action path="/dashboard/Admin"
forward=".dashboard.admin.layout">
</action>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
index 0559198..640a4a3 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/admin-def.xml
@@ -36,14 +36,6 @@
<definition name=".admin.home"
path="/admin/AdminHome.jsp"/>
- <!-- license manager -->
- <definition name=".admin.license.View"
- controllerUrl="/admin/license/View.do"
- path="/admin/license/License.jsp"/>
-
- <definition name=".admin.license.Edit"
- path="/admin/license/LicenseEdit.jsp"/>
-
<!-- admin role portlets -->
<definition name=".admin.role.List"
controllerUrl="/admin/role/List.do"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
index 1af3acc..269a255 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/WEB-INF/tiles/portal-def.xml
@@ -38,14 +38,6 @@
<put name="breadcrumb" value="/admin/AdminHeader.jsp"
/>
</definition>
- <!-- JBMAN License Manager -->
- <definition name=".admin.license.layout"
- extends=".admin.home.layout"
- controllerUrl="/admin/license/LicensePortal.do">
- <put name="location" value="header.license" />
- </definition>
-
-
<definition name=".admin.role.layout"
extends=".admin.home.layout"
controllerUrl="/admin/role/RoleAdminPortal.do">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
index 3256a75..f727698 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/admin/AdminHome.jsp
@@ -65,11 +65,6 @@
</td>
</tr>
<tr>
- <td width="20%" class="BlockLabel"><fmt:message
key="admin.home.License"/></td>
- <td width="30%" class="BlockContent"><html:link
page="/admin/license/LicenseAdmin.do?mode=view"><fmt:message
key="admin.home.LicenseManager"/></html:link></td>
- </tr>
-
- <tr>
<td width="20%" class="BlockLabel"><fmt:message
key="admin.home.Plugins"/></td>
<td width="30%" class="BlockContent"><html:link
page="/rhq/admin/plugin/plugin-list.xhtml"><fmt:message
key="admin.home.PluginsLink"/></html:link></td>
</tr>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
index 0ec1a85..937f006 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/config/ChangeResourceTemplate.jsp
@@ -31,7 +31,6 @@
<tr class="ListRowSelected">
<td class="ListCellPrimary"><c:out
value="${entry.type.name}"/> <c:out
value="${entry.pluginInfo}"/></td>
<td class="ListCell" align="left"
nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<c:if test="${not empty param.nomenu}">
<html:link
page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${entry.type.id}&type=${entry.type.id}"
styleClass="buttonsmall">
Edit Metric Template
@@ -47,10 +46,8 @@
(<c:out value="${entry.enabledMetricCount}" /> | <c:out
value="${entry.disabledMetricCount}" />)
</span>
</c:if>
- </c:if>
</td>
<td class="ListCell" align="left"
nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<html:link
page="/rhq/admin/listAlertTemplates.xhtml?type=${entry.type.id}"
styleClass="buttonsmall">
Edit Alert Templates
</html:link>
@@ -59,7 +56,6 @@
(<c:out value="${entry.enabledAlertCount}" /> | <c:out
value="${entry.disabledAlertCount}" />)
</span>
</c:if>
- </c:if>
</td>
</tr>
@@ -105,7 +101,6 @@
<tr class="ListRowSelected">
<td class="ListCellPrimary"><c:out
value="${entry.type.name}"/> <c:out
value="${entry.pluginInfo}"/></td>
<td class="ListCell" align="left">
- <c:if test="${monitorEnabled}">
<c:if test="${not empty param.nomenu}">
<html:link
page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&type=${entry.type.id}"
styleClass="buttonsmall">
Edit Metric Template
@@ -121,10 +116,8 @@
(<c:out value="${entry.enabledMetricCount}" /> | <c:out
value="${entry.disabledMetricCount}" />)
</span>
</c:if>
- </c:if>
</td>
<td class="ListCell" align="left">
- <c:if test="${monitorEnabled}">
<html:link
page="/rhq/admin/listAlertTemplates.xhtml?type=${entry.type.id}"
styleClass="buttonsmall">
Edit Alert Templates
</html:link>
@@ -133,7 +126,6 @@
(<c:out value="${entry.enabledAlertCount}" /> | <c:out
value="${entry.disabledAlertCount}" />)
</span>
</c:if>
- </c:if>
</td>
</tr>
<tiles:insert
definition=".resource.common.monitor.config.ShowOneResourceType">
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
deleted file mode 100644
index 4c7d47a..0000000
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/License.jsp
+++ /dev/null
@@ -1,94 +0,0 @@
-<%@ page import="org.rhq.enterprise.server.license.License" %>
-<%@ page import="java.util.Date" %>
-<%@ page language="java" %>
-<%@ taglib
uri="http://jakarta.apache.org/struts/tags-html-el"
prefix="html" %>
-<%@ taglib
uri="http://jakarta.apache.org/struts/tags-tiles"
prefix="tiles" %>
-<%@ taglib
uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"
%>
-<%@ taglib
uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%>
-<%@ taglib uri="/WEB-INF/tld/hq.tld" prefix="hq" %>
-
-
-<tiles:insert definition=".portlet.confirm" flush="true"/>
-<tiles:insert definition=".portlet.error" flush="true"/>
-
-
-<table width="100%" cellpadding="0" cellspacing="0"
border="0">
-
- <tr>
- <td colspan="4" class="BlockHeader">
- <tiles:insert definition=".header.tab">
- <tiles:put name="tabKey"
value="admin.license.LicenseInfoTab"/>
- </tiles:insert>
- </td>
- </tr>
- <!-- / -->
-
- <c:choose>
- <c:when test="${license != null}">
- <!-- EMAIL CONFIG CONTENTS -->
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.LicenseeUser"/></td>
- <td class="BlockContent"><c:out
value="${license.licenseeName}"/></td>
- <td class="BlockContent"
colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.LicenseeEmail"/></td>
- <td class="BlockContent"><c:out
value="${license.licenseeEmail}"/></td>
- <td class="BlockContent"
colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.LicenseePhone"/></td>
- <td class="BlockContent"><c:out
value="${license.licenseePhone}"/></td>
- <td class="BlockContent"
colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.LicenseExpiration"/></td>
- <td class="BlockContent">
- <c:choose>
- <c:when
test="${license.isPerpetualLicense}">Never</c:when>
- <c:otherwise>
- <% pageContext.setAttribute("expirationDate",
new
Date(((License)pageContext.findAttribute("license")).getLicenseExpiration()));%>
- <fmt:formatDate value="${expirationDate}"
dateStyle="full"/>
- </c:otherwise>
- </c:choose>
- </td>
- <td class="BlockContent"
colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.PlatformLimit"/></td>
- <td class="BlockContent">
- <c:choose>
- <c:when
test="${license.platformsUnlimited}">unlimited</c:when>
- <c:otherwise><c:out
value="${license.platformLimit}"/></c:otherwise>
- </c:choose>
- </td>
- <td class="BlockContent"
colspan="2"></td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.MonitoringEnabled"/></td>
- <td class="BlockContent">
- <c:choose>
- <c:when test="${license.supportLevel ==
3}">Enabled</c:when>
- <c:otherwise>Disabled</c:otherwise>
- </c:choose>
- </td>
- <td class="BlockContent"
colspan="2"></td>
- </tr>
- </c:when>
- <c:otherwise>
- <tr>
- <td class="BlockContent" colspan="4"
align="center">No license file loaded</td>
- </tr>
- </c:otherwise>
- </c:choose>
-
- <hq:authorization permission="MANAGE_SETTINGS">
- <tr>
- <td class="BlockContent" colspan="4"
align="center"><html:link
action="/admin/license/LicenseAdmin.do?mode=edit&nomenu=true">Update
License</html:link>
- </td>
- </tr>
- </hq:authorization>
-
- </table>
-
-
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
deleted file mode 100644
index f49a8bf..0000000
--- a/modules/enterprise/gui/portal-war/src/main/webapp/admin/license/LicenseEdit.jsp
+++ /dev/null
@@ -1,60 +0,0 @@
-
-<%@ page language="java" %>
-<%@ taglib
uri="http://jakarta.apache.org/struts/tags-html-el"
prefix="html" %>
-<%@ taglib
uri="http://jakarta.apache.org/struts/tags-tiles"
prefix="tiles" %>
-<%@ taglib
uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"
%>
-<%@ taglib
uri="http://java.sun.com/jsp/jstl/core" prefix="c"
%>
-
-<tiles:insert definition=".portlet.confirm" flush="true"/>
-<tiles:insert definition=".portlet.error" flush="true"/>
-
-<table width="100%" cellpadding="0" cellspacing="0"
border="0">
-
- <c:if test="${not empty param.nomenu}">
- <html:form action="/admin/license/UpdateLicenseNoMenu"
enctype="multipart/form-data" method="POST">
- <tr>
- <td colspan="4" class="BlockHeader">
- <tiles:insert definition=".header.tab">
- <tiles:put name="tabKey"
value="admin.license.UpdateLicenseTab"/>
- </tiles:insert>
- </td>
- </tr>
- <tr>
- <td colspan="4">An up to date license file can be downloaded
from the
- <a
href="https://network.jboss.com/jbossnetwork/restricted/listSoftware...
- JBoss Network Customer Service Portal</a>.</td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.LicenseFile"/></td>
- <td class="BlockContent"><html:file
property="licenseFile"/></td>
- <td colspan="2"
class="BlockContent"> </td>
- </tr>
-
- <tiles:insert definition=".form.buttons"/>
- </html:form>
- </c:if>
-
- <c:if test="${empty param.nomenu}">
- <html:form action="/admin/license/UpdateLicense"
enctype="multipart/form-data" method="POST">
- <tr>
- <td colspan="4" class="BlockHeader">
- <tiles:insert definition=".header.tab">
- <tiles:put name="tabKey"
value="admin.license.UpdateLicenseTab"/>
- </tiles:insert>
- </td>
- </tr>
- <tr>
- <td colspan="4">An up to date license file can be downloaded
from the
- <a
href="https://network.jboss.com/jbossnetwork/restricted/listSoftware...
- JBoss Network Customer Service Portal</a>.</td>
- </tr>
- <tr>
- <td class="BlockLabel"><fmt:message
key="admin.license.LicenseFile"/></td>
- <td class="BlockContent"><html:file
property="licenseFile"/></td>
- <td colspan="2"
class="BlockContent"> </td>
- </tr>
-
- <tiles:insert definition=".form.buttons"/>
- </html:form>
- </c:if>
-</table>
\ No newline at end of file
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
index 308da9c..3087cb4 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portal/StartPageLayout.jsp
@@ -40,7 +40,6 @@
<li class="first"><html:link
href="/rhq/admin/downloads.xhtml">Agent
Installs</html:link></li>
<li><html:link
action="admin/config/Config.do?mode=edit"><fmt:message
key="start.category.AdminTools.item.EditConfig"/></html:link></li>
<li><html:link
action="admin/config/EditDefaults.do?mode=monitor&viewMode=all"><fmt:message
key="start.category.AdminTools.item.ViewMonitoring"/></html:link></li>
- <li><html:link
action="admin/license/LicenseAdmin.do?mode=view"><fmt:message
key="start.category.AdminTools.item.ManageLicense"/></html:link></li>
</ul>
</li>
</c:if>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
index cff479a..468808e 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/criticalAlerts/View.jsp
@@ -24,13 +24,6 @@
</tiles:insert>
<c:choose >
- <c:when test="${not monitorEnabled}">
- <table width="100%" cellpadding="0" cellspacing="0"
border="0">
- <tr class="ListRow">
- <td class="ListCell"><fmt:message
key="common.marketing.FeatureDisabled"/></td>
- </tr>
- </table>
- </c:when>
<c:when test="${not empty criticalAlerts}">
<table width="100%" cellpadding="0" cellspacing="0"
border="0">
<tr>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
index 7dffbd2..5c2678f 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/portlet/problemResources/View.jsp
@@ -23,13 +23,6 @@
</tiles:insert>
<c:choose>
- <c:when test="${not monitorEnabled}">
- <table width="100%" cellpadding="0" cellspacing="0"
border="0">
- <tr class="ListRow">
- <td class="ListCell"><fmt:message
key="common.marketing.FeatureDisabled"/></td>
- </tr>
- </table>
- </c:when>
<c:when test="${not empty problemResources}">
<display:table cellspacing="0" cellpadding="0"
width="100%" action="/Dashboard.do"
var="obj" items="${problemResources}" >
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
index 605c77b..88de16c 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/ControlTab.jsp
@@ -53,12 +53,6 @@
border="0"/>
</td>
</c:when>
- <c:when test="${not monitorEnabled && (tab.value eq
'Monitor' || tab.value eq 'Alert')}">
- <%--<td>--%>
- <%--<html:img page="/images/tab_${tab.value}_off.gif"
width="${tab.width}" height="${tab.height}" alt=""--%>
- <%--border="0"/>--%>
- <%--</td>--%>
- </c:when>
<c:otherwise>
<c:url var="tabLink" value="${tab.link}">
<c:choose>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
index 26b0682..ea3ec82 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ConfigMetrics.jsp
@@ -124,10 +124,8 @@
<tiles:insert definition=".portlet.error"/>
<tiles:insert definition=".portlet.confirm"/>
-<hq:constant symbol="MONITOR_ENABLED_ATTR"
var="CONST_ENABLED"/>
-
<c:choose>
- <c:when test="${requestScope[CONST_ENABLED]}">
+ <c:when test="true">
<br/>
<tiles:insert
definition=".resource.common.monitor.config.editConfigMetricsVisibility">
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
index 9165090..e3ccae9 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/resource/common/monitor/config/ShowOneResourceType.jsp
@@ -49,7 +49,6 @@
<c:out value="${serviceType.type.name}" />
</td>
<td class="ListCell" align="left"
nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<c:if test="${not empty param.nomenu}">
<html:link
page="/admin/platform/monitor/Config.do?nomenu=true&mode=configure&id=${serviceType.type.id}&type=${serviceType.type.id}"
styleClass="buttonsmall">
Edit Metric Template
@@ -65,10 +64,8 @@
(<c:out value="${serviceType.enabledMetricCount}" /> |
<c:out value="${serviceType.disabledMetricCount}" />)
</span>
</c:if>
- </c:if>
</td>
<td class="ListCell" align="left"
nowrap="nowrap">
- <c:if test="${monitorEnabled}">
<html:link
page="/rhq/admin/listAlertTemplates.xhtml?type=${serviceType.type.id}"
styleClass="buttonsmall">
Edit Alert Templates
</html:link>
@@ -77,7 +74,6 @@
(<c:out value="${serviceType.enabledAlertCount}" /> |
<c:out value="${serviceType.disabledAlertCount}" />)
</span>
</c:if>
- </c:if>
</td>
</tr>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
index d331d51..c855e67 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml
@@ -393,11 +393,6 @@
</rich:menuItem>
- <rich:menuItem submitMode="none"
- onclick="window.location =
'/admin/license/LicenseAdmin.do?mode=view'"
- rendered="#{GlobalPermissionsUIBean.settings}">
- <h:outputText value="License"/>
- </rich:menuItem>
</rich:dropDownMenu>
<ui:remove>===== DEBUG =====</ui:remove>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
index 986c01d..3655063 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/inventory/view.xhtml
@@ -187,8 +187,7 @@
<onc:icon name="Monitor"
url="/rhq/resource/monitor/graphs.xhtml"
- alt="Monitor"
- visible="#{monitorEnabled}">
+ alt="Monitor">
</onc:icon>
<onc:icon name="Inventory"
@@ -197,8 +196,7 @@
<onc:icon name="Alert"
url="/rhq/resource/alert/listAlertDefinitions.xhtml"
- alt="Alerts"
- visible="#{monitorEnabled}"/>
+ alt="Alerts"/>
<onc:icon name="Configure"
url="/rhq/resource/configuration/view.xhtml"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
index 5faaa7c..04c265b 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main-plain.xhtml
@@ -38,7 +38,7 @@
</onc:tab>
<onc:tab name="Alert"
image="/images/icons/Alert_grey_16.png"
- rendered="#{monitorEnabled and
ResourceGroupUIBean.compatible}">
+ rendered="#{ResourceGroupUIBean.compatible}">
<onc:subtab name="Definitions"
url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" />
<onc:subtab name="History"
url="/rhq/group/alert/listGroupAlertHistory.xhtml" />
</onc:tab>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
index 08b9d77..1eea5bf 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/group/layout/main.xhtml
@@ -71,7 +71,7 @@ THIS TEXT WILL BE REMOVED AS WELL.
</onc:tab>
<onc:tab name="Alert"
image="/images/icons/Alert_grey_16.png"
- rendered="#{monitorEnabled and
ResourceGroupUIBean.compatible}">
+ rendered="#{ResourceGroupUIBean.compatible}">
<onc:subtab name="Definitions"
url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" />
<onc:subtab name="History"
url="/rhq/group/alert/listGroupAlertHistory.xhtml" />
</onc:tab>
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
index 52245bf..3533512 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseGroups.xhtml
@@ -118,7 +118,7 @@
</ui:remove>
<onc:icon name="Monitor"
url="/rhq/group/monitor/graphs.xhtml" alt="Monitor"
- visible="#{monitorEnabled and item.category.name eq
'COMPATIBLE'}">
+ visible="#{item.category.name eq
'COMPATIBLE'}">
<f:param name="category"
value="#{item.category.name}"/>
</onc:icon>
@@ -127,7 +127,7 @@
</onc:icon>
<onc:icon name="Alert"
url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" alt="Alert"
- visible="#{monitorEnabled and item.category.name eq
'COMPATIBLE'}"/>
+ visible="#{item.category.name eq
'COMPATIBLE'}"/>
<onc:icon name="Configure"
url="/rhq/group/configuration/viewCurrent.xhtml" alt="Configure"
visible="#{item.category.name eq 'COMPATIBLE'
and
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
index dacc5cb..3c60aee 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/inventory/browseResources.xhtml
@@ -113,8 +113,7 @@
<onc:icon name="Monitor"
url="/rhq/resource/monitor/graphs.xhtml"
- alt="Monitor"
- visible="#{monitorEnabled}">
+ alt="Monitor">
</onc:icon>
<onc:icon name="Inventory"
@@ -123,8 +122,7 @@
<onc:icon name="Alert"
url="/rhq/resource/alert/listAlertDefinitions.xhtml"
- alt="Alerts"
- visible="#{monitorEnabled}"/>
+ alt="Alerts"/>
<onc:icon name="Configure"
url="/rhq/resource/configuration/view.xhtml"
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
index 9598bfc..52d6446 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/inventory/view.xhtml
@@ -177,8 +177,7 @@
<onc:icon name="Monitor"
url="/rhq/resource/monitor/graphs.xhtml"
- alt="Monitor"
- visible="#{monitorEnabled}">
+ alt="Monitor">
</onc:icon>
<onc:icon name="Inventory"
@@ -187,8 +186,7 @@
<onc:icon name="Alert"
url="/rhq/resource/alert/listAlertDefinitions.xhtml"
- alt="Alerts"
- visible="#{monitorEnabled}"/>
+ alt="Alerts"/>
<onc:icon name="Configure"
url="/rhq/resource/configuration/view.xhtml"
@@ -655,7 +653,7 @@
</ui:remove>
<onc:icon name="Monitor"
url="/rhq/group/monitor/graphs.xhtml" alt="Monitor"
- visible="#{monitorEnabled and
resourceGroupComposite.category.name eq 'COMPATIBLE'}">
+ visible="#{resourceGroupComposite.category.name eq
'COMPATIBLE'}">
<f:param name="category"
value="#{resourceGroupComposite.category.name}"/>
</onc:icon>
@@ -664,7 +662,7 @@
</onc:icon>
<onc:icon name="Alert"
url="/rhq/group/alert/listGroupAlertDefinitions.xhtml" alt="Alert"
- visible="#{monitorEnabled and
resourceGroupComposite.category.name eq 'COMPATIBLE'}"/>
+ visible="#{resourceGroupComposite.category.name eq
'COMPATIBLE'}"/>
<onc:icon name="Configure"
url="/rhq/group/configuration/viewCurrent.xhtml" alt="Configure"
visible="#{resourceGroupComposite.category.name eq
'COMPATIBLE' and
diff --git
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
index 6cf4efb..17aac38 100644
---
a/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
+++
b/modules/enterprise/gui/portal-war/src/main/webapp/rhq/resource/layout/main-no-leftnav.xhtml
@@ -72,7 +72,7 @@ REQUEST PARAMETERS:
<onc:subtab name="Timeline"
url="/rhq/resource/summary/timeline.xhtml" />
</onc:tab>
- <onc:tab name="Monitor"
image="/images/icons/Monitor_grey_16.png"
rendered="#{monitorEnabled}">
+ <onc:tab name="Monitor"
image="/images/icons/Monitor_grey_16.png">
<onc:subtab name="Graphs"
url="/rhq/resource/monitor/graphs.xhtml" />
<onc:subtab name="Tables"
url="/rhq/resource/monitor/tables.xhtml" />
<onc:subtab name="Traits"
url="/rhq/resource/monitor/traits.xhtml" />
@@ -91,7 +91,7 @@ REQUEST PARAMETERS:
<onc:subtab name="Agent"
url="/rhq/resource/inventory/view-agent.xhtml" />
</onc:tab>
- <onc:tab name="Alert"
image="/images/icons/Alert_grey_16.png"
rendered="#{monitorEnabled}">
+ <onc:tab name="Alert"
image="/images/icons/Alert_grey_16.png">
<onc:subtab name="Definitions"
url="/rhq/resource/alert/listAlertDefinitions.xhtml" />
<onc:subtab name="History"
url="/rhq/resource/alert/listAlertHistory.xhtml" />
</onc:tab>
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
b/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
index e32815a..43b4718 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
+++ b/modules/enterprise/gui/portal-war/src/main/webapp/test/menu/menu.xhtml
@@ -89,11 +89,6 @@
</h:outputLink>
</rich:menuItem>
- <rich:menuItem submitMode="none">
- <h:outputLink
value="/admin/license/LicenseAdmin.do?mode=view">
- <h:outputText value="License" />
- </h:outputLink>
- </rich:menuItem>
</rich:menuGroup>
<rich:menuGroup value="Users">
diff --git a/modules/enterprise/server/ear/pom.xml
b/modules/enterprise/server/ear/pom.xml
index 64c3a6c..878484d 100644
--- a/modules/enterprise/server/ear/pom.xml
+++ b/modules/enterprise/server/ear/pom.xml
@@ -120,25 +120,6 @@
<plugins>
<plugin>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <mkdir dir="${earDirectory}/license" />
- <copy todir="${earDirectory}/license"
file="${basedir}/src/main/license/license.xml" />
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
<displayName>RHQ</displayName>
@@ -736,8 +717,6 @@
<phase>package</phase>
<configuration>
<tasks>
- <mkdir dir="${earDirectory}/license" />
- <copy todir="${earDirectory}/license"
file="${basedir}/src/main/license/license.xml" />
<property name="deployment.dir"
location="${rhq.deploymentDir}" />
<echo>*** Copying updated files from
target${file.separator}${project.build.finalName}${file.separator} to
diff --git a/modules/enterprise/server/ear/src/main/license/license.xml
b/modules/enterprise/server/ear/src/main/license/license.xml
deleted file mode 100644
index 2b4d104..0000000
--- a/modules/enterprise/server/ear/src/main/license/license.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
- This license should be uploaded to your RHQ Server in the
- Manage License section of the Administration area. If you have
- not already installed a license, you will be directed to this
- page on your first login to the application.
-
- You must login as an administrator to update your license file.
--->
-
-<!-- License created: Feb-12-2008 17:35 -->
-<license key="f3e30ce3f40d3da5a1b1625f1d8bd253" version="2.0">
-
- <license-owner name="RHQ"
- email="nobody(a)rhq-project.org"
- phone="888-555-1212"
- key="f6a629735537a0ff90c002ada39db105"/>
-
- <license-expiration date="*"
key="8a58f1b633e356a321251f2ffdf2c34e" />
- <platform-limit count="*" key="a6ccfd9f9d66f73cff44b5953971166b"
/>
- <server-ip count="1" address="*"
key="945f33206407c7743d205f2b345e8a57" />
- <plugin-enable name="*" key="62fa3b11086463a41abf7daf7fc572ee"
/>
- <support-level level="3" key="8e820272b1aa2289eb284a47745ab401"
/>
-
-</license>
diff --git a/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
b/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
index 5c0e3d2..4fc8136 100644
--- a/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
+++ b/modules/enterprise/server/ear/src/main/resources/product-plugin-service.xml
@@ -9,6 +9,5 @@
<attribute
name="AgentPluginDir">${jboss.server.home.dir}/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</attribute>
<attribute
name="ServerPluginDir">${jboss.server.home.dir}/deploy/${rhq.earName}/rhq-serverplugins</attribute>
<attribute
name="UserPluginDir">${jboss.home.dir}/../plugins</attribute>
- <attribute
name="LicenseFile">${jboss.server.home.dir}/deploy/${rhq.earName}/license/license.xml</attribute>
</mbean>
</server>
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
index 9f22d2c..b636313 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScanner.java
@@ -93,14 +93,6 @@ public class PluginDeploymentScanner implements
PluginDeploymentScannerMBean {
this.agentPluginScanner.getAgentPluginDeployer().setPluginDir(dir);
}
- public File getLicenseFile() {
- return this.agentPluginScanner.getAgentPluginDeployer().getLicenseFile();
- }
-
- public void setLicenseFile(File file) {
- this.agentPluginScanner.getAgentPluginDeployer().setLicenseFile(file);
- }
-
public void start() throws Exception {
// This will check to see if there are any agent plugin records in the database
// that do not have content associated with them and if so, will stream
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
index cb5c795..88432d9 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/PluginDeploymentScannerMBean.java
@@ -115,8 +115,4 @@ public interface PluginDeploymentScannerMBean {
* @return agent plugin directory name
*/
File getAgentPluginDir();
-
- void setLicenseFile(File name);
-
- File getLicenseFile();
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
index 61b5a97..f8fef50 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/plugin/ProductPluginDeployer.java
@@ -44,7 +44,6 @@ import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.core.concurrency.LatchedServiceCircularityException;
import org.rhq.enterprise.server.core.concurrency.LatchedServiceController;
import org.rhq.enterprise.server.core.concurrency.LatchedServiceException;
-import org.rhq.enterprise.server.license.LicenseManager;
import org.rhq.enterprise.server.resource.ResourceTypeManagerLocal;
import org.rhq.enterprise.server.resource.metadata.PluginManagerLocal;
import org.rhq.enterprise.server.system.SystemManagerLocal;
@@ -57,7 +56,6 @@ public class ProductPluginDeployer {
private Log log = LogFactory.getLog(ProductPluginDeployer.class.getName());
private File pluginDir = null;
- private File licenseFile = null;
private boolean isStarted = false;
private boolean isReady = false;
@@ -87,30 +85,12 @@ public class ProductPluginDeployer {
}
}
- public File getLicenseFile() {
- return this.licenseFile;
- }
-
- public void setLicenseFile(File file) {
- this.licenseFile = file;
-
- // sanity check - log an ugly message if we don't have a license file named
as we expect
- String expectedName = LicenseManager.getLicenseFileName();
- if (!file.getPath().endsWith(expectedName)) {
- log.error("License file [" + file + "] is not named what we
expect: " + expectedName);
- }
- }
-
/**
* This is called by the server's startup servlet which essentially informs us
that
* the server's internal EJB/SLSBs are ready and can be called. This means we
are
* allowed to begin registering types from deployed plugins.
*/
public void startDeployment() {
- // Do startup license checking. we should really pull out the licensing code into
someplace else
- LicenseManager licenseManager = LicenseManager.instance();
- licenseManager.doStartupCheck(this.licenseFile.getAbsolutePath());
-
// we can now register our initial set of plugins
registerPlugins();
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java
deleted file mode 100644
index e0c3d51..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/BackingStore.java
+++ /dev/null
@@ -1,43 +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.license;
-
-import java.util.prefs.BackingStoreException;
-import java.util.prefs.Preferences;
-
-public class BackingStore {
- private static final String BACKING_STORE_AVAIL = "BackingStoreAvail";
-
- private BackingStore() {
- super();
- }
-
- public static boolean isAvailable() {
- Preferences prefs = Preferences.userRoot().node("");
- try {
- boolean oldValue = prefs.getBoolean(BACKING_STORE_AVAIL, false);
- prefs.putBoolean(BACKING_STORE_AVAIL, !oldValue);
- prefs.flush();
- } catch (BackingStoreException e) {
- return false;
- }
-
- return true;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java
deleted file mode 100644
index c85cfa0..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/CorruptLicenseException.java
+++ /dev/null
@@ -1,37 +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.license;
-
-public class CorruptLicenseException extends LicenseException {
- public CorruptLicenseException() {
- super();
- }
-
- public CorruptLicenseException(String message) {
- super(message);
- }
-
- public CorruptLicenseException(Throwable cause) {
- super(cause);
- }
-
- public CorruptLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java
deleted file mode 100644
index 641c7de..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/DuplicateLicenseException.java
+++ /dev/null
@@ -1,37 +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.license;
-
-public class DuplicateLicenseException extends Exception {
- public DuplicateLicenseException() {
- super();
- }
-
- public DuplicateLicenseException(String message) {
- super(message);
- }
-
- public DuplicateLicenseException(Throwable cause) {
- super(cause);
- }
-
- public DuplicateLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.java
deleted file mode 100644
index a8d7368..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ExpirationTag.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.enterprise.server.license;
-
-import java.text.DateFormat;
-import java.text.DecimalFormat;
-import java.text.NumberFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class ExpirationTag extends LicenseTermTag {
- static final DateFormat DFORMAT = new SimpleDateFormat(LRES.get(LRES.DFORMAT));
- static final NumberFormat NFORMAT = new DecimalFormat(LRES.get(LRES.NFORMAT));
-
- static final int PST_OFFSET = -1000 * 60 * 60 * 8;
- static final int DST_OFFSET = 0;
- private boolean trial = false;
-
- protected ExpirationTag(LicenseTag lt) {
- super(lt);
- }
-
- private String _origValue = null;
- private long _expMillis = 0;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_DATE),
XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_EXPIRATION);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getOriginalExpirationString() {
- return _origValue;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- // LicenseManager.doHalt(LRES.MSG_BADINDEX);
- throw new IllegalArgumentException();
- }
-
- if (attrNumber == 0) {
- if (value.equals(LRES.get(LRES.EXPIRATION_NEVER))) {
- _expMillis = License.EXPIRES_NEVER;
- _origValue = value;
- } else {
- // cal has today as default time
- Calendar cal = Calendar.getInstance();
-
- try {
- // if the expiration parses as a date, set it
- Date expDate = DFORMAT.parse(value);
- cal.setTime(expDate);
- } catch (ParseException e) {
- try {
- // otherwise it parses as a duration
- int days = NFORMAT.parse(value).intValue();
- cal.add(Calendar.DATE, days);
- trial = true;
- } catch (ParseException ee) {
- throw new XmlAttrException(LRES.get(LRES.MSG_ERRPARSE));
- }
- }
-
- cal.set(Calendar.HOUR, 23);
- cal.set(Calendar.MINUTE, 59);
- cal.set(Calendar.SECOND, 59);
-
- // hardcode timezone and DST offsets
- cal.set(Calendar.ZONE_OFFSET, PST_OFFSET);
- cal.set(Calendar.DST_OFFSET, DST_OFFSET);
-
- _expMillis = cal.getTimeInMillis();
- _origValue = value;
- }
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return String.valueOf(_origValue);
- }
-
- protected void termValidated() {
- //getLicense().setExpiration(_expMillis);
- getLicense().setTrial(trial);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java
deleted file mode 100755
index 3d647a6..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/FeatureUnavailableException.java
+++ /dev/null
@@ -1,42 +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.license;
-
-import org.rhq.enterprise.server.legacy.common.ApplicationException;
-
-/**
- * Exception thrown when feature is not available to the user
- */
-public class FeatureUnavailableException extends ApplicationException {
- public FeatureUnavailableException() {
- super();
- }
-
- public FeatureUnavailableException(String s) {
- super(s);
- }
-
- public FeatureUnavailableException(Throwable t) {
- super(t);
- }
-
- public FeatureUnavailableException(String s, Throwable t) {
- super(s, t);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java
deleted file mode 100644
index a091337..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LRES.java
+++ /dev/null
@@ -1,245 +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.license;
-
-/**
- * Munged error messages and other resource strings used by licensing code. These string
are munged because a typical
- * circumvention technique is to search class files (decompiled or not) for strings known
to be used by licensing code.
- *
- * <p/>These strings are munged with License.munge
- */
-final class LRES {
- // "license.xml"
- static final String LICENSE_LOCATION = "R73u7y2Fk#:";
-
- // "License Error: "
- static final String HALT_MSG = "=}BS}cW)5,_~mb)";
-
- // "Unexpected exception while initialzing license file"
- static final String ERR_INIT_EXC = "K7
v:<n4h(]S6nuRjUc}IMx}dS-$\\ojUAQN57w]qTnu7y2/,$:h";
-
- // "Unexpected error while initialzing license file"
- static final String ERR_INIT_ERROR =
"{rqJEh>]dUbu.z,w^?boGG(7[5w}>RZs\\4XE\\CQ\\m $I7Au";
-
- // "Error reading license file"
- static final String ERR_MSG_INIT = "x1kl@mp% j-]~y=]d[]ls.c/t\\";
-
- // "Error discovering IP addresses on server"
- static final String ERR_MSG_NETIF =
"=)X8/P5gIH8`:Ig=(}J_TL'[]A8;nIo8tP;n)3i/";
-
- // "org.rhq.enterprise.server.license.LicenseManager"
- static final String JNDI_NAME =
"\\hj+]`Gu.}B#/Xe`KC3~Uem)i_<)eD}BS}cuHWUV<U{hqio:.u.";
-
- // "org.rhq.enterprise.server.license.LicenseManager"
- static final String LOG_NAME =
"\\hj+]`Gu.}B#/Xe`KC3~Uem)i_<)eD}BS}cuHWUV<U{hqio:.u.";
-
- // "org.rhq.enterprise.server.license.LicenseStoreManager"
- static final String STORE_LOG_NAME =
"}=,Cwnh<m(R3j4LnkBVa^LcIdKOILu(Rt(@<&%^iO^|=j_@|fhDPd_Oc";
-
- // "Unable to get initial JNDI context"
- static final String ERR_MSG_JNDIIC =
"HwfYs$J(a)ecpT6J8w.v,'oKgx{RktZwpP>6";
-
- // "Unable to perform JNDI rebind operation"
- static final String ERR_MSG_JNDIBIND =
"w<&mBAPT45Ci/]Ix?o&u\\|s)Ry%O%swCi/YTgwW";
-
- // "Unable to perform JNDI lookup"
- static final String ERR_MSG_JNDILOOKUP =
"M]=Lro|c?mg5!vl@Dy=^,3{fF9=*<";
-
- // "No licensed IP address found on server"
- static final String ERR_MSG_NOIPS =
":Is`O\"A2/n'ok,\\#r'Xij]7^wsg7\\I<54i/L0x";
-
- // "Error closing SIGAR library"
- static final String ERR_MSG_SIGARCLOSE = ")kJ?ay W6!I/1*_Cj4Iyr]HJ<ad";
-
- // "The time-limited license for this software has expired. Please contact
support to renew your license."
- static final String ERR_MSG_EXPIRED = "F,\\mkjq'CO4Gj@'8{fw
o)!\\m@9!,c_4?*F61~BWvo,,<ly5CS-(a)7ziK,FO7WMo,q?/kg2|_6_gtZkc{1F*!'X\\ByqZ.J{fw
o)!\\E";
-
- // "Invalid attribute index"
- static final String MSG_BADINDEX = "+( hW/8jQy*1/\"4mf.])8t9";
-
- // "Error parsing expiration date"
- static final String MSG_ERRPARSE = "]@aFvKfS@lwIJ|[#Wwvta-?/y,ta[";
-
- // "Invalid platform count"
- static final String ERR_MSG_BADCOUNT = "\"$hu=]jwQSu*c6*V8:v;)_";
-
- // "Invalid support level"
- static final String ERR_MSG_BADLEVEL = "HTuQ<Xw414uhv1,w2O %W";
-
- // "*"
- static final String IP_ANY = "l";
-
- // "*"
- static final String PLATFORMS_UNLIMITED = "l";
-
- // "*"
- static final String EXPIRATION_NEVER = "l";
-
- // "*"
- static final String PLUGIN_ANY = "l";
-
- // "license"
- static final String TAGNAME_LICENSE = "VrLGr,Q";
-
- // "license-owner"
- static final String TAGNAME_LICENSEE = "A5` 5K<!yFs2_";
-
- // "license-expiration"
- static final String TAGNAME_EXPIRATION = "qTnWTkOF<ld^KQ;T1P";
-
- // "platform-limit"
- static final String TAGNAME_PLATFORMLIMIT = "EDR8z~mLlGU3Tz";
-
- // "support-level"
- static final String TAGNAME_SUPPORTLEVEL = "_^Ri|_.!:hA2q";
-
- // "server-ip"
- static final String TAGNAME_SERVERIP = ";GwnQ;l'B";
-
- // "plugin-enable"
- static final String TAGNAME_PLUGINENABLE = "n:bwUo9Q\\EadS";
-
- // "address"
- static final String ATTR_ADDRESS = "3s54d,_";
-
- // "revokes"
- static final String ATTR_REVOKES = "/:B,Yq_";
-
- // "count"
- static final String ATTR_COUNT = "H8oOX";
-
- // "name"
- static final String ATTR_NAME = "=NFA";
-
- // "email"
- static final String ATTR_EMAIL = "RF3rn";
-
- // "phone"
- static final String ATTR_PHONE = "Co;OD";
-
- // "yyyy-MM-dd"
- static final String DFORMAT = "\"+#L6dqa}U";
-
- // "##0"
- static final String NFORMAT = "A:=";
-
- // "date"
- static final String ATTR_DATE = "'NbA";
-
- // "level"
- static final String ATTR_LEVEL = ">i`:n";
-
- // "key"
- static final String ATTR_KEY = "\"EF";
-
- // "version"
- static final String ATTR_VERSION = "`:I.\\{[";
-
- // "No value to validate"
- static final String ERR_NOVALUE = "rkwuQ<8=4_@8 hu(]qmf";
-
- // "Error validating license: key mismatch"
- static final String ERR_VALIDATION =
"SbxwX}`+3g'Nb%2Ps`O\"A2/nfoLA67lt4F3P97";
-
- // "Invalid server-ip element"
- static final String ERR_INVALIDSERVERIP = "LbS2tI.;ark=\\a#X2,[O7n%x|";
-
- // "Invalid license-owner element"
- static final String ERR_INVALIDLICENSEE =
"3]gWr8{_O4h549[3MVIo6_\\fsdowc";
-
- // "Key validation error"
- static final String ERR_KEYVALIDATION = "VWVjhu=$Xd{xpbIW*Kac";
-
- // "Key generation error"
- static final String ERR_KEYGENERATION = "VWVj{fb=yd{xpbIW*Kac";
-
- // "Invalid server-ip count"
- static final String ERR_SERVERIPCOUNT = "+(
hW/8jJf~S'J\"xh.G6z$m";
-
- // "Warning: software license expires soon! Contact support to renew your
license. Current license expires on "
- static final String WARN_EXPIRATION =
"kOl8,.6.|Z\"l6Dt6U~s_towZP1$VO;lPHk+Zej[1k-Zwp%W6JF*%r+FlKaH~M$zoEc
+~9K[.=T.+o:c~]~9!}jv15{2}jeTk(Cf.?T\"JZwc";
-
- // "Error: software license validation failed. Please contact support to
resolve the issue."
- static final String ERR_FAILED_VALIDATION =
"7.z|_(I{*;8e:mu)GUV<U{hX:AQ$TEjUc}IjE}dSx&x)~dS:cu)>|o.DYwX*XDGy.j];~I;hy|qG=xw)2/Tc{b
+";
-
- // "Error: software license has become corrupt. Please contact support to
resolve the issue."
- static final String ERR_CORRUPT_VALIDATION = "sz,c{^4mK.;HDyhXdP0=Pm ]]:c4@
BcY=4`K,_]G,HX]kQ=Gm ]V~U,E>8/|/dRK,;-zk)z2K~uqhX8]<I(my)SL";
-
- // "Error: software license key has become corrupt. Please contact support to
resolve the issue."
- static final String ERR_CORRUPT_KEY =
"UmyJKX;|1{_LQc<Ih^iO^|=4:tn;/D~wMO:~`Wwiac{/d_38;JuWdkO;01P_qAy-c-qQac.I,Jj|f|1hQt8y/=4^kJj<&";
-
- // "Error: software license trial has become corrupt. Please contact support to
resolve the issue."
- static final String ERR_CORRUPT_TRIAL = "T*Kac/z~JymNh1Ww2x:%x~gjmcX
hwwQ@.eWR(a)0f.Gk*Kwh*B4wvSfhpWwia^* E_jJj 2k*{8yvzygka<2r4_wO;Xp~ItY";
-
- // "Error: trial software licenses must be updated by term licenses only.
Please contact support to solve the issue."
- static final String ERR_TRIAL_VALIDATION =
"WX];-\\$(Xf30T.wxbaYIG5>f+:f.E4}9};]5miU}>o&^i7P|\"5^i/ZTEtHit8D.5jgVe?$5.BAY;G5H8t)`&(owo`>,)^}x.T4E48V>D$(5iUr;.7R!";
-
- // salt used to calculate md5 keys for license terms - gibberish munged or not
- private static final String our_salt =
"RHQqBr,f{,{XO#P)2di^<}=KaLmhrUB3\"6Q_}E%Z7%d3FP$,E:DN/CEBdW}F\\D)1+5";
-
- // "Cannot register new platform due to licensing restrictions. Contact support
to license additional platforms. Current license permits a maximum platform count of
"
- static final String ERR_MSG_TOOMANYPLATFORMS = "tR5o~z4.
jP|zW.X5SHIdDR8z~m>)()S-zk)GUV<U~osj/{=~wzUV.$k7y+/-'k7jiV.I~biAc{z4wK]qTnW7y2/:)XojUc}Dh)idA._k.N*#-I[bz,S}z4D}BS}cW)i2_Y$,mXi/YD?oN)3-GhEj.c{`4`K)o.Ik8X";
-
- // "[License owner="
- static final String TOSTRING_START = ",WUV<U~hX|e}=y-";
-
- // " email="
- static final String EMAIL = "U:e>\\i]";
-
- // " phone="
- static final String PHONE = "U`P,rq]";
-
- // " expiration="
- static final String EXPIRATION = "^Q@R},A-sy7I";
-
- // "never"
- static final String NEVER = "Wi`:I";
-
- // "any"
- static final String ANY = "L=F";
-
- // "all"
- static final String ALL = "L`>";
-
- // " platforms="
- static final String TOSTRING_PLATFORMS = "(0Anw;|w+_/";
-
- // "unlimited"
- static final String UNLIMITED = "U%R7#5wDo";
-
- // " serverIPs="
- static final String TOSTRING_SERVERIPS = "(,Q;i ,v*_/";
-
- // " plugins="
- static final String TOSTRING_PLUGINS = "TBR$-57;x";
-
- // " support="
- static final String TOSTRING_SUPPORT = "T.T0ny.Xx";
-
- // "]"
- static final String TOSTRING_END = "m";
-
- protected static String get(String res) {
- return License.unmunge(res);
- }
-
- static String getOurSalt() {
- return our_salt;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java
deleted file mode 100644
index c6874e8..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/License.java
+++ /dev/null
@@ -1,340 +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.license;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.rhq.core.clientapi.util.StringUtil;
-
-public final class License implements Serializable {
- public static final int FEATURE_BASIC = 1;
- public static final int FEATURE_MONITOR = FEATURE_BASIC << 1;
- public static final int FEATURE_ALL = FEATURE_BASIC | FEATURE_MONITOR;
-
- private String _masterKey = null;
- private String _version = null;
- private String _licenseeName = null;
- private String _licenseeEmail = null;
- private String _licenseePhone = null;
- private long _expiration = 0;
- private int _platformLimit = 0;
- private List _serverIps = new ArrayList();
- private List _plugins = new ArrayList();
- private int _supportLevel = 1;
- private boolean trial = false;
-
- static final long EXPIRES_NEVER = 9223372036854775307L;
- static final int PLATFORMS_UNLIMITED = 2147483624;
-
- private static final char[] HEX = { '0', '1', '2',
'3', '4', '5', '6', '7', '8', '9',
'a', 'b', 'c', 'd', 'e', 'f' };
-
- private static final String MUNGABLE_CHARS_ALNUM
- // shuffled:
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
- = "6JCqLxnjaOSAkyWXsvQ7G4ueNf1hIMgbV2dDEcTU5o9HlRwFPYZBirm8ztK03p";
-
- // DON'T CHANGE THESE MUNGE MAPS, or you will BREAK our licensing code.
- private static final String MUNGABLE_CHARS
- // shuffled:
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890~!@#$%^&*()_+-=`[]\\{}|;':\",./<>?
"
- = "_{my*K|c~1kJ@apv!6l?MF9ZeH\"+#L&NC3Y`>BV0nERiA:DGdqQuh
2S<=WgtOf%r'[\\7s5o}UPT$(^bx)X]/-I4wj8;.z,";
-
- protected License() {
- _expiration = EXPIRES_NEVER;
- }
-
- protected String getMasterKey() {
- return _masterKey;
- }
-
- protected void setMasterKey(String m) {
- _masterKey = m;
- }
-
- protected String getVersion() {
- return _version;
- }
-
- protected void setVersion(String v) {
- _version = v;
- }
-
- public String getLicenseeName() {
- return _licenseeName;
- }
-
- protected void setLicenseeName(String n) {
- _licenseeName = n;
- }
-
- public String getLicenseeEmail() {
- return _licenseeEmail;
- }
-
- protected void setLicenseeEmail(String e) {
- _licenseeEmail = e;
- }
-
- public String getLicenseePhone() {
- return _licenseePhone;
- }
-
- protected void setLicenseePhone(String p) {
- _licenseePhone = p;
- }
-
- /*
- protected void setExpiration(long ex) {
- _expiration = ex;
- }
- */
-
- public boolean getIsPerpetualLicense() {
- return (_expiration == EXPIRES_NEVER);
- }
-
- public long getLicenseExpiration() {
- return _expiration;
- }
-
- protected void setPlatformLimit(int l) {
- _platformLimit = l;
- }
-
- public boolean getPlatformsUnlimited() {
- return (_platformLimit == PLATFORMS_UNLIMITED);
- }
-
- public int getPlatformLimit() {
- return _platformLimit;
- }
-
- public int getSupportLevel() {
- return _supportLevel;
- }
-
- protected void setSupportLevel(int level) {
- _supportLevel = level;
- }
-
- protected void addServerIp(int count, String addr) {
- if (_serverIps.size() >= count) {
- LicenseManager.doHalt(LRES.ERR_SERVERIPCOUNT);
- return;
- }
-
- _serverIps.add(addr);
- }
-
- public boolean getIsAnyIpOk() {
- return (_serverIps.size() > 0) &&
_serverIps.get(0).equals(LRES.get(LRES.IP_ANY));
- }
-
- public List getServerIps() {
- return _serverIps;
- }
-
- public boolean getIsAnyPluginOk() {
- return (_plugins.size() > 0) &&
_plugins.get(0).equals(LRES.get(LRES.PLUGIN_ANY));
- }
-
- protected void addPlugin(String plugin) {
- _plugins.add(plugin);
- }
-
- public List getPlugins() {
- return _plugins;
- }
-
- public boolean equals(Object o) {
- if (!(o instanceof License)) {
- return false;
- }
-
- License l = (License) o;
- return getMasterKey().equals(l.getMasterKey());
- }
-
- public String toString() {
- return LRES.get(LRES.TOSTRING_START)
- + getLicenseeName()
- + LRES.get(LRES.EMAIL)
- + getLicenseeEmail()
- + LRES.get(LRES.PHONE)
- + getLicenseePhone()
- + LRES.get(LRES.EXPIRATION)
- + (getIsPerpetualLicense() ? LRES.get(LRES.NEVER) :
ExpirationTag.DFORMAT.format(new java.util.Date(
- _expiration))) + LRES.get(LRES.TOSTRING_PLATFORMS)
- + (getPlatformsUnlimited() ? LRES.get(LRES.UNLIMITED) :
String.valueOf(_platformLimit))
- + LRES.get(LRES.TOSTRING_SERVERIPS)
- + (getIsAnyIpOk() ? LRES.get(LRES.ANY) :
StringUtil.listToString(_serverIps))
- + LRES.get(LRES.TOSTRING_PLUGINS)
- + (getIsAnyPluginOk() ? LRES.get(LRES.ALL) :
StringUtil.listToString(_plugins))
- + LRES.get(LRES.TOSTRING_SUPPORT) + getSupportLevel() +
LRES.get(LRES.TOSTRING_END);
- }
-
- /**
- * A simple one-way hash function for strings *
- */
- static String simpleHash(String s) {
- String reverse = (new StringBuffer(s)).reverse().toString();
-
- // Munge the string
- String m = munge(s);
-
- // Ensure the string is long enough to generate enough entropy
- for (int i = 0; m.length() < 1024; i++) {
- String rm = (new StringBuffer(m)).reverse().toString();
-
- // combine in different ways to increase entropy
- switch ((i + m.length()) % 5) {
- case 0: {
- m = munge(reverse + m + s);
- break;
- }
-
- case 1: {
- m = munge(s + reverse + rm);
- break;
- }
-
- case 2: {
- m = munge(rm + reverse);
- break;
- }
-
- case 3: {
- m = munge(s + m);
- break;
- }
-
- case 4: {
- m = munge(reverse + rm + m + rm);
- break;
- }
- }
- }
-
- // Remunge one last time
- m = munge(m);
-
- // Simple accumulator
- int[] accum = new int[32];
- for (int i = 0; i < 32; i++) {
- accum[i] = 0;
- }
-
- for (int i = 0; i < m.length(); i++) {
- accum[i % 32] += (int) m.charAt(i);
- }
-
- // print out as hex, taking the lower 8 bits
- // of each integer in accum, interpret as a hex digit
- StringBuffer result = new StringBuffer();
- for (int i = 0; i < 32; i++) {
- result.append(HEX[accum[i] % 16]);
- }
-
- return result.toString();
- }
-
- /**
- * @return The original form of a string that was munged with the 'munge'
method. Uses the default munge map.
- */
- static String unmunge(String s) {
- return unmunge(s, MUNGABLE_CHARS);
- }
-
- static String unmunge(String s, String mungeMap) {
- StringBuffer rstr = new StringBuffer();
- char c;
- int idx;
- int newIdx;
- int mlen = mungeMap.length();
- int lenmod = (s.length() % 37);
- for (int i = 0; i < s.length(); i++) {
- c = s.charAt(i);
- idx = mungeMap.indexOf(c);
- if (idx == -1) {
- rstr.append(c);
- } else {
- newIdx = (idx - 13 - (i % 7) - lenmod + mlen) % mlen;
- rstr.append(mungeMap.charAt(newIdx));
- }
- }
-
- return rstr.toString();
- }
-
- /**
- * Simple munger to make searching for String constants in class files more
difficult. Use the unmunge method to get
- * back to the original string. Uses the default munge map.
- */
- static String munge(String s) {
- return munge(s, MUNGABLE_CHARS);
- }
-
- /**
- * Just like the other munge map, but uses a caller-supplied munge map
- */
- static String munge(String s, String mungeMap) {
- StringBuffer rstr = new StringBuffer();
- char c;
- int idx;
- int newIdx;
- int mlen = mungeMap.length();
- int lenmod = (s.length() % 37);
- for (int i = 0; i < s.length(); i++) {
- c = s.charAt(i);
- idx = mungeMap.indexOf(c);
- if (idx == -1) {
- rstr.append(c);
- } else {
- newIdx = (idx + 13 + (i % 7) + lenmod) % mlen;
- rstr.append(mungeMap.charAt(newIdx));
- }
- }
-
- return rstr.toString();
- }
-
- static String shuffle(String s) {
- List chars = new ArrayList();
- for (int i = 0; i < s.length(); i++) {
- chars.add(new Character(s.charAt(i)));
- }
-
- Collections.shuffle(chars);
- StringBuffer rstr = new StringBuffer();
- for (int i = 0; i < chars.size(); i++) {
- rstr.append(((Character) chars.get(i)).charValue());
- }
-
- return rstr.toString();
- }
-
- public boolean isTrial() {
- return trial;
- }
-
- protected void setTrial(boolean trial) {
- this.trial = trial;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java
deleted file mode 100644
index b7a4708..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseException.java
+++ /dev/null
@@ -1,37 +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.license;
-
-public class LicenseException extends Exception {
- public LicenseException() {
- super();
- }
-
- public LicenseException(String message) {
- super(message);
- }
-
- public LicenseException(Throwable cause) {
- super(cause);
- }
-
- public LicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java
deleted file mode 100644
index 3cde0be..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseManager.java
+++ /dev/null
@@ -1,313 +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.license;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.util.Date;
-
-import javax.naming.InitialContext;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public final class LicenseManager implements Runnable, Serializable {
- private static final long serialVersionUID = -3229197855347715264L;
-
- public static final int FEATURE_MONITOR = License.FEATURE_MONITOR;
-
- private static final long WARN_EXPIRE_MILLIS = 60L * 60L * 24L * 1000L * 30L;
-
- private static Log log = LogFactory.getLog(LRES.get(LRES.LOG_NAME));
-
- private static LicenseManager _instance = new LicenseManager();
- private static volatile boolean _jndiBound = false;
-
- protected transient InitialContext ic = null;
- protected String JNDI_NAME = LRES.get(LRES.JNDI_NAME);
- private License _license;
- private transient Thread _expirationEnforcementThread = null;
-
- private boolean licenseLoaded = false;
- private boolean licenseExpired = false;
-
- private LicenseManager() {
- try {
- ic = new InitialContext();
- } catch (Exception e) {
- doHalt(LRES.ERR_MSG_JNDIIC, e);
- }
- }
-
- public static LicenseManager instance() {
- if (!_jndiBound) {
- _instance.bind();
- }
-
- try {
- return (LicenseManager) _instance.ic.lookup(_instance.JNDI_NAME);
- } catch (Exception e) {
- doHalt(LRES.ERR_MSG_JNDILOOKUP, e);
- throw new IllegalStateException();
- }
- }
-
- private synchronized void bind() {
- if (_jndiBound) {
- return;
- }
-
- try {
- ic.rebind(JNDI_NAME, _instance);
- } catch (Exception e) {
- doHalt(LRES.ERR_MSG_JNDIBIND, e);
- throw new IllegalStateException();
- }
- }
-
- /**
- * Tests a license file by running it through the parser. Throws an exception if
something fails to parse. Proper
- * exceptions should really be integrated at some point.
- */
- public static void checkLicense(InputStream licenseFile) throws
LicenseParsingException,
- UnavailableLicenseException, CorruptLicenseException, UpdateTrialLicenseException
{
- LicenseParser lp;
- lp = new LicenseParser();
- License license = lp.parse(licenseFile);
-
- LicenseStoreManager.store(license);
- }
-
- /**
- * Read the license data
- */
- private final void initialize(String licenseFile) {
- LicenseParser lp;
- File lfile = new File(licenseFile);
- try {
- if (!lfile.exists()) {
- throw new FileNotFoundException(licenseFile);
- }
-
- lp = new LicenseParser();
- _license = lp.parse(lfile);
- licenseLoaded = true;
- } catch (Exception e) {
- licenseLoaded = false;
- }
- }
-
- protected static final void doHalt(String msg, Exception e) {
- doHaltThrowable(msg, e);
- }
-
- private static final void doHaltThrowable(String msg, Throwable t) {
- if (t != null) {
- log.error(LRES.get(msg) + ": " + t + "\n\n" +
LRES.get(LRES.HALT_MSG));
- // t.printStackTrace();
- } else {
- log.error(LRES.get(msg) + "\n\n" + LRES.get(LRES.HALT_MSG));
- // (new Exception("no exception")).printStackTrace();
- }
-
- // Would be nice to obfuscate the call to "halt" here, otherwise
- // it is something easy to search the classfiles for
- //Runtime.getRuntime().halt(0);
-
- // should never get here, but just in case
- throw new IllegalStateException();
- }
-
- protected static final void doHalt(String msg) {
- doHalt(msg, null);
- }
-
- /**
- * Called by ProductPluginDeployer at startup to enforce the following license
provisions: <license-expiration> :
- * ensure that the customer's license has not expired <server-ip> : ensure
that at least one of the server's IPs
- * matches one of the licensed IPs.
- */
- public final void doStartupCheck(String licenseFile) {
- try {
- initialize(licenseFile);
- log.info(_license.toString());
- enforceExpiration();
- enforceServerIp();
- } catch (Exception e) {
- // doHalt(LRES.ERR_INIT_EXC, e);
- } catch (Throwable t) {
- // doHaltThrowable(LRES.ERR_INIT_ERROR, t);
- throw new IllegalStateException();
- }
- }
-
- public boolean isLicenseExpired() {
- return licenseExpired;
- }
-
- public boolean isLicenseLoaded() {
- return licenseLoaded;
- }
-
- private final void enforceExpiration() {
- licenseExpired = false;
-
- if ((_license == null) || _license.getIsPerpetualLicense()) {
- return;
- }
-
- long ex = 0;
- try {
- ex = LicenseStoreManager.store(_license);
- } catch (LicenseException le) {
- licenseExpired = true;
- log.warn(le.getMessage());
- }
-
- long diff = ex - System.currentTimeMillis();
- if (diff < 0) {
- // doHalt(LRES.ERR_MSG_EXPIRED);
- // throw new IllegalStateException();
- licenseExpired = true;
- } else if (diff < WARN_EXPIRE_MILLIS) {
- log.warn(LRES.get(LRES.WARN_EXPIRATION) + ExpirationTag.DFORMAT.format(new
Date(ex)));
- }
-
- // Make sure we continue to check expiration date
- if (_expirationEnforcementThread == null) {
- _expirationEnforcementThread = new Thread(this);
- _expirationEnforcementThread.setDaemon(true);
- _expirationEnforcementThread.start();
- }
- }
-
- public void run() {
- long millisInDay = 1000 * 60 * 60 * 24;
- while (true) {
- try {
- Thread.sleep(millisInDay);
- } catch (InterruptedException e) {
- }
-
- enforceExpiration();
- }
- }
-
- private final void enforceServerIp() {
- // // Easy out
- // if (_license == null || _license.getIsAnyIpOk()) return;
- //
- // List okIps = _license.getServerIps();
- // Sigar sigar = null;
- // try {
- // sigar = new Sigar();
- //
- // String[] netInterfaces = sigar.getNetInterfaceList();
- // String ifaceName = null;
- // NetInterfaceConfig iface = null;
- // String addr;
- //
- // for ( int i=0; i<netInterfaces.length; i++ ) {
- // ifaceName = netInterfaces[i];
- // iface = sigar.getNetInterfaceConfig(ifaceName);
- // addr = iface.getAddress();
- //
- // if (okIps.contains(addr)) return;
- // }
- // doHalt(LRES.ERR_MSG_NOIPS);
- // throw new IllegalStateException();
- //
- // } catch (SigarException e) {
- // doHalt(LRES.ERR_MSG_NETIF, e);
- // throw new IllegalStateException();
- // } finally {
- // if (sigar != null) {
- // sigar.close();
- // }
- // }
- }
-
- public boolean isPluginEnabled(String name) {
- if ((_license == null) || _license.getIsAnyPluginOk()) {
- return true;
- }
-
- boolean enabled = _license.getPlugins().contains(name);
- return enabled;
- }
-
- public void enforcePlatformLimit(int count) throws PlatformLimitException {
- if (_license == null) {
- return; // temporarily ignore limits before license is loaded
- }
-
- if (_license.getPlatformsUnlimited()) {
- return;
- }
-
- if (count > _license.getPlatformLimit()) {
- String msg = LRES.get(LRES.ERR_MSG_TOOMANYPLATFORMS) +
_license.getPlatformLimit();
- throw new PlatformLimitException(msg, _license.getPlatformLimit());
- }
- }
-
- public void enforceFeatureLimit(int feature) throws FeatureUnavailableException {
- LicenseManager.enforceFeatureLimit(_license, feature);
- }
-
- public static void enforceFeatureLimit(License license, int feature) throws
FeatureUnavailableException {
- if ((license != null) && ((license.getSupportLevel() & feature) ==
0)) {
- switch (feature) {
- case FEATURE_MONITOR: {
- throw new FeatureUnavailableException("Monitor feature is not
supported");
- }
-
- default: {
- throw new FeatureUnavailableException("Unknown feature " +
feature + " is not supported");
- }
- }
- }
- }
-
- public License getLicense() {
- return _license;
- }
-
- public static String getLicenseFileName() {
- return LRES.get(LRES.LICENSE_LOCATION);
- }
-
- /**
- * @return The expiration time in millis, or -1 if there is no expiration.
- */
- public long getExpiration() throws LicenseException {
- if ((_license == null) || _license.getIsPerpetualLicense()) {
- return -1;
- }
-
- //return _license.getLicenseExpiration();
- return LicenseStoreManager.store(_license);
- }
-
- public String getLicenseInfoString() {
- return _license.toString();
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java
deleted file mode 100644
index 7f487a2..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParser.java
+++ /dev/null
@@ -1,55 +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.license;
-
-import java.io.File;
-import java.io.InputStream;
-import org.rhq.core.util.xmlparser.XmlParseException;
-import org.rhq.core.util.xmlparser.XmlParser;
-
-final class LicenseParser {
- protected LicenseParser() {
- }
-
- protected final License parse(File f) throws LicenseParsingException {
- License lic = new License();
- LicenseTag tag = new LicenseTag(lic);
-
- try {
- XmlParser.parse(f, tag);
- } catch (XmlParseException xpe) {
- throw new LicenseParsingException(xpe);
- }
-
- return lic;
- }
-
- protected final License parse(InputStream is) throws LicenseParsingException {
- License lic = new License();
- LicenseTag tag = new LicenseTag(lic);
-
- try {
- XmlParser.parse(is, tag);
- } catch (XmlParseException xpe) {
- throw new LicenseParsingException(xpe);
- }
-
- return lic;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java
deleted file mode 100644
index 541e990..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseParsingException.java
+++ /dev/null
@@ -1,37 +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.license;
-
-public class LicenseParsingException extends Exception {
- public LicenseParsingException() {
- super();
- }
-
- public LicenseParsingException(String message) {
- super(message);
- }
-
- public LicenseParsingException(Throwable cause) {
- super(cause);
- }
-
- public LicenseParsingException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java
deleted file mode 100644
index 1a97e8d..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseStoreManager.java
+++ /dev/null
@@ -1,214 +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.license;
-
-import java.util.prefs.Preferences;
-
-public class LicenseStoreManager {
- private static long CUT_POINT = 424242L;
-
- // PREFIX_EXPIRATION := munge("com/jboss/jbossnetwork/expiration");
- private static final String PREFIX_EXPIRATION = "
ZQVA`#MFBiY+\"M4}pi+F<>}Yr,Fg@;H8";
-
- // PREFX_DIV := munge("com/jboss/jbossnetwork/quotient");
- private static final String PREFIX_DIV =
"uFd>R3\"l?`ECHel-5@EH?2Y_yepz7-J";
-
- // PREFIX_MOD := munge("com/jboss/jbossnetwork/modulus");
- private static final String PREFIX_MOD = "QMG`ECH6lYnNeZ6/sJnel
3G9_*\\,l";
-
- // PREFIX_TRIAL := munge("preference/trial");
- private static final String PREFIX_TRIAL = "i,S,=ygsBSFzy^Rd";
-
- // PREFIX_MAJOR_KEY := munge("major/license/key");
- private static final String PREFIX_MAJOR_KEY =
"CA\"1ye2UV<U~gHnS`";
-
- private LicenseStoreManager() {
- super();
- }
-
- /**
- * @param license
- *
- * @return the expiration in the BackingStore, if one exists. Otherwise, it returns
the date found in license.
- * Handles duration licenses different than regular licenses (see Exception
descriptions below).
- *
- * @throws UnavailableLicenseException if the BackingStore is not available. It must
be available to retrieve the
- * expiration date.
- * @throws CorruptLicenseException if the expiration date in the backing store
was tampered with
- * @throws UpdateTrialLicenseException if the user is trying to update any previously
installed license with a trial
- * license, unless the previous one and the
current one match (have the same
- * master keys), in which case the previously
calculated date will be used
- */
- public static long store(License license) throws UnavailableLicenseException,
CorruptLicenseException,
- UpdateTrialLicenseException {
- if (!BackingStore.isAvailable()) {
- throw new UnavailableLicenseException(LRES.get(LRES.ERR_FAILED_VALIDATION));
- }
-
- // get the various license bits from the backing store
- Preferences prefs = Preferences.userRoot();
- String str_expiration = prefs.get(PREFIX_EXPIRATION, "");
- String str_major_key = prefs.get(PREFIX_MAJOR_KEY, "");
- String str_trial = prefs.get(PREFIX_TRIAL, "");
-
- long expiration = 0;
- long quotient = 0;
- long modulus = 0;
-
- boolean trial = false;
-
- /*
- * Either:
- *
- * 1) RHQ was newly installed, or 2) The user deleted all backing store entries
- *
- * Regardless, it passes the check
- */
- if ("".equals(str_expiration + str_major_key + str_trial)) {
- expiration = storeLicenseBits(license, prefs);
- } else {
- if (license.isTrial()) {
- /*
- * we can't install a new trial license unless it matches up
perfectly with the one we have written to
- * the store, which means it: a) the store has record of a trial
license b) the master key values
- * match up c) the time hasn't been mangled with
- */
-
- /*
- * we must find the trial value, and ensure that it's true
- */
- try {
- trial = ((Integer.parseInt(str_trial) % 2) == 1);
- } catch (NumberFormatException nfe) {
- throw new CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_TRIAL));
- }
-
- if (trial) {
- /*
- * can't update a trial license with another trial license,
unless it's the same one (using master
- * key comparison). thus, if the user tries to mess with the master
key from a trial license it'll
- * only break the license features and let us know there was
tampering.
- */
- if (!license.getMasterKey().equals(str_major_key)) {
- throw new
CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_KEY));
- }
-
- /*
- * furthermore, it can only be updated if it's not corrupt.
otherwise, the previous date can't be
- * considered reliable.
- */
- try {
- quotient = decode(prefs.get(PREFIX_DIV, ""));
- modulus = decode(prefs.get(PREFIX_MOD, ""));
- expiration = decode(str_expiration);
- } catch (NumberFormatException nfe) {
- throw new
CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_VALIDATION));
- }
-
- if (((quotient * CUT_POINT) + modulus) != expiration) {
- throw new
CorruptLicenseException(LRES.get(LRES.ERR_CORRUPT_VALIDATION));
- }
-
- return license.getLicenseExpiration();
- } else {
- // can't update a real/regular license with a trial one
- throw new
UpdateTrialLicenseException(LRES.get(LRES.ERR_TRIAL_VALIDATION));
- }
- } else {
- /*
- * the simplest logic: forget about everything in the store if you have a
real/regular, date-based
- * license; all the fancy rules, regulations, restrictions go away for
this case
- */
- expiration = storeLicenseBits(license, prefs);
- }
- }
-
- return expiration;
- }
-
- private static long storeLicenseBits(License license, Preferences prefs) {
- long expiration = license.getLicenseExpiration();
- long quotient = expiration / CUT_POINT;
- long modulus = expiration % CUT_POINT;
-
- prefs.put(PREFIX_EXPIRATION, encode(expiration));
- prefs.put(PREFIX_DIV, encode(quotient));
- prefs.put(PREFIX_MOD, encode(modulus));
-
- int result = getModRandom(license);
- prefs.put(PREFIX_TRIAL, Integer.toString(result));
-
- prefs.put(PREFIX_MAJOR_KEY, license.getMasterKey());
- return expiration;
- }
-
- /*
- * Generate a large random number so that it looks munged on the disk
- *
- * If the license was a trial, make it odd; otherwise, make it even
- */
- private static int getModRandom(License lic) {
- return (2 * (int) (Math.random() * 1000000.0)) + (lic.isTrial() ? 1 : 0);
- }
-
- private static String encode(long value) {
- String temp = String.valueOf(value);
- StringBuffer buff = new StringBuffer();
- int nextNum = 0;
- for (int i = 0, sz = temp.length(); i < sz; i++) {
- nextNum = (int) (temp.charAt(i) - '0');
- nextNum += 2 * i;
- if ((nextNum % 2) == 0) {
- nextNum += 6;
- } else {
- nextNum += 4;
- }
- while (nextNum > 9) {
- nextNum -= 10;
- }
-
- buff.append((char) (nextNum + '0'));
- }
-
- return buff.toString();
- }
-
- private static long decode(String value) {
- String temp = String.valueOf(value);
- StringBuffer buff = new StringBuffer();
- int nextNum = 0;
- for (int i = 0, sz = temp.length(); i < sz; i++) {
- nextNum = (int) (temp.charAt(i) - '0');
- if ((nextNum % 2) == 0) {
- nextNum -= 6;
- } else {
- nextNum -= 4;
- }
-
- nextNum -= 2 * i;
- while (nextNum < 0) {
- nextNum += 10;
- }
-
- buff.append((char) (nextNum + '0'));
- }
-
- return Long.valueOf(buff.toString()).longValue();
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java
deleted file mode 100644
index af37b33..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTag.java
+++ /dev/null
@@ -1,108 +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.license;
-
-import java.io.IOException;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlAttrHandler;
-import org.rhq.core.util.xmlparser.XmlTagHandler;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class LicenseTag implements XmlTagHandler, XmlAttrHandler {
- private License _license;
-
- protected LicenseTag(License lic) {
- _license = lic;
- }
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_KEY),
XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_VERSION), XmlAttr.OPTIONAL) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_LICENSE);
- }
-
- protected License getLicense() {
- return _license;
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] { new XmlTagInfo(new LicenseeTag(this),
XmlTagInfo.REQUIRED),
- new XmlTagInfo(new ExpirationTag(this), XmlTagInfo.REQUIRED),
- new XmlTagInfo(new ServerIpTag(this), XmlTagInfo.ONE_OR_MORE),
- new XmlTagInfo(new PlatformLimitTag(this), XmlTagInfo.REQUIRED),
- new XmlTagInfo(new PluginTag(this), XmlTagInfo.ONE_OR_MORE),
- new XmlTagInfo(new SupportLevelTag(this), XmlTagInfo.REQUIRED), };
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if (attrNumber == 0) { // "key"
- setMasterKey(value);
- } else if (attrNumber == 1) { // "version"
- setVersion(value);
- } else {
- LicenseManager.doHalt(LRES.MSG_BADINDEX);
- throw new IllegalArgumentException();
- }
- }
-
- protected void setMasterKey(String s) {
- _license.setMasterKey(s);
- }
-
- protected void setVersion(String v) {
- _license.setVersion(v);
- }
-
- protected String generateKey() {
- String our_salt = LRES.get(LRES.getOurSalt());
- try {
- return hash(String.valueOf(our_salt + "@" +
System.currentTimeMillis()));
- } catch (Exception e) {
- LicenseManager.doHalt(LRES.ERR_KEYGENERATION, e);
- throw new IllegalStateException();
- }
- }
-
- protected String getMasterKey() {
- return _license.getMasterKey();
- }
-
- protected String getVersion() {
- return _license.getVersion();
- }
-
- protected static String hash(String s) throws IOException {
- // Does not work on RedHat AS 3.0
- // return FileMD5.getDigestFromString(s);
-
- // Apparently even this has problems on Windows
- // return FileMD5.getPureJavaMD5(s);
-
- // Let's try something so dumb, so simple,
- // that it just HAS to work on every stinkin' platform.
- return License.simpleHash(s);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java
deleted file mode 100644
index c5626f6..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseTermTag.java
+++ /dev/null
@@ -1,84 +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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttrHandler;
-import org.rhq.core.util.xmlparser.XmlTagException;
-import org.rhq.core.util.xmlparser.XmlTagExitHandler;
-import org.rhq.core.util.xmlparser.XmlTagHandler;
-
-abstract class LicenseTermTag implements XmlTagHandler, XmlAttrHandler, XmlTagExitHandler
{
- // This is the super secret 'salt' that we use to calculate
- // our MD5. We should really use some PKI here instead, but
- // this is a lot simpler and easier to do right now.
- private String our_salt = null;
-
- private License _license;
- private String _key;
-
- protected LicenseTermTag(LicenseTag lt) {
- _license = lt.getLicense();
- our_salt = LRES.get(LRES.getOurSalt());
- }
-
- protected License getLicense() {
- return _license;
- }
-
- protected void setKey(String key) {
- _key = key;
- }
-
- // Called before validation begins
- protected void preValidate() {
- }
-
- // Called to get the value to compare against the key
- protected abstract String getValidationComparisonValue();
-
- // Called when validation is successful
- protected abstract void termValidated();
-
- public void exit() throws XmlTagException {
- // Validate a value against a key
- String key = generateKey();
- if (!key.equals(_key)) {
- // System.err.println(getClass().getName() + ": given
key("+_key+") doesnt match realkey="+key);
- //LicenseManager.doHalt(LRES.ERR_VALIDATION);
- throw new IllegalStateException();
- }
-
- termValidated();
- }
-
- protected String generateKey() {
- String value = getValidationComparisonValue();
- if ((value == null) || (value.length() == 0)) {
- LicenseManager.doHalt(LRES.ERR_NOVALUE);
- throw new IllegalStateException();
- }
-
- try {
- return LicenseTag.hash(value + our_salt + value.charAt(0) + getName() +
"$" + _license.getMasterKey());
- } catch (Exception e) {
- LicenseManager.doHalt(LRES.ERR_KEYVALIDATION, e);
- throw new IllegalStateException();
- }
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java
deleted file mode 100644
index 6128cfa..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/LicenseeTag.java
+++ /dev/null
@@ -1,103 +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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class LicenseeTag extends LicenseTermTag {
- protected LicenseeTag(LicenseTag lt) {
- super(lt);
- }
-
- protected LicenseeTag(LicenseTag lt, String name, String email, String phone) {
- super(lt);
- _name = name;
- _email = email;
- _phone = phone;
- }
-
- private String _name = null;
- private String _email = null;
- private String _phone = null;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_NAME),
XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_EMAIL), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_PHONE), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_LICENSEE);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getLicenseeName() {
- return _name;
- }
-
- protected String getLicenseeEmail() {
- return _email;
- }
-
- protected String getLicenseePhone() {
- return _phone;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber < 0) || (attrNumber > (ATTRS.length - 1))) {
- LicenseManager.doHalt(LRES.MSG_BADINDEX);
- throw new IllegalStateException();
- }
-
- if (attrNumber == 0) {
- _name = value;
- } else if (attrNumber == 1) {
- _email = value;
- } else if (attrNumber == 2) {
- _phone = value;
- } else {
- setKey(value);
- }
- }
-
- protected void preValidate() {
- if ((_name == null) || (_email == null) || (_phone == null)) {
- LicenseManager.doHalt(LRES.ERR_INVALIDLICENSEE);
- throw new IllegalStateException();
- }
- }
-
- protected String getValidationComparisonValue() {
- return _name + ":" + _email + ":" + _phone;
- }
-
- protected void termValidated() {
- getLicense().setLicenseeName(_name);
- getLicense().setLicenseeEmail(_email);
- getLicense().setLicenseePhone(_phone);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java
deleted file mode 100644
index 6c436fc..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitException.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.server.license;
-
-import org.rhq.enterprise.server.legacy.common.ApplicationException;
-
-public class PlatformLimitException extends ApplicationException {
- private int limit = -1;
-
- public PlatformLimitException(String msg, int limit) {
- super(msg);
- this.limit = limit;
- }
-
- public int getLimit() {
- return limit;
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java
deleted file mode 100644
index fb23cbc..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PlatformLimitTag.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-package org.rhq.enterprise.server.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class PlatformLimitTag extends LicenseTermTag {
- protected PlatformLimitTag(LicenseTag lt) {
- super(lt);
- }
-
- private int _count = 0;
- private String _origValue = null;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_COUNT),
XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_PLATFORMLIMIT);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getOriginalPlatformLimitString() {
- return _origValue;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- if (value.equals(LRES.get(LRES.PLATFORMS_UNLIMITED))) {
- _count = License.PLATFORMS_UNLIMITED;
- _origValue = value;
- } else {
- try {
- _count = Integer.parseInt(value);
- _origValue = value;
- } catch (Exception e) {
- throw new XmlAttrException(LRES.get(LRES.ERR_MSG_BADCOUNT));
- }
- }
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return String.valueOf(_count);
- }
-
- protected void termValidated() {
- getLicense().setPlatformLimit(_count);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java
deleted file mode 100644
index 0dd4cb4..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/PluginTag.java
+++ /dev/null
@@ -1,70 +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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class PluginTag extends LicenseTermTag {
- protected PluginTag(LicenseTag lt) {
- super(lt);
- }
-
- private String _plugin = "";
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_NAME),
XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_PLUGINENABLE);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getPlugin() {
- return _plugin;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- _plugin = value;
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return _plugin;
- }
-
- protected void termValidated() {
- getLicense().addPlugin(_plugin);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java
deleted file mode 100644
index 201a922..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/ServerIpTag.java
+++ /dev/null
@@ -1,90 +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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class ServerIpTag extends LicenseTermTag {
- protected ServerIpTag(LicenseTag lt) {
- super(lt);
- }
-
- private String _address = null;
- private int _count = 0;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_ADDRESS),
XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_COUNT), XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_SERVERIP);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected int getCount() {
- return _count;
- }
-
- protected String getAddress() {
- return _address;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1) && (attrNumber != 2))
{
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- _address = value;
- } else if (attrNumber == 1) {
- try {
- _count = Integer.parseInt(value);
- } catch (Exception e) {
- throw new XmlAttrException(LRES.get(LRES.ERR_MSG_BADCOUNT));
- }
- } else {
- setKey(value);
- }
- }
-
- protected void preValidate() {
- if ((_address == null) || (_count == 0)) {
- throw new IllegalStateException(LRES.get(LRES.ERR_INVALIDSERVERIP));
- }
- }
-
- protected String getValidationComparisonValue() {
- return _count + ":" + _address;
- }
-
- protected void termValidated() {
- if (_address != null) {
- getLicense().addServerIp(_count, _address);
- }
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java
deleted file mode 100644
index 381f20f..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/SupportLevelTag.java
+++ /dev/null
@@ -1,76 +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.license;
-
-import org.rhq.core.util.xmlparser.XmlAttr;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-import org.rhq.core.util.xmlparser.XmlTagInfo;
-
-final class SupportLevelTag extends LicenseTermTag {
- protected SupportLevelTag(LicenseTag lt) {
- super(lt);
- }
-
- private int _level = 0;
- private String _origValue = null;
-
- private static final XmlAttr[] ATTRS = { new XmlAttr(LRES.get(LRES.ATTR_LEVEL),
XmlAttr.REQUIRED),
- new XmlAttr(LRES.get(LRES.ATTR_KEY), XmlAttr.REQUIRED) };
-
- public String getName() {
- return LRES.get(LRES.TAGNAME_SUPPORTLEVEL);
- }
-
- public XmlTagInfo[] getSubTags() {
- return new XmlTagInfo[] {};
- }
-
- public XmlAttr[] getAttributes() {
- return ATTRS;
- }
-
- protected String getOriginalSupportLevelString() {
- return _origValue;
- }
-
- public void handleAttribute(int attrNumber, String value) throws XmlAttrException {
- if ((attrNumber != 0) && (attrNumber != 1)) {
- throw new XmlAttrException(LRES.get(LRES.MSG_BADINDEX));
- }
-
- if (attrNumber == 0) {
- try {
- _level = Integer.parseInt(value);
- _origValue = value;
- } catch (Exception e) {
- throw new XmlAttrException(LRES.get(LRES.ERR_MSG_BADLEVEL));
- }
- } else {
- setKey(value);
- }
- }
-
- protected String getValidationComparisonValue() {
- return String.valueOf(_level);
- }
-
- protected void termValidated() {
- getLicense().setSupportLevel(_level);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java
deleted file mode 100644
index b0c2eb3..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UnavailableLicenseException.java
+++ /dev/null
@@ -1,37 +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.license;
-
-public class UnavailableLicenseException extends LicenseException {
- public UnavailableLicenseException() {
- super();
- }
-
- public UnavailableLicenseException(String message) {
- super(message);
- }
-
- public UnavailableLicenseException(Throwable cause) {
- super(cause);
- }
-
- public UnavailableLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.java
deleted file mode 100644
index 60e0346..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/license/UpdateTrialLicenseException.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.enterprise.server.license;
-
-public class UpdateTrialLicenseException extends LicenseException {
- public UpdateTrialLicenseException() {
- }
-
- public UpdateTrialLicenseException(String message) {
- super(message);
- }
-
- public UpdateTrialLicenseException(Throwable cause) {
- super(cause);
- }
-
- public UpdateTrialLicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
index 275f063..ea1e067 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/perspective/activator/context/GlobalActivationContext.java
@@ -22,11 +22,11 @@ import java.util.EnumSet;
import java.util.Set;
import org.jetbrains.annotations.NotNull;
+
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.authz.Permission;
import org.rhq.enterprise.server.authz.AuthorizationManagerLocal;
import org.rhq.enterprise.server.perspective.activator.LicenseFeature;
-import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
/**
@@ -52,15 +52,11 @@ public class GlobalActivationContext implements ActivationContext {
// lazy load
if (this.licenseFeatures == null) {
this.licenseFeatures = EnumSet.noneOf(LicenseFeature.class);
- SystemManagerLocal systemManager = LookupUtil.getSystemManager();
- boolean monitoringEnabled = systemManager.isMonitoringEnabled();
- if (monitoringEnabled) {
- this.licenseFeatures.add(LicenseFeature.MONITORING);
- }
+ this.licenseFeatures.add(LicenseFeature.MONITORING); // always give this
permission
}
return this.licenseFeatures;
}
-
+
public Subject getSubject() {
return this.subject;
}
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.java
deleted file mode 100644
index c4785a3..0000000
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/LicenseException.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.enterprise.server.system;
-
-public class LicenseException extends RuntimeException {
- public LicenseException() {
- }
-
- public LicenseException(String message) {
- super(message);
- }
-
- public LicenseException(String message, Throwable cause) {
- super(message, cause);
- }
-
- public LicenseException(Throwable cause) {
- super(cause);
- }
-}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
index 7e4ce9e..dd65ec1 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerBean.java
@@ -19,21 +19,17 @@
package org.rhq.enterprise.server.system;
import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
import java.lang.management.ManagementFactory;
import java.net.URL;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Collection;
-import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
-import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.ejb.Stateless;
import javax.ejb.Timeout;
@@ -67,10 +63,6 @@ import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.authz.RequiredPermission;
import org.rhq.enterprise.server.core.CoreServerMBean;
import org.rhq.enterprise.server.core.CustomJaasDeploymentServiceMBean;
-import org.rhq.enterprise.server.license.FeatureUnavailableException;
-import org.rhq.enterprise.server.license.License;
-import org.rhq.enterprise.server.license.LicenseManager;
-import org.rhq.enterprise.server.license.LicenseStoreManager;
import org.rhq.enterprise.server.util.LookupUtil;
@Stateless
@@ -103,18 +95,11 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
@javax.annotation.Resource
private TimerService timerService;
- private LicenseManager licenseManager;
-
@EJB
private SystemManagerLocal systemManager;
private static Properties systemConfigurationCache = null;
private final String TIMER_DATA = "SystemManagerBean.reloadConfigCache";
- @PostConstruct
- public void initialize() {
- licenseManager = LicenseManager.instance();
- }
-
@SuppressWarnings("unchecked")
public void scheduleConfigCacheReloader() {
// each time the webapp is reloaded, we don't want to create duplicate jobs
@@ -530,19 +515,6 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
return;
}
- /**
- * See if monitoring feature is enabled for product.
- */
- public boolean isMonitoringEnabled() {
- try {
-
LicenseManager.instance().enforceFeatureLimit(LicenseManager.FEATURE_MONITOR);
- return true;
- } catch (FeatureUnavailableException e) {
- log.debug("Monitoring feature is not enabled");
- return false;
- }
- }
-
public boolean isDebugModeEnabled() {
try {
return
Boolean.valueOf(getSystemConfiguration().getProperty(RHQConstants.EnableDebugMode,
"false"));
@@ -560,102 +532,6 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
}
}
- /**
- * Retrieves the currently active license. Returns null if there is no active
license. Otherwise it needs to
- * propogate the appropriate error back up to the caller, otherwise the error will be
masked, and from a UI
- * perspective the user will think no license has been installed yet.
- *
- * @return The License object
- */
- public License getLicense() {
- // it's legal to return a null license, which then by-passes the check to
- // whether the expirationDate in the backing store has been fiddled with
- License license = LicenseManager.instance().getLicense();
- if (license == null) {
- return license;
- }
-
- // but if the license exists, it can only be returned if the data in the backing
store is consistent. so call
- // the get method, which checks the backing store, and returns the license. if
there are any errors, they will
- // bubble up as exceptions for the UI to handle appropriately. otherwise, the
license will be synced with the
- // backing store appropriately.
- try {
- LicenseStoreManager.store(license);
- } catch (Exception ule) {
- log.error(ule.getMessage());
- throw new LicenseException(ule);
- }
-
- return license;
- }
-
- /**
- * Update the deployed license file by writing it to disk and reinitializing the
LicenseManager static singleton.
- *
- * @param licenseData a byte array of the license data
- */
- @RequiredPermission(Permission.MANAGE_SETTINGS)
- public void updateLicense(Subject subject, byte[] licenseData) {
- try {
- File serverHomeDir = LookupUtil.getCoreServer().getJBossServerHomeDir();
-
- File deployDirectory = new File(serverHomeDir, "deploy");
-
- String licenseFileName = LicenseManager.getLicenseFileName();
-
- if (deployDirectory.exists()) {
- String licenseDirectoryName = deployDirectory.getAbsolutePath() +
File.separator
- + RHQConstants.EAR_FILE_NAME + File.separator + "license";
- File licenseDir = new File(licenseDirectoryName);
- if (licenseDir.exists()) {
- File licenseFile = saveLicenseFile(licenseDir, licenseFileName,
licenseData);
-
- // Now, we've updated the licenses on disk and we'll
re-initialize the LicenseManager
-
LicenseManager.instance().doStartupCheck(licenseFile.getAbsolutePath());
- } else {
- log.error("Could not update license file in non-existent
directory: "
- + licenseDir.getAbsolutePath());
- }
- }
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
-
- private File saveLicenseFile(File dataDir, String licenseFileName, byte[]
licenseData) throws IOException {
- log.debug("Updating license file in directory: " +
dataDir.getAbsolutePath());
-
- // Copy file to data dir
- File licenseFile = new File(dataDir, licenseFileName);
- FileOutputStream fos = new FileOutputStream(licenseFile);
-
- // Writing in a single block since
- // a) we may be writing it twice, and
- // b) the license files are fairly small
- // c) this will be rare
- fos.write(licenseData);
- fos.close();
- return licenseFile;
- }
-
- /**
- * @return the expiration date, or null if the product never expires.
- */
- public Date getExpiration() {
- long exp;
- try {
- exp = licenseManager.getExpiration();
- } catch (Exception e) {
- throw new LicenseException(e);
- }
-
- if (exp == -1) {
- return null;
- }
-
- return new Date(exp);
- }
-
public ServerVersion getServerVersion(Subject subject) throws Exception {
CoreServerMBean coreServer = LookupUtil.getCoreServer();
String version = coreServer.getVersion();
@@ -668,5 +544,5 @@ public class SystemManagerBean implements SystemManagerLocal,
SystemManagerRemot
CoreServerMBean coreServer = LookupUtil.getCoreServer();
ProductInfo productInfo = coreServer.getProductInfo();
return productInfo;
- }
+ }
}
\ No newline at end of file
diff --git
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
index e044b0a..7aa9b6d 100644
---
a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
+++
b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/system/SystemManagerLocal.java
@@ -18,7 +18,6 @@
*/
package org.rhq.enterprise.server.system;
-import java.util.Date;
import java.util.Properties;
import javax.ejb.Local;
@@ -26,7 +25,6 @@ import javax.ejb.Local;
import org.rhq.core.db.DatabaseType;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.ProductInfo;
-import org.rhq.enterprise.server.license.License;
/**
* Provides access to the server cloud's system configuration as well as some
methods
@@ -155,17 +153,6 @@ public interface SystemManagerLocal {
boolean isExperimentalFeaturesEnabled();
- //////////////////////////////////
- // license specific methods follow
-
- boolean isMonitoringEnabled();
-
- License getLicense();
-
- void updateLicense(Subject subject, byte[] licenseData);
-
- Date getExpiration();
-
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//
// The following are shared with the Remote Interface
diff --git a/modules/enterprise/server/license-gen/jar/pom.xml
b/modules/enterprise/server/license-gen/jar/pom.xml
deleted file mode 100644
index 4ccb2ff..0000000
--- a/modules/enterprise/server/license-gen/jar/pom.xml
+++ /dev/null
@@ -1,88 +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.0.0-SNAPSHOT</version>
- <relativePath>../../../../../pom.xml</relativePath>
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-license-gen</artifactId>
- <packaging>jar</packaging>
-
- <name>RHQ Enterprise Server License Generator JAR</name>
- <description>RHQ enterprise server license generator JAR</description>
-
- <scm>
-
<
connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/ente...
-
<
developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/mod...
- </scm>
-
- <properties>
-
<scm.module.path>modules/enterprise/server/license-gen/jar/</scm.module.path>
- </properties>
-
- <dependencies>
-
- <!-- Internal Deps -->
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-util</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-core-client-api</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifest>
-
<mainClass>org.rhq.enterprise.server.license.LicenseGenerator</mainClass>
- <addClasspath>true</addClasspath>
- <classpathPrefix>lib</classpathPrefix>
- </manifest>
- </archive>
- </configuration>
- </plugin>
-
- <plugin>
- <artifactId>maven-dependency-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-dependencies</id>
- <phase>package</phase>
- <goals>
- <goal>copy-dependencies</goal>
- </goals>
- <configuration>
- <includeScope>runtime</includeScope>
- <excludeTransitive>true</excludeTransitive>
- <outputDirectory>target/lib</outputDirectory>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git
a/modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java
b/modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java
deleted file mode 100644
index 397366d..0000000
---
a/modules/enterprise/server/license-gen/jar/src/main/java/org/rhq/enterprise/server/license/LicenseGenerator.java
+++ /dev/null
@@ -1,267 +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.license;
-
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import org.rhq.core.clientapi.util.StringUtil;
-import org.rhq.core.util.xmlparser.XmlAttrException;
-
-public final class LicenseGenerator {
-
- public static final String EVAL_NAME = "Evaluation Customer";
- public static final String EVAL_EMAIL = "johndoe(a)example.com";
- public static final String EVAL_PHONE = "888-555-1212";
-
- public static final String LICENSE_VERSION = "2.0";
-
- public static final String LICENSE_HEADER = "\n<!--"
- + "\n This license should be uploaded to your RHQ Server in the"
- + "\n Manage License section of the Administration area. If you
have"
- + "\n not already installed a license, you will be directed to
this"
- + "\n page on your first login to the application." + "\n
"
- + "\n You must login as an administrator to update your license
file." + "\n-->\n";
-
- // max 20 platforms in an eval
- public static final int EVAL_MAXPLATFORMS = 20;
-
- // level 0 support in an eval
- public static final int EVAL_SUPPORT_LEVEL = License.FEATURE_BASIC;
-
- public static final SimpleDateFormat DFORMAT = new SimpleDateFormat("MMM-dd-yyyy
HH:mm");
-
- public LicenseGenerator() {
- }
-
- /**
- * Can be used to generate a license file.
- * <p/>
- * Usage: java this-class "<name>" <email> "phone"
<expiration> <platform-limit> "<server-ip-list>"
- * "<plugin-name-list>"
- * <p/>
- * Where: "<name>" is the licensee's name <email> is the
licensee's email "<phone>" is the licensee's phone
- * <expiration> is in yyyy-MM-dd format, or '*' for no expiration
<platform-limit> is an integer "<server-ip-list>"
- * is a whitespace-separated list of ip addresses
"<plugin-name-list>" is a whitespace-separated list of plugin
- * names "<support-level" is 1 for no monitoring support or 3 for
monitoring support -- OR -- if arg[0] is "EVAL", a
- * license file suitable for evaluation purposes will be generated.
- */
- public static void main(String[] args) {
-
- LicenseGenerator g = new LicenseGenerator();
-
- if (args.length == 1 && args[0].equals("EVAL")) {
- try {
- g.generateEval(System.out);
- } catch (IOException e) {
- System.err.println("Failed to generate license - cause: " +
e);
- e.printStackTrace();
- System.exit(1);
- }
- return;
- }
-
- int i = 0;
- if (args.length != 8) {
- System.err.println("Too " + ((args.length < 8) ? "few"
: "many") + " arguments.");
- System.err.println();
- System.err.println("Usage: " +
LicenseGenerator.class.getSimpleName() + " <Name> <Email> <Phone>
<Expiration Date> <Platform Limit> <IP List> <Plugins List>
<Support Level>");
- System.err.println("For example: " +
LicenseGenerator.class.getSimpleName() +" \"Customer Name\" sales(a)jboss.com
404-467-8555 2009-07-01 \"*\" \"*\" \"*\" 3");
- System.exit(1);
- }
-
- String name = args[i++];
- String email = args[i++];
- String phone = args[i++];
- String expString = args[i++];
- String aLimitString = args[i++];
- List serverIps = StringUtil.explode(args[i++], " \t\n");
- List plugins = StringUtil.explode(args[i++], " \t\n");
- String supportString = args[i++];
-
- try {
- g.generate(name, email, phone, expString, aLimitString, serverIps, plugins,
supportString, System.out);
- } catch (IOException e) {
- System.err.println("Failed to generate license - cause: " + e);
- e.printStackTrace();
- System.exit(1);
- }
- }
-
- public void generateEval(OutputStream out) throws IOException {
-
- Calendar expCal = Calendar.getInstance();
- expCal.setTime(new Date());
- expCal.set(Calendar.MONTH, Calendar.NOVEMBER);
- expCal.set(Calendar.DAY_OF_MONTH, 1);
- expCal.set(Calendar.ZONE_OFFSET, ExpirationTag.PST_OFFSET);
- expCal.set(Calendar.DST_OFFSET, ExpirationTag.DST_OFFSET);
- String expiration = ExpirationTag.DFORMAT.format(expCal.getTime());
-
- // String expiration = LRES.get(LRES.EXPIRATION_NEVER);
-
- // no server ip or plugin restrictions
- List serverIps = new ArrayList();
- serverIps.add(LRES.get(LRES.IP_ANY));
- List plugins = new ArrayList();
- plugins.add(LRES.get(LRES.PLUGIN_ANY));
-
- generate(EVAL_NAME, EVAL_EMAIL, EVAL_PHONE, expiration,
String.valueOf(EVAL_MAXPLATFORMS), serverIps, plugins,
- String.valueOf(License.FEATURE_ALL), out);
- }
-
- /**
- * From GenericLicenseGenerator, used by ant task
- */
- public void generate(Map licenseData, OutputStream out) throws IOException {
- generate((String) licenseData.get("name"), (String)
licenseData.get("email"),
- (String) licenseData.get("phone"), (String)
licenseData.get("expiration"), (String) licenseData
- .get("platform-limit"), (List)
licenseData.get("server-ips"), (List) licenseData.get("plugins"),
- (String) licenseData.get("support-level"), out);
- }
-
- /**
- * Generate a license file
- *
- * @param name The licensee's name
- * @param email The licensee's email
- * @param phone The licensee's phone
- * @param expiration The expiration in yyyy-MM-dd format, or "*"
- * @param platformLimit The platform limit or "*"
- * @param serverIps a List of Strings that are server IP addresses, or this may a
List of length 1, where the
- * element at index zero is the String "*"
- * @param plugins a List of Strings that are plugin names, or this may a List
of length 1, where the element
- * at index zero is the String "*"
- * @param supportLevel TODO
- * @param out This is where the license file will get written. NOTE THAT
THE CALLER IS RESPONSIBLE FOR
- * OPENING AND CLOSING THIS STREAM.
- */
- public void generate(String name, String email, String phone, String expiration,
String platformLimit,
- List serverIps, List plugins, String supportLevel, OutputStream out) throws
IOException {
-
- License l = new License();
- LicenseTag lt = new LicenseTag(l);
- String masterKey = lt.generateKey();
- lt.setMasterKey(masterKey);
- lt.setVersion(LICENSE_VERSION);
-
- LicenseeTag licenseeTag = new LicenseeTag(lt, name, email, phone);
- ExpirationTag exTag = new ExpirationTag(lt);
- PlatformLimitTag plTag = new PlatformLimitTag(lt);
- SupportLevelTag slTag = new SupportLevelTag(lt);
-
- try {
- exTag.handleAttribute(0, expiration);
- } catch (XmlAttrException e) {
- throw new IOException("Error setting expiration: " + e);
- }
- try {
- plTag.handleAttribute(0, platformLimit);
- } catch (XmlAttrException e) {
- throw new IOException("Error setting platform-limit: " + e);
- }
-
- ServerIpTag[] ipTags = new ServerIpTag[serverIps.size()];
- for (int i = 0; i < ipTags.length; i++) {
- ipTags[i] = new ServerIpTag(lt);
- try {
- ipTags[i].handleAttribute(0, (String) serverIps.get(i));
- ipTags[i].handleAttribute(1, String.valueOf(i + 1));
- } catch (XmlAttrException e) {
- throw new IOException("Error setting server-ip: " + e);
- }
- }
-
- PluginTag[] pluginTags = new PluginTag[plugins.size()];
- for (int i = 0; i < pluginTags.length; i++) {
- pluginTags[i] = new PluginTag(lt);
- try {
- pluginTags[i].handleAttribute(0, (String) plugins.get(i));
- } catch (XmlAttrException e) {
- throw new IOException("Error setting plugin: " + e);
- }
- }
-
- try {
- slTag.handleAttribute(0, supportLevel);
- } catch (XmlAttrException e) {
- throw new IOException("Error setting support-level: " + e);
- }
-
- StringBuilder sb = new StringBuilder();
- sb.append("<?xml
version=\"1.0\"?>\n").append(LICENSE_HEADER).append("\n<!--
License created: ").append(
- DFORMAT.format(new Date())).append("
-->").append("\n<").append(lt.getName()).append("
").append(
-
LRES.get(LRES.ATTR_KEY)).append("=\"").append(lt.getMasterKey()).append("\"
").append(
-
LRES.get(LRES.ATTR_VERSION)).append("=\"").append(lt.getVersion()).append("\">\n");
-
- // license-owner
- sb.append("\n\t<").append(licenseeTag.getName()).append("
").append(LRES.get(LRES.ATTR_NAME)).append("=\"")
- .append(licenseeTag.getLicenseeName()).append("\"
").append("\n\t ").append(
-
LRES.get(LRES.ATTR_EMAIL)).append("=\"").append(licenseeTag.getLicenseeEmail()).append("\"
").append(
- "\n\t
").append(LRES.get(LRES.ATTR_PHONE)).append("=\"").append(
- licenseeTag.getLicenseePhone()).append("\"
").append("\n\t ").append(
-
LRES.get(LRES.ATTR_KEY)).append("=\"").append(licenseeTag.generateKey()).append("\"/>\n\n");
-
- // expiration
- sb.append("\t<").append(exTag.getName()).append("
").append(LRES.get(LRES.ATTR_DATE)).append("=\"").append(
- exTag.getOriginalExpirationString()).append("\"
").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- exTag.generateKey()).append("\"
").append("/>\n");
-
- // platform count
- sb.append("\t<").append(plTag.getName()).append("
").append(LRES.get(LRES.ATTR_COUNT)).append("=\"").append(
- plTag.getOriginalPlatformLimitString()).append("\"
").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- plTag.generateKey()).append("\"
").append("/>\n");
-
- // server ips
- for (int i = 0; i < ipTags.length; i++) {
- sb.append("\t<").append(ipTags[i].getName()).append("
").append(LRES.get(LRES.ATTR_COUNT)).append("=\"")
- .append(ipTags[i].getCount()).append("\"
").append(LRES.get(LRES.ATTR_ADDRESS)).append("=\"").append(
- ipTags[i].getAddress()).append("\"
").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- ipTags[i].generateKey()).append("\"
").append("/>\n");
- }
-
- // plugins
- for (int i = 0; i < pluginTags.length; i++) {
- sb.append("\t<").append(pluginTags[i].getName()).append("
").append(LRES.get(LRES.ATTR_NAME)).append("=\"")
- .append(pluginTags[i].getPlugin()).append("\"
").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- pluginTags[i].generateKey()).append("\"
").append("/>\n");
- }
-
- // support level
- sb.append("\t<").append(slTag.getName()).append("
").append(LRES.get(LRES.ATTR_LEVEL)).append("=\"").append(
- slTag.getOriginalSupportLevelString()).append("\"
").append(LRES.get(LRES.ATTR_KEY)).append("=\"").append(
- slTag.generateKey()).append("\"
").append("/>\n");
-
- sb.append("\n</license>\n");
-
- // write to stream
- BufferedWriter bw;
- bw = new BufferedWriter(new OutputStreamWriter(out));
- bw.write(sb.toString());
- bw.flush();
- }
-}
diff --git a/modules/enterprise/server/license-gen/maven-plugin/pom.xml
b/modules/enterprise/server/license-gen/maven-plugin/pom.xml
deleted file mode 100644
index dceb54d..0000000
--- a/modules/enterprise/server/license-gen/maven-plugin/pom.xml
+++ /dev/null
@@ -1,77 +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.0.0-SNAPSHOT</version>
- <relativePath>../../../../../pom.xml</relativePath>
- </parent>
-
- <groupId>org.rhq</groupId>
- <artifactId>license-maven-plugin</artifactId>
- <packaging>maven-plugin</packaging>
-
- <name>RHQ Enterprise Server License Generator Maven Plugin</name>
- <description>a Maven plugin for generating license files for RHQ Enterprise
Server</description>
-
- <scm>
-
<
connection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/modules/ente...
-
<
developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq.git/mod...
- </scm>
-
- <properties>
-
<scm.module.path>modules/enterprise/server/license-gen/</scm.module.path>
- </properties>
-
- <dependencies>
-
- <!-- Internal Deps -->
-
- <dependency>
- <groupId>org.rhq</groupId>
- <artifactId>rhq-enterprise-server-license-gen</artifactId>
- <version>${project.version}</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- 3rd Party Deps -->
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-artifact-ant</artifactId>
- <version>2.0.4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-script-ant</artifactId>
- <version>2.0.8</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-plugin-plugin</artifactId>
- <!-- Note: v2.5 is not compatible with maven-plugin-tools-ant v2.1+. -->
- <version>2.3</version>
- <dependencies>
- <dependency>
- <groupId>org.apache.maven</groupId>
- <artifactId>maven-plugin-tools-ant</artifactId>
- <version>2.0.4</version>
- </dependency>
- </dependencies>
-
- <configuration>
- <goalPrefix>license</goalPrefix>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
diff --git
a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml
b/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml
deleted file mode 100644
index 5d44177..0000000
---
a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.build.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="license-gen" default="generateLicense"
basedir="." xmlns:artifact="urn:maven-artifact-ant">
-
- <target name="generateLicense">
-
- <echo>ant.version: ${ant.version}</echo>
-
- <property name="rhq.version" value="1.3.0-SNAPSHOT" />
- <echo>rhq.version: ${rhq.version}</echo>
- <echo/>
-
- <property name="default.rhq.license.name" value="RHQ User"
/>
- <property name="default.rhq.license.email"
value="sales(a)jboss.com" />
- <property name="default.rhq.license.phone"
value="888-555-1212" />
- <property name="default.rhq.license.max-platforms" value="*"
/>
- <property name="default.rhq.license.ip-addresses" value="*"
/>
- <property name="default.rhq.license.plugins" value="*" />
- <property name="default.rhq.license.support-level" value="3"
/>
-
- <property name="localRepository"
location="${user.home}/.m2/repository" />
- <!--<echo>localRepository: ${localRepository}</echo>-->
-
- <property name="alt.localRepository" location="C:/.m2-repo"
/>
- <!--<echo>alt.localRepository: ${alt.localRepository}</echo>-->
-
- <tstamp>
- <format property="default.rhq.license.expire-date"
pattern="yyyy-MM-dd" offset="1" unit="month" />
- </tstamp>
-
- <echo>Please enter the following license parameters (hit Enter to accept
defaults)...</echo>
-
- <input message="Name [${default.rhq.license.name}]:"
addproperty="rhq.license.name"
defaultvalue="${default.rhq.license.name}" />
- <input message="Email address [${default.rhq.license.email}]:"
addproperty="rhq.license.email"
defaultvalue="${default.rhq.license.email}" />
- <input message="Phone number [${default.rhq.license.phone}]:"
addproperty="rhq.license.phone"
defaultvalue="${default.rhq.license.phone}" />
- <input message="Expiration date (yyyy-MM-dd) (*=never)
[${default.rhq.license.expire-date}]:"
addproperty="rhq.license.expire-date"
defaultvalue="${default.rhq.license.expire-date}" />
- <input message="Maximum platforms (*=unlimited)
[${default.rhq.license.max-platforms}]:"
addproperty="rhq.license.max-platforms"
defaultvalue="${default.rhq.license.max-platforms}" />
- <input message="Allowed IP addresses (*=any)
[${default.rhq.license.ip-addresses}]:"
addproperty="rhq.license.ip-addresses"
defaultvalue="${default.rhq.license.ip-addresses}" />
- <input message="Allowed plugins (*=any)
[${default.rhq.license.plugins}]:" addproperty="rhq.license.plugins"
defaultvalue="${default.rhq.license.plugins}" />
- <input message="Support level (1-3)
[${default.rhq.license.support-level}]:"
addproperty="rhq.license.support-level"
defaultvalue="${default.rhq.license.support-level}" />
-
- <echo>Generating license...</echo>
-
- <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="urn:maven-artifact-ant">
- <classpath>
- <pathelement
location="${localRepository}/org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4.jar"
/>
- <pathelement
location="${alt.localRepository}/org/apache/maven/maven-artifact-ant/2.0.4/maven-artifact-ant-2.0.4.jar"
/>
- </classpath>
- </typedef>
-
- <artifact:dependencies pathId="license-generator.classpath">
- <dependency groupId="org.rhq"
artifactId="rhq-enterprise-server-license-gen"
version="${rhq.version}"/>
- </artifact:dependencies>
-
- <mkdir dir="target" />
- <property name="license.file"
value="target${file.separator}rhq-license.xml" />
-
- <java classname="org.rhq.enterprise.server.license.LicenseGenerator"
classpathref="license-generator.classpath" output="${license.file}"
logError="true">
- <arg value="${rhq.license.name}" />
- <arg value="${rhq.license.email}" />
- <arg value="${rhq.license.phone}" />
- <arg value="${rhq.license.expire-date}" />
- <arg value="${rhq.license.max-platforms}" />
- <arg value="${rhq.license.ip-addresses}" />
- <arg value="${rhq.license.plugins}" />
- <arg value="${rhq.license.support-level}" />
- </java>
-
- <echo>Done. License file written to ${license.file}</echo>
-
- </target>
-
-</project>
\ No newline at end of file
diff --git
a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml
b/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml
deleted file mode 100644
index 2db63ad..0000000
---
a/modules/enterprise/server/license-gen/maven-plugin/src/main/scripts/license.mojos.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0"?>
-
-<pluginMetadata>
-
- <mojos>
-
- <mojo>
- <goal>generateLicense</goal>
-
- <!-- this element refers to the Ant target M2 should invoke -->
- <call>generateLicense</call>
-
- <description>
- Generate an RHQ license file
- </description>
-
- <parameters>
- <parameter>
- <name>rhq.version</name>
- <property>rhq.version</property>
- <required>true</required>
- <readonly>true</readonly>
- <defaultValue>${project.version}</defaultValue>
- <type>java.lang.String</type>
- <description>The RHQ version</description>
- </parameter>
- </parameters>
- </mojo>
-
- </mojos>
-
-</pluginMetadata>
diff --git
a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
index 0ea6e12..26806e9 100644
---
a/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
+++
b/modules/enterprise/server/plugins/perspectives/core/perspective/src/main/resources/META-INF/rhq-serverplugin.xml
@@ -318,18 +318,6 @@
name="administration.reports"
placement="after" />
</menu-item>
- <menu-item
- name="administration.license"
- displayName="License"
- url="/admin/license/LicenseAdmin.do?mode=view">
- <position
- name="administration.downloads"
- placement="after" />
- <activators>
- <global-permission
- name="MANAGE_SETTINGS" />
- </activators>
- </menu-item>
<!-- Core Menu: Debug -->
<menu-item
diff --git a/modules/enterprise/server/pom.xml b/modules/enterprise/server/pom.xml
index a012753..b2df029 100644
--- a/modules/enterprise/server/pom.xml
+++ b/modules/enterprise/server/pom.xml
@@ -39,8 +39,6 @@
<module>plugins</module>
<module>ear</module>
<module>safe-invoker</module>
- <module>license-gen/jar</module>
- <module>license-gen/maven-plugin</module>
</modules>
</profile>