[rhq] 9 commits - modules/core modules/enterprise modules/plugins
by lkrejci
modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java | 11
modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java | 9
modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java | 15
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java | 8
modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java | 13
modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java | 30 +
modules/enterprise/binding/intentional-api-changes-since-4.9.0.xml | 53 ++
modules/enterprise/binding/src/main/java/org/rhq/bindings/client/AbstractRhqFacade.java | 200 +++++++++
modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java | 217 ++++++++++
modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqManagers.java | 139 ++++++
modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java | 3
modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java | 2
modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java | 5
modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java | 3
modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java | 16
15 files changed, 714 insertions(+), 10 deletions(-)
New commits:
commit 9b38a7ecf4853047cfc3635bff6ec270954e3541
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 17:43:01 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 0ba8c5f (among other things) removed several public constants in
MeasurementScheduleCriteria because they were improperly named and didn't
do what they seemed to.
Users might be using those constants even if they don't do what they're
supposed to. The constants have therefore been re-introduced with a
deprecation notice.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
index 33d2623..1980d01 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/criteria/MeasurementScheduleCriteria.java
@@ -42,10 +42,37 @@ public class MeasurementScheduleCriteria extends Criteria {
private static final long serialVersionUID = 3L;
// sort fields from the MeasurementSchedule's MeasurementDefinition
+
+ /**
+ * Note that sorting by definition id alone might not produce repeatable results. This depends on the filters
+ * and other sort field applied.
+ */
+ public static final String SORT_FIELD_DEFINITION_ID = "definitionId";
public static final String SORT_FIELD_NAME = "name";
public static final String SORT_FIELD_DISPLAY_NAME = "displayName";
public static final String SORT_FIELD_DATA_TYPE = "dataType";
+ /**
+ * @deprecated Sorting by this field has never been supported. This constant has been introduced in error and will
+ * be removed in the next major release.
+ */
+ @Deprecated
+ public static final String SORT_FIELD_ENABLED = "enabled";
+
+ /**
+ * @deprecated Sorting by this field has never been supported. This constant has been introduced in error and will
+ * be removed in the next major release.
+ */
+ @Deprecated
+ public static final String SORT_FIELD_INTERVAL = "interval";
+
+ /**
+ * @deprecated Sorting by this field has never been supported. This constant has been introduced in error and will
+ * be removed in the next major release.
+ */
+ @Deprecated
+ public static final String SORT_FIELD_DESCRIPTION = "description";
+
// filter fields
public static final String FILTER_FIELD_DEFINITION_IDS = "definitionIds";
public static final String FILTER_FIELD_RESOURCE_ID = "resourceId";
@@ -93,6 +120,7 @@ public class MeasurementScheduleCriteria extends Criteria {
+ " WHERE parent.id = ? )");
filterOverrides.put(FILTER_FIELD_RESOURCE_TYPE_ID, "resource.type.id = ?");
+ sortOverrides.put(SORT_FIELD_DEFINITION_ID, "definition.id");
sortOverrides.put(SORT_FIELD_NAME, "definition.name");
sortOverrides.put(SORT_FIELD_DISPLAY_NAME, "definition.displayName");
sortOverrides.put(SORT_FIELD_DATA_TYPE, "definition.dataType");
@@ -167,4 +195,4 @@ public class MeasurementScheduleCriteria extends Criteria {
this.sortDataType = sortDataType;
}
-}
\ No newline at end of file
+}
commit 8de9364b5f83e26bdda3eb16543c0ba13768393d
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 16:20:45 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 26959a31d8c37bcb86dc6a845b5707a277bff3cb made the constructor of
the DatabaseQueryUtility private, which it should be, and removed an
unused class.
While the chances of anyone either instantiating the utility class or using
the absolutely useless DatabaseQueryUtility.StatementParameter are very
slim, we need to keep API back-compat.
The public constructor and the class have been reintroduced with
a deprecation notice.
diff --git a/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java b/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java
index 95e981d..d6d83f2 100644
--- a/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java
+++ b/modules/plugins/database/src/main/java/org/rhq/plugins/database/DatabaseQueryUtility.java
@@ -44,7 +44,11 @@ public class DatabaseQueryUtility {
private static final Log LOG = LogFactory.getLog(DatabaseQueryUtility.class);
- private DatabaseQueryUtility() {}
+ /**
+ * @deprecated instantiating a static utility class doesn't make sense. Don't do it.
+ */
+ @Deprecated
+ public DatabaseQueryUtility() {}
/**
* Executes a database update.
@@ -274,4 +278,14 @@ public class DatabaseQueryUtility {
}
}
}
+
+ /**
+ * @deprecated This class is not used for anything in the codebase of the database plugin. If you are using it
+ * in some way or another, move it to your own code, because this class will be removed in future.
+ */
+ @Deprecated
+ public static class StatementParameter {
+ private String name;
+ private String value;
+ }
}
commit f78beeb0deff4fc4801f2236881e45d659bd578f
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 15:06:43 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
The fix for bug 840512 changed the way we handle the value of an obfuscated
property, which rendered the obfuscate() method unused. It has been removed
which unfortunately is an API breaking change due to its protected
visibility.
While the chances of anyone using that method are miniscule we cannot break
the API. The method was re-introduced but made a NOOP so that it doesn't
break the obfuscation. The deprecation notice on the method suggests to
stop using it.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java
index bb00ef5..ac0598f 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ObfuscatedPropertySimple.java
@@ -216,7 +216,18 @@ public class ObfuscatedPropertySimple extends PropertySimple {
throw new IllegalArgumentException("Failed to obfuscate property value: [" + value + "]", e);
}
}
-
+
+ /**
+ * @deprecated do not use this method. It has been superseded by the {@link #deobfuscate(String)} and
+ * {@link #obfuscate(String)} pair. The way the obfuscated value is handled has changed and is fully contained
+ * within this class. You should not worry about it, nor have a need to call any of the obfuscate() methods.
+ * This method is currently no-op and will be removed in future.
+ */
+ @Deprecated
+ protected void obfuscate() {
+
+ }
+
/**
* Overriden to not leak the unobfuscated value in the toString() method, output of which
* might end up in logs, etc.
commit aeae80458d5175f2e5c3cc164943c561da2cc0f3
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 15:02:58 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
The fix for bug 1000006 declared the constructor of
o.r.c.d.configuration.ConfigurationUtility private. It previously had the
default pulic constructor and hence this was a API breaking change.
While the utility class should have had the private constructor in first
place, we cannot break the API, so the public constructor has been
re-introduced with a deprecation notice.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java
index f4d575a..fa49454 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/ConfigurationUtility.java
@@ -36,8 +36,12 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple;
*/
public class ConfigurationUtility {
- private ConfigurationUtility() {
- // Utility class
+ /**
+ * @deprecated do not create instances of this class. It is meant as a static utility class.
+ */
+ @Deprecated
+ public ConfigurationUtility() {
+
}
/**
commit 53f3329850efcb7fd0e18fca2964c8c4dbb6a3b1
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:46:57 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 85f75e0 removed 2 enum fields from the server details, because they
are no longer used due to our move from DB to Cassandra for metric storage.
Nevertheless the clients might be using those fields to get back that
information. To retain the backwards compatibility, we need to keep those
enum fields, making the server details work without recompilation.
The server details will no longer contain any information for the for those
fields. The fact that some information might be missing is part of the
contract of the ServerDetails class though, so the users should be able to
handle that situation.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java
index 5cfcc96..b9637bf 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/common/ServerDetails.java
@@ -47,6 +47,21 @@ public class ServerDetails implements Serializable {
SERVER_LOCAL_TIME, //
SERVER_INSTALL_DIR, // where RHQ is installed, the top directory where everything else is
SERVER_HOME_DIR, // where the RHQ server's JBossAS deployment is; this is under the install dir
+
+ /**
+ * @deprecated this is no longer used or exposed by the server. The measurements are not stored in the database
+ * anymore.
+ */
+ @Deprecated
+ CURRENT_MEASUREMENT_TABLE, //
+
+ /**
+ * @deprecated this is no longer used or exposed by the server. The measurements are not stored in the database
+ * anymore.
+ */
+ @Deprecated
+ NEXT_MEASUREMENT_TABLE_ROTATION, //
+
SERVER_IDENTITY;
};
commit be6f70ce0ae66b544965636f503bbe6e4732958b
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:40:42 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit a4b78eb6e1adeffaa519115a9ef07b3f00025168 fixed the handling of the
server status, but changed the signature of
o.r.c.d.cloud.Server#clearStatus() method in an incompatible way. Adding
the old method back with a deprecation notice.
The chances of anyone using this method are miniscule but we need to retain
back-compat.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java
index 671db6b..6e04ab6 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java
@@ -306,6 +306,15 @@ public class Server implements Serializable {
}
/**
+ * @deprecated do not use this method as it may corrupt the tracking of the server status. Use the new
+ * {@link #clearStatus(org.rhq.core.domain.cloud.Server.Status)} instead.
+ */
+ @Deprecated
+ public void clearStatus() {
+ this.status = 0;
+ }
+
+ /**
* If some subsystem makes a change to some data that this server cares about (as summarized
* by the various {@link Status} elements), then that change should be added via this method.
* Periodically, a background job will come along, check the status, and possibly perform
commit 9a5a5a7a1b9153968474a459f097e73d5421e038
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:37:22 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Bug 888927 changed the signature of the
AlertConditionAvailabilityCategoryComposite class to add a missing
parameter.
While the chances of anyone using this method miniscule, we need to retain
the back-compat. Therefore I added the wrong constructor back with
a deprecation notice.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java
index 870dbd2..cd1a948 100644
--- a/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java
+++ b/modules/core/domain/src/main/java/org/rhq/core/domain/alert/composite/AlertConditionAvailabilityCategoryComposite.java
@@ -49,6 +49,17 @@ public class AlertConditionAvailabilityCategoryComposite extends AbstractAlertCo
this.availabilityType = (null != availabilityType) ? availabilityType : AvailabilityType.UNKNOWN;
}
+ /**
+ * @deprecated This constructor will NOT produce a valid instance of this class, because it cannot specify
+ * the required alert definition id. Use {@link #AlertConditionAvailabilityCategoryComposite(
+ * org.rhq.core.domain.alert.AlertCondition, Integer, Integer, org.rhq.core.domain.measurement.AvailabilityType)}
+ * instead.
+ */
+ @Deprecated
+ public AlertConditionAvailabilityCategoryComposite(AlertCondition condition, Integer resourceId, AvailabilityType availabilityType) {
+ this(condition, null, resourceId, availabilityType);
+ }
+
public Integer getAlertDefinitionId() {
return alertDefinitionId;
}
commit 92aaf569774b9328812f447cc940719287540883
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Sep 23 15:37:06 2013 +0200
Adding intentional api changes for the new methods ported over from RHQ 4.4.0.
diff --git a/modules/enterprise/binding/intentional-api-changes-since-4.9.0.xml b/modules/enterprise/binding/intentional-api-changes-since-4.9.0.xml
new file mode 100644
index 0000000..e9a97bc
--- /dev/null
+++ b/modules/enterprise/binding/intentional-api-changes-since-4.9.0.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0"?>
+<!--
+ ~ RHQ Management Platform
+ ~ Copyright (C) 2005-2013 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.,
+ ~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ -->
+
+<differences>
+
+ <difference>
+ <className>org/rhq/bindings/client/RhqFacade</className>
+ <differenceType>7012</differenceType> <!-- method added to an interface -->
+ <method>*ManagerRemote get*Manager()</method>
+ <justification>
+ Adding back methods removed in RHQ 4.5.0 to regain compatibility with RHQ 4.4.0 interface.
+ This is safe, because this interface is not to be implemented by 3rd parties.
+ </justification>
+ </difference>
+
+ <difference>
+ <className>org/rhq/bindings/client/RhqFacade</className>
+ <differenceType>7012</differenceType> <!-- method added to an interface -->
+ <method>org.rhq.enterprise.server.discovery.DiscoveryBossRemote getDiscoveryBoss()</method>
+ <justification>
+ Adding back methods removed in RHQ 4.5.0 to regain compatibility with RHQ 4.4.0 interface.
+ This is safe, because this interface is not to be implemented by 3rd parties.
+ </justification>
+ </difference>
+
+ <difference>
+ <className>org/rhq/bindings/client/RhqFacade</className>
+ <differenceType>7012</differenceType> <!-- method added to an interface -->
+ <method>java.util.Map getManagers()</method>
+ <justification>
+ Adding back methods removed in RHQ 4.5.0 to regain compatibility with RHQ 4.4.0 interface.
+ This is safe, because this interface is not to be implemented by 3rd parties.
+ </justification>
+ </difference>
+</differences>
+
commit 2a152b1f670099c7f3341abe8ca35bac11ff29bd
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 20 21:09:02 2013 +0200
(Almost) regain back-compat with RHQ 4.4.0 in script bindings.
diff --git a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/AbstractRhqFacade.java b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/AbstractRhqFacade.java
new file mode 100644
index 0000000..8ee82e2
--- /dev/null
+++ b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/AbstractRhqFacade.java
@@ -0,0 +1,200 @@
+package org.rhq.bindings.client;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote;
+import org.rhq.enterprise.server.alert.AlertManagerRemote;
+import org.rhq.enterprise.server.auth.SubjectManagerRemote;
+import org.rhq.enterprise.server.authz.RoleManagerRemote;
+import org.rhq.enterprise.server.bundle.BundleManagerRemote;
+import org.rhq.enterprise.server.configuration.ConfigurationManagerRemote;
+import org.rhq.enterprise.server.content.ContentManagerRemote;
+import org.rhq.enterprise.server.content.RepoManagerRemote;
+import org.rhq.enterprise.server.discovery.DiscoveryBossRemote;
+import org.rhq.enterprise.server.drift.DriftManagerRemote;
+import org.rhq.enterprise.server.event.EventManagerRemote;
+import org.rhq.enterprise.server.install.remote.RemoteInstallManagerRemote;
+import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote;
+import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerRemote;
+import org.rhq.enterprise.server.operation.OperationManagerRemote;
+import org.rhq.enterprise.server.report.DataAccessManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceFactoryManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceTypeManagerRemote;
+import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote;
+import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
+import org.rhq.enterprise.server.support.SupportManagerRemote;
+import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
+import org.rhq.enterprise.server.system.SystemManagerRemote;
+import org.rhq.enterprise.server.tagging.TagManagerRemote;
+
+/**
+ * This is a support base class for the implementations of the RhqFacade interface that
+ * implements the deprecated methods by the means of the new version of the {@link RhqFacade} methods.
+ *
+ * @author Lukas Krejci
+ * @since 4.10
+ */
+public abstract class AbstractRhqFacade implements RhqFacade {
+
+ @Override
+ public AlertDefinitionManagerRemote getAlertDefinitionManager() {
+ return getProxy(AlertDefinitionManagerRemote.class);
+ }
+
+ @Override
+ public AlertManagerRemote getAlertManager() {
+ return getProxy(AlertManagerRemote.class);
+ }
+
+ @Override
+ public AvailabilityManagerRemote getAvailabilityManager() {
+ return getProxy(AvailabilityManagerRemote.class);
+ }
+
+ @Override
+ public BundleManagerRemote getBundleManager() {
+ return getProxy(BundleManagerRemote.class);
+ }
+
+ @Override
+ public CallTimeDataManagerRemote getCallTimeDataManager() {
+ return getProxy(CallTimeDataManagerRemote.class);
+ }
+
+ @Override
+ public ConfigurationManagerRemote getConfigurationManager() {
+ return getProxy(ConfigurationManagerRemote.class);
+ }
+
+ @Override
+ public ContentManagerRemote getContentManager() {
+ return getProxy(ContentManagerRemote.class);
+ }
+
+ @Override
+ public DataAccessManagerRemote getDataAccessManager() {
+ return getProxy(DataAccessManagerRemote.class);
+ }
+
+ @Override
+ public DiscoveryBossRemote getDiscoveryBoss() {
+ return getProxy(DiscoveryBossRemote.class);
+ }
+
+ @Override
+ public DriftManagerRemote getDriftManager() {
+ return getProxy(DriftManagerRemote.class);
+ }
+
+ @Override
+ public EventManagerRemote getEventManager() {
+ return getProxy(EventManagerRemote.class);
+ }
+
+ @Override
+ public Map<RhqManagers, Object> getManagers() {
+ HashMap<RhqManagers, Object> ret = new HashMap<RhqManagers, Object>();
+
+ for(RhqManagers m : RhqManagers.values()) {
+ ret.put(m, getProxy(m.remote()));
+ }
+
+ return ret;
+ }
+
+ @Override
+ public MeasurementBaselineManagerRemote getMeasurementBaselineManager() {
+ return getProxy(MeasurementBaselineManagerRemote.class);
+ }
+
+ @Override
+ public MeasurementDataManagerRemote getMeasurementDataManager() {
+ return getProxy(MeasurementDataManagerRemote.class);
+ }
+
+ @Override
+ public MeasurementDefinitionManagerRemote getMeasurementDefinitionManager() {
+ return getProxy(MeasurementDefinitionManagerRemote.class);
+ }
+
+ @Override
+ public MeasurementScheduleManagerRemote getMeasurementScheduleManager() {
+ return getProxy(MeasurementScheduleManagerRemote.class);
+ }
+
+ @Override
+ public OperationManagerRemote getOperationManager() {
+ return getProxy(OperationManagerRemote.class);
+ }
+
+ @Override
+ public RemoteInstallManagerRemote getRemoteInstallManager() {
+ return getProxy(RemoteInstallManagerRemote.class);
+ }
+
+ @Override
+ public RepoManagerRemote getRepoManager() {
+ return getProxy(RepoManagerRemote.class);
+ }
+
+ @Override
+ public ResourceFactoryManagerRemote getResourceFactoryManager() {
+ return getProxy(ResourceFactoryManagerRemote.class);
+ }
+
+ @Override
+ public ResourceGroupManagerRemote getResourceGroupManager() {
+ return getProxy(ResourceGroupManagerRemote.class);
+ }
+
+ @Override
+ public ResourceManagerRemote getResourceManager() {
+ return getProxy(ResourceManagerRemote.class);
+ }
+
+ @Override
+ public ResourceTypeManagerRemote getResourceTypeManager() {
+ return getProxy(ResourceTypeManagerRemote.class);
+ }
+
+ @Override
+ public RoleManagerRemote getRoleManager() {
+ return getProxy(RoleManagerRemote.class);
+ }
+
+ @Override
+ public SavedSearchManagerRemote getSavedSearchManager() {
+ return getProxy(SavedSearchManagerRemote.class);
+ }
+
+ @Override
+ public SubjectManagerRemote getSubjectManager() {
+ return getProxy(SubjectManagerRemote.class);
+ }
+
+ @Override
+ public SupportManagerRemote getSupportManager() {
+ return getProxy(SupportManagerRemote.class);
+ }
+
+ @Override
+ public SynchronizationManagerRemote getSynchronizationManager() {
+ return getProxy(SynchronizationManagerRemote.class);
+ }
+
+ @Override
+ public SystemManagerRemote getSystemManager() {
+ return getProxy(SystemManagerRemote.class);
+ }
+
+ @Override
+ public TagManagerRemote getTagManager() {
+ return getProxy(TagManagerRemote.class);
+ }
+}
diff --git a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java
index 2f80f0c..e6ec7a9 100644
--- a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java
+++ b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqFacade.java
@@ -22,6 +22,35 @@ package org.rhq.bindings.client;
import java.util.Map;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote;
+import org.rhq.enterprise.server.alert.AlertManagerRemote;
+import org.rhq.enterprise.server.auth.SubjectManagerRemote;
+import org.rhq.enterprise.server.authz.RoleManagerRemote;
+import org.rhq.enterprise.server.bundle.BundleManagerRemote;
+import org.rhq.enterprise.server.configuration.ConfigurationManagerRemote;
+import org.rhq.enterprise.server.content.ContentManagerRemote;
+import org.rhq.enterprise.server.content.RepoManagerRemote;
+import org.rhq.enterprise.server.discovery.DiscoveryBossRemote;
+import org.rhq.enterprise.server.drift.DriftManagerRemote;
+import org.rhq.enterprise.server.event.EventManagerRemote;
+import org.rhq.enterprise.server.install.remote.RemoteInstallManagerRemote;
+import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote;
+import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerRemote;
+import org.rhq.enterprise.server.operation.OperationManagerRemote;
+import org.rhq.enterprise.server.report.DataAccessManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceFactoryManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceTypeManagerRemote;
+import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote;
+import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
+import org.rhq.enterprise.server.support.SupportManagerRemote;
+import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
+import org.rhq.enterprise.server.system.SystemManagerRemote;
+import org.rhq.enterprise.server.tagging.TagManagerRemote;
/**
* This is an interface through which the script can communicate with RHQ server.
@@ -59,4 +88,192 @@ public interface RhqFacade {
* @return the proxy of the remote API interface backed by this facade
*/
<T> T getProxy(Class<T> remoteApiIface);
+
+ ///////////////////// deprecated methods added to re-introduce compatibility with RHQ 4.4.0
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ AlertDefinitionManagerRemote getAlertDefinitionManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ AlertManagerRemote getAlertManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ AvailabilityManagerRemote getAvailabilityManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ BundleManagerRemote getBundleManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ CallTimeDataManagerRemote getCallTimeDataManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ConfigurationManagerRemote getConfigurationManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ContentManagerRemote getContentManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ DataAccessManagerRemote getDataAccessManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ DiscoveryBossRemote getDiscoveryBoss();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ DriftManagerRemote getDriftManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ EventManagerRemote getEventManager();
+
+ /**
+ * Kept for backwards compatibility but otherwise unused.
+ * In RHQ prior to 4.5.0, the values in the map, i.e. the manager objects themselves both implemented the various
+ * {@code *Remote} interfaces and contained methods with the modified signatures with the {@link Subject} parameter
+ * removed.
+ * <p />
+ * Since RHQ 4.5.0 the returned objects no longer contain the modified method. If you want to obtain objects with
+ * such methods (intended for use in scripted environments), use {@link #getScriptingAPI()} method instead.
+ */
+ @Deprecated
+ Map<RhqManagers, Object> getManagers();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementBaselineManagerRemote getMeasurementBaselineManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementDataManagerRemote getMeasurementDataManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementDefinitionManagerRemote getMeasurementDefinitionManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ MeasurementScheduleManagerRemote getMeasurementScheduleManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ OperationManagerRemote getOperationManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ RemoteInstallManagerRemote getRemoteInstallManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ RepoManagerRemote getRepoManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceFactoryManagerRemote getResourceFactoryManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceGroupManagerRemote getResourceGroupManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceManagerRemote getResourceManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ ResourceTypeManagerRemote getResourceTypeManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ RoleManagerRemote getRoleManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SavedSearchManagerRemote getSavedSearchManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SubjectManagerRemote getSubjectManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SupportManagerRemote getSupportManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SynchronizationManagerRemote getSynchronizationManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ SystemManagerRemote getSystemManager();
+
+ /**
+ * deprecated use {@code RhqFacade.getProxy(RhqManager.XXX.remote())} instead
+ */
+ @Deprecated
+ TagManagerRemote getTagManager();
}
diff --git a/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqManagers.java b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqManagers.java
new file mode 100644
index 0000000..77612d1
--- /dev/null
+++ b/modules/enterprise/binding/src/main/java/org/rhq/bindings/client/RhqManagers.java
@@ -0,0 +1,139 @@
+package org.rhq.bindings.client;
+
+import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote;
+import org.rhq.enterprise.server.alert.AlertManagerRemote;
+import org.rhq.enterprise.server.auth.SubjectManagerRemote;
+import org.rhq.enterprise.server.authz.RoleManagerRemote;
+import org.rhq.enterprise.server.bundle.BundleManagerRemote;
+import org.rhq.enterprise.server.cloud.StorageNodeManagerRemote;
+import org.rhq.enterprise.server.configuration.ConfigurationManagerRemote;
+import org.rhq.enterprise.server.content.ContentManagerRemote;
+import org.rhq.enterprise.server.content.RepoManagerRemote;
+import org.rhq.enterprise.server.discovery.DiscoveryBossRemote;
+import org.rhq.enterprise.server.drift.DriftManagerRemote;
+import org.rhq.enterprise.server.drift.DriftTemplateManagerRemote;
+import org.rhq.enterprise.server.event.EventManagerRemote;
+import org.rhq.enterprise.server.install.remote.RemoteInstallManagerRemote;
+import org.rhq.enterprise.server.measurement.AvailabilityManagerRemote;
+import org.rhq.enterprise.server.measurement.CallTimeDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementBaselineManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDataManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementDefinitionManagerRemote;
+import org.rhq.enterprise.server.measurement.MeasurementScheduleManagerRemote;
+import org.rhq.enterprise.server.operation.OperationManagerRemote;
+import org.rhq.enterprise.server.report.DataAccessManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceFactoryManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceManagerRemote;
+import org.rhq.enterprise.server.resource.ResourceTypeManagerRemote;
+import org.rhq.enterprise.server.resource.group.ResourceGroupManagerRemote;
+import org.rhq.enterprise.server.resource.group.definition.GroupDefinitionManagerRemote;
+import org.rhq.enterprise.server.search.SavedSearchManagerRemote;
+import org.rhq.enterprise.server.support.SupportManagerRemote;
+import org.rhq.enterprise.server.sync.SynchronizationManagerRemote;
+import org.rhq.enterprise.server.system.SystemManagerRemote;
+import org.rhq.enterprise.server.tagging.TagManagerRemote;
+
+/**
+ * @author Lukas Krejci
+ *
+ * @deprecated since 4.10 do not use this. Use {@link RhqManager} instead.
+ */
+@Deprecated
+public enum RhqManagers {
+ AlertManager(AlertManagerRemote.class, "${AlertManager}"), //
+ AlertDefinitionManager(AlertDefinitionManagerRemote.class, "${AlertDefinitionManager}"), //
+ AvailabilityManager(AvailabilityManagerRemote.class, "${AvailabilityManager}"), //
+ BundleManager(BundleManagerRemote.class, "${BundleManager}"), //
+ CallTimeDataManager(CallTimeDataManagerRemote.class, "${CallTimeDataManager}"), //
+ RepoManager(RepoManagerRemote.class, "${RepoManager}"), //
+ ConfigurationManager(ConfigurationManagerRemote.class, "${ConfigurationManager}"), //
+ ContentManager(ContentManagerRemote.class, "${ContentManager}"), //
+ DataAccessManager(DataAccessManagerRemote.class, "${DataAccessManager}"), //
+ DriftManager(DriftManagerRemote.class, "${DriftManager}"), //
+ DriftTemplateManager(DriftTemplateManagerRemote.class, "${DriftTemplateManager}"), //
+ DiscoveryBoss(DiscoveryBossRemote.class, "${DiscoveryBoss}"), //
+ EventManager(EventManagerRemote.class, "${EventManager}"), //
+ GroupDefinitionManager(GroupDefinitionManagerRemote.class, "${GroupDefinitionManager}"), //
+ MeasurementBaselineManager(MeasurementBaselineManagerRemote.class, "${MeasurementBaselineManager}"), //
+ MeasurementDataManager(MeasurementDataManagerRemote.class, "${MeasurementDataManager}"), //
+ MeasurementDefinitionManager(MeasurementDefinitionManagerRemote.class, "${MeasurementDefinitionManager}"), //
+ MeasurementScheduleManager(MeasurementScheduleManagerRemote.class, "${MeasurementScheduleManager}"), //
+ OperationManager(OperationManagerRemote.class, "${OperationManager}"), //
+ ResourceManager(ResourceManagerRemote.class, "${ResourceManager}"), //
+ ResourceFactoryManager(ResourceFactoryManagerRemote.class, "${ResourceFactoryManager}"), //
+ ResourceGroupManager(ResourceGroupManagerRemote.class, "${ResourceGroupManager}"), //
+ ResourceTypeManager(ResourceTypeManagerRemote.class, "${ResourceTypeManager}"), //
+ RoleManager(RoleManagerRemote.class, "${RoleManager}"), //
+ SavedSearchManager(SavedSearchManagerRemote.class, "${SavedSearchManager}"), //
+ StorageNodeManager(StorageNodeManagerRemote.class, "${StorageNodeManager}"), //
+ SubjectManager(SubjectManagerRemote.class, "${SubjectManager}"), //
+ SupportManager(SupportManagerRemote.class, "${SupportManager}"), //
+ SystemManager(SystemManagerRemote.class, "${SystemManager}"), //
+ RemoteInstallManager(RemoteInstallManagerRemote.class, "${RemoteInstallManager}"), //
+ TagManager(TagManagerRemote.class, "${TagManager}"), //
+ SynchronizationManager(SynchronizationManagerRemote.class, "${SynchronizationManager}");
+
+ private Class<?> remote;
+ private String localInterfaceClassName;
+ private String beanName;
+ private boolean enabled;
+
+
+ private RhqManagers(Class<?> remote, String enable) {
+ this.remote = remote;
+ this.beanName = this.name() + "Bean";
+ localInterfaceClassName = getLocalInterfaceClassName(remote);
+
+ //defaults and evaluates to TRUE unless the string contains "false". Done to defend against
+ //possible errors in string replacement during rhq build.
+ this.enabled = true;
+ if ((enable != null) && (enable.trim().length() > 0)) {
+ this.enabled = (enable.trim().equalsIgnoreCase("false")) ? Boolean.FALSE : Boolean.TRUE;
+ }
+ }
+
+ public static RhqManagers forInterface(Class<?> iface) {
+ for (RhqManagers m : values()) {
+ if (m.remote().equals(iface)) {
+ return m;
+ }
+ }
+
+ return null;
+ }
+
+ public Class<?> remote() {
+ return this.remote;
+ }
+
+ /**
+ * @deprecated since 4.6.0, use the {@link #remote()} method instead
+ * @return the class name of the remote interface
+ */
+ @Deprecated
+ public String remoteName() {
+ return this.remote.getName();
+ }
+
+ public String localInterfaceClassName() {
+ return localInterfaceClassName;
+ }
+
+ public String beanName() {
+ return this.beanName;
+ }
+
+ public boolean enabled() {
+ return this.enabled;
+ }
+
+ private static String getLocalInterfaceClassName(Class<?> remoteIface) {
+ String ifaceName = remoteIface.getName();
+ if (!ifaceName.endsWith("Remote")) {
+ throw new AssertionError("Inconsistent SLSB naming in RHQ! Remote interface '" + remoteIface.getName()
+ + "' does not follow the established naming convention. This is a bug, please report it.");
+ }
+
+ return (ifaceName.substring(0, ifaceName.lastIndexOf("Remote")) + "Local");
+ }
+}
diff --git a/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java b/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java
index 39cb145..c420c1b 100644
--- a/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java
+++ b/modules/enterprise/binding/src/test/java/org/rhq/bindings/FakeRhqFacade.java
@@ -22,11 +22,12 @@ package org.rhq.bindings;
import java.util.Collections;
import java.util.Map;
+import org.rhq.bindings.client.AbstractRhqFacade;
import org.rhq.bindings.client.RhqFacade;
import org.rhq.bindings.client.RhqManager;
import org.rhq.core.domain.auth.Subject;
-public class FakeRhqFacade implements RhqFacade {
+public class FakeRhqFacade extends AbstractRhqFacade {
public Subject getSubject() {
return null;
diff --git a/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java b/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java
index d1042df..65f6178 100644
--- a/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java
+++ b/modules/enterprise/binding/src/test/java/org/rhq/bindings/client/AbstractRhqFacadeProxyTest.java
@@ -44,7 +44,7 @@ public class AbstractRhqFacadeProxyTest {
void method();
}
- public static class TestFacade implements RhqFacade {
+ public static class TestFacade extends AbstractRhqFacade {
private Subject subject;
diff --git a/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java b/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java
index 95c00ae..b0f25b7 100644
--- a/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java
+++ b/modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java
@@ -35,6 +35,7 @@ import org.jboss.remoting.invocation.NameBasedInvocation;
import org.jboss.remoting.security.SSLSocketBuilder;
import org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker;
+import org.rhq.bindings.client.AbstractRhqFacade;
import org.rhq.bindings.client.RhqFacade;
import org.rhq.bindings.client.RhqManager;
import org.rhq.bindings.util.InterfaceSimplifier;
@@ -52,7 +53,7 @@ import org.rhq.enterprise.server.system.SystemManagerRemote;
* @author Jay Shaughnessy
* @author John Mazzitelli
*/
-public class RemoteClient implements RhqFacade {
+public class RemoteClient extends AbstractRhqFacade {
private static final Log LOG = LogFactory.getLog(RemoteClient.class);
@@ -512,4 +513,4 @@ public class RemoteClient implements RhqFacade {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java b/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java
index df0eab4..51b3b2e 100644
--- a/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java
+++ b/modules/enterprise/server/client-api/src/main/java/org/rhq/enterprise/client/LocalClient.java
@@ -28,6 +28,7 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.rhq.bindings.client.AbstractRhqFacade;
import org.rhq.bindings.client.RhqFacade;
import org.rhq.bindings.client.RhqManager;
import org.rhq.bindings.util.InterfaceSimplifier;
@@ -39,7 +40,7 @@ import org.rhq.enterprise.server.util.LookupUtil;
*
* @author Lukas Krejci
*/
-public class LocalClient implements RhqFacade {
+public class LocalClient extends AbstractRhqFacade {
private static final Log LOG = LogFactory.getLog(LocalClient.class);
10 years, 7 months
[rhq] modules/enterprise
by Jiri Kremser
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 3885d705e8b31485fae92e8df5ae2209a4c6a5d0
Author: Jirka Kremser <jkremser(a)redhat.com>
Date: Mon Sep 30 16:55:49 2013 +0200
api checks: reverting a change that broke JON 3.2 backward compatibility
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java
index 3c6e81d..c10bc88 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/operation/OperationManagerRemote.java
@@ -267,7 +267,14 @@ public interface OperationManagerRemote {
List<GroupOperationSchedule> findScheduledGroupOperations(Subject subject, int groupId) throws Exception;
- PageList<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject, OperationDefinitionCriteria criteria);
+ /**
+ * TODO: major release: this should return PageList as all our criteria finder do
+ *
+ * @param subject The logged in user's subject.
+ * @param criteria The criteria object for the finding.
+ * @return instance of PageList<OperationDefinition> (can be safely casted)
+ */
+ List<OperationDefinition> findOperationDefinitionsByCriteria(Subject subject, OperationDefinitionCriteria criteria);
PageList<ResourceOperationHistory> findResourceOperationHistoriesByCriteria(Subject subject,
ResourceOperationHistoryCriteria criteria);
10 years, 7 months
[rhq] modules/enterprise
by Thomas Segismont
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java | 12 +++---
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java | 18 +++++-----
2 files changed, 17 insertions(+), 13 deletions(-)
New commits:
commit 12317968d83d7ca408b01e7b9715364215fd5907
Author: Thomas Segismont <tsegismo(a)redhat.com>
Date: Mon Sep 30 16:23:01 2013 +0200
Bug 1013489 - It is not possible to download an agent from RHQ server (HTTP Status 404)
Fixed 'Downloads' page broken links
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
index 950b57d..5f3b9b6 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/DownloadsView.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2009 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* 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.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.client.admin;
@@ -53,6 +53,8 @@ public class DownloadsView extends EnhancedVLayout {
public static final String VIEW_PATH = AdministrationView.VIEW_ID + "/"
+ AdministrationView.SECTION_CONFIGURATION_VIEW_ID + "/" + VIEW_ID;
+ private static final String PORTAL_WAR_CONTEXT = "/portal";
+
private final SystemGWTServiceAsync systemManager = GWTServiceLookup.getSystemService();
private SectionStack sectionStack;
@@ -143,7 +145,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("agentLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a href=\"/agentupdate/download\">"
+ linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT + "/agentupdate/download\">"
+ MSG.view_admin_downloads_agent_link_value(version, build) + "</a>");
SpacerItem spacerItem = new SpacerItem("agentSpacer");
@@ -194,7 +196,7 @@ public class DownloadsView extends EnhancedVLayout {
StaticTextItem linkItem = new StaticTextItem("cliLink");
linkItem.setTitle(MSG.common_label_link());
- linkItem.setValue("<a href=\"/client/download\">"
+ linkItem.setValue("<a href=\"" + PORTAL_WAR_CONTEXT + "/client/download\">"
+ MSG.view_admin_downloads_cli_link_value(version, build) + "</a>");
SpacerItem spacerItem = new SpacerItem("clientSpacer");
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
index 168522d..9792b5f 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/server/gwt/SystemGWTServiceImpl.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2010 Red Hat, Inc.
+ * Copyright (C) 2005-2013 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -13,8 +13,8 @@
* 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.
+ * along with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package org.rhq.enterprise.gui.coregui.server.gwt;
@@ -48,6 +48,8 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
private static final long serialVersionUID = 1L;
+ private static final String PORTAL_WAR_CONTEXT = "/portal";
+
private SystemManagerLocal systemManager = LookupUtil.getSystemManager();
private AgentManagerLocal agentManager = LookupUtil.getAgentManager();
private RemoteClientManagerLocal remoteClientManager = LookupUtil.getRemoteClientManager();
@@ -136,7 +138,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
HashMap<String, String> map = new HashMap<String, String>(files.size());
for (File file : files) {
// key is the filename, value is the relative URL to download the file from the server
- map.put(file.getName(), "/downloads/connectors/" + file.getName());
+ map.put(file.getName(), PORTAL_WAR_CONTEXT + "/downloads/connectors/" + file.getName());
}
return map;
} catch (Throwable t) {
@@ -156,7 +158,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
HashMap<String, String> ret = new HashMap<String, String>(files.size());
for (File file : files) {
- ret.put(file.getName(), "/downloads/cli-alert-scripts/" + file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT + "/downloads/cli-alert-scripts/" + file.getName());
}
return ret;
}
@@ -176,7 +178,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
HashMap<String, String> ret = new HashMap<String, String>(files.size());
for (File file : files) {
- ret.put(file.getName(), "/downloads/script-modules/" + file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT + "/downloads/script-modules/" + file.getName());
}
return ret;
}
@@ -205,7 +207,7 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
}
File file = files.get(0);
HashMap<String, String> ret = new HashMap<String, String>(1);
- ret.put(file.getName(), "/downloads/bundle-deployer/" + file.getName());
+ ret.put(file.getName(), PORTAL_WAR_CONTEXT + "/downloads/bundle-deployer/" + file.getName());
return ret;
} catch (Throwable t) {
throw getExceptionToThrowToClient(t);
@@ -297,4 +299,4 @@ public class SystemGWTServiceImpl extends AbstractGWTServiceImpl implements Syst
}
return map;
}
-}
\ No newline at end of file
+}
10 years, 7 months
[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 1bb3cdf0ba93f10621090a729794b2bed7f3714c
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Mon Sep 30 10:11:55 2013 -0400
fix compilation failure.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 8acbcd8..9cd7cc3 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -135,7 +135,7 @@ public class StorageClientManagerBean {
log.warn("Storage client subsystem wasn't initialized because it wasn't possible to connect to the"
+ " storage cluster. The RHQ server is set to MAINTENANCE mode. Please start the storage cluster"
+ " as soon as possible.");
- return;
+ return initialized;
}
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
10 years, 7 months
[rhq] modules/enterprise
by Simeon Pinder
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 6c2bcfab6985002d9d9fb8e652cbd88c31129060
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Sep 27 13:02:45 2013 -0400
BZ 1010841 - a few more storage client changes.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 9cd7cc3..8acbcd8 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -135,7 +135,7 @@ public class StorageClientManagerBean {
log.warn("Storage client subsystem wasn't initialized because it wasn't possible to connect to the"
+ " storage cluster. The RHQ server is set to MAINTENANCE mode. Please start the storage cluster"
+ " as soon as possible.");
- return initialized;
+ return;
}
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
10 years, 7 months
[rhq] Branch 'refs/tags/RHQ_4_9_0_JON320ER2' - modules/enterprise
by Simeon Pinder
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 371eac0020bc697a655ded57a8df9df524318aef
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Sep 27 13:02:45 2013 -0400
BZ 1010841 - a few more storage client changes.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 05ae045..31ac587 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -35,6 +35,14 @@ import javax.ejb.Singleton;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.ProtocolOptions;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
+import com.datastax.driver.core.policies.DefaultRetryPolicy;
+import com.datastax.driver.core.policies.LoggingRetryPolicy;
+import com.datastax.driver.core.policies.RoundRobinPolicy;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -124,7 +132,7 @@ public class StorageClientManagerBean {
log.warn("Storage client subsystem wasn't initialized because it wasn't possible to connect to the"
+ " storage cluster. The RHQ server is set to MAINTENANCE mode. Please start the storage cluster"
+ " as soon as possible.");
- return initialized;
+ return;
}
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
10 years, 7 months
[rhq] Branch 'nightly/rhq.jon' - modules/enterprise
by Simeon Pinder
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 371eac0020bc697a655ded57a8df9df524318aef
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Sep 27 13:02:45 2013 -0400
BZ 1010841 - a few more storage client changes.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 05ae045..31ac587 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -35,6 +35,14 @@ import javax.ejb.Singleton;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
+import com.datastax.driver.core.Cluster;
+import com.datastax.driver.core.ProtocolOptions;
+import com.datastax.driver.core.Session;
+import com.datastax.driver.core.exceptions.NoHostAvailableException;
+import com.datastax.driver.core.policies.DefaultRetryPolicy;
+import com.datastax.driver.core.policies.LoggingRetryPolicy;
+import com.datastax.driver.core.policies.RoundRobinPolicy;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -124,7 +132,7 @@ public class StorageClientManagerBean {
log.warn("Storage client subsystem wasn't initialized because it wasn't possible to connect to the"
+ " storage cluster. The RHQ server is set to MAINTENANCE mode. Please start the storage cluster"
+ " as soon as possible.");
- return initialized;
+ return;
}
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
10 years, 7 months
[rhq] Branch 'refs/tags/RHQ_4_9_0_JON320ER2' - modules/enterprise
by Simeon Pinder
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java | 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 68 ++++------
3 files changed, 39 insertions(+), 39 deletions(-)
New commits:
commit 14b71da818992acb52ba5056c0d763ef5fa5d04d
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Sep 27 11:51:32 2013 -0400
Fix an issue where the storage client init was using system properties
to get the storage user and password. This had two issues:
1) at install the system properties were seeded in AS via
-p rhq-server.properties, but this was prior to the generation of the
storage cluster creds.
2) for HA installs the props file was actually not even correct, the
generated values were superseded by the existing db creds.
This commit syncs the props file and the db, during install, so problem
2 really should no longer be a problem. But this was mainly done to
reduce confusion for a person who may have wondered why the db and props
file had different values. It didn't solve problem 1. To solve problem
1 the storage client should always get its creds from the DB, which it
now does.
Conflicts:
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java - (comment only)
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java - (straight forward)
diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index e10c993..445f41e 100644
--- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -468,7 +468,8 @@ public class InstallerServiceImpl implements InstallerService {
throw new Exception("Cannot connect to the database: " + testConnectionErrorMessage);
}
- // write the new properties to the rhq-server.properties file (this ensures the encoded password is written out)
+ // write the new properties to the rhq-server.properties file (this ensures the encoded password is written
+ // out). Being paranoid, leaving this here despite the fact that we now write it out again, at the bottom.
saveServerProperties(serverProperties);
// Prepare the db schema.
@@ -548,6 +549,9 @@ public class InstallerServiceImpl implements InstallerService {
ServerInstallUtil.persistStorageNodesIfNecessary(serverProperties, clearTextDbPassword,
parseNodeInformation(serverProperties));
ServerInstallUtil.persistStorageClusterSettingsIfNecessary(serverProperties, clearTextDbPassword);
+
+ // For sanity, make sure the server props file is in sync with the db settings.
+ saveServerProperties(serverProperties);
}
@Override
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index d99bb7b..dfe44f2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -435,7 +435,9 @@ public class StartupBean implements StartupLocal {
}
/**
- * Initalizes the storage client subsystem which is needed for reading/writing metric data.
+ * Initializes the storage client subsystem which is needed for reading/writing metric data.
+ *
+ * @return true if the storage subsystem is running
*/
private void initStorageClient() {
storageClientManager.init();
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 4ec3583..05ae045 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -35,21 +35,17 @@ import javax.ejb.Singleton;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.ProtocolOptions;
-import com.datastax.driver.core.Session;
-import com.datastax.driver.core.policies.DefaultRetryPolicy;
-import com.datastax.driver.core.policies.LoggingRetryPolicy;
-import com.datastax.driver.core.policies.RoundRobinPolicy;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.cassandra.schema.SchemaManager;
import org.rhq.cassandra.util.ClusterBuilder;
import org.rhq.core.domain.cloud.StorageNode;
-import org.rhq.core.util.StringUtil;
+import org.rhq.core.domain.common.composite.SystemSetting;
+import org.rhq.core.domain.common.composite.SystemSettings;
+import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.cloud.StorageNodeManagerLocal;
+import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.server.metrics.DateTimeService;
import org.rhq.server.metrics.MetricsConfiguration;
import org.rhq.server.metrics.MetricsDAO;
@@ -65,13 +61,17 @@ public class StorageClientManagerBean {
private final Log log = LogFactory.getLog(StorageClientManagerBean.class);
- private static final String USERNAME_PROP = "rhq.storage.username";
- private static final String PASSWORD_PROP = "rhq.storage.password";
private static final String RHQ_KEYSPACE = "rhq";
@EJB
+ private SubjectManagerLocal subjectManager;
+
+ @EJB
private StorageNodeManagerLocal storageNodeManager;
+ @EJB
+ private SystemManagerLocal systemManager;
+
private Cluster cluster;
private StorageSession session;
private MetricsConfiguration metricsConfiguration;
@@ -90,8 +90,10 @@ public class StorageClientManagerBean {
log.info("Initializing storage client subsystem");
- String username = getRequiredStorageProperty(USERNAME_PROP);
- String password = getRequiredStorageProperty(PASSWORD_PROP);
+ // Always get the creds from the DB, system props may not be up to date at install time
+ SystemSettings settings = systemManager.getSystemSettings(subjectManager.getOverlord());
+ final String username = settings.get(SystemSetting.STORAGE_USERNAME);
+ final String password = settings.get(SystemSetting.STORAGE_PASSWORD);
List<StorageNode> storageNodes = new ArrayList<StorageNode>();
for (StorageNode storageNode : storageNodeManager.getStorageNodes()) {
@@ -101,9 +103,9 @@ public class StorageClientManagerBean {
// and REMOVE_MAINTENANCE, but this errors on the side of being safe. Lastly,
// if a storage node does not have a resource, then that means it was was
// deployed prior to installing the server.
- if (storageNode.getOperationMode() == StorageNode.OperationMode.NORMAL ||
- storageNode.getOperationMode() == StorageNode.OperationMode.MAINTENANCE ||
- storageNode.getResource() == null) {
+ if (storageNode.getOperationMode() == StorageNode.OperationMode.NORMAL
+ || storageNode.getOperationMode() == StorageNode.OperationMode.MAINTENANCE
+ || storageNode.getResource() == null) {
storageNodes.add(storageNode);
}
}
@@ -115,9 +117,15 @@ public class StorageClientManagerBean {
+ "storage node to fix this issue.");
}
- checkSchemaCompability(username, password, storageNodes);
-
-
+ try {
+ checkSchemaCompability(username, password, storageNodes);
+ } catch (NoHostAvailableException e) {
+ initialized = false;
+ log.warn("Storage client subsystem wasn't initialized because it wasn't possible to connect to the"
+ + " storage cluster. The RHQ server is set to MAINTENANCE mode. Please start the storage cluster"
+ + " as soon as possible.");
+ return initialized;
+ }
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
@@ -218,21 +226,17 @@ public class StorageClientManagerBean {
ProtocolOptions.Compression compression;
if (compressionEnabled) {
compression = ProtocolOptions.Compression.SNAPPY;
- log.info("Compression has been enabled for the storage client. Be aware that if your storage nodes do " +
- "not support compression then the client will not be able to connect to the storage cluster.");
+ log.info("Compression has been enabled for the storage client. Be aware that if your storage nodes do "
+ + "not support compression then the client will not be able to connect to the storage cluster.");
} else {
compression = ProtocolOptions.Compression.NONE;
log.debug("Storage client compression is disabled");
}
- cluster = new ClusterBuilder()
- .addContactPoints(hostNames.toArray(new String[hostNames.size()]))
- .withCredentialsObfuscated(username, password)
- .withPort(port)
+ cluster = new ClusterBuilder().addContactPoints(hostNames.toArray(new String[hostNames.size()]))
+ .withCredentialsObfuscated(username, password).withPort(port)
.withLoadBalancingPolicy(new RoundRobinPolicy())
- .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE))
- .withCompression(compression)
- .build();
+ .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE)).withCompression(compression).build();
return cluster.connect(RHQ_KEYSPACE);
}
@@ -250,14 +254,4 @@ public class StorageClientManagerBean {
metricsServer.setDateTimeService(dateTimeService);
metricsServer.init();
}
-
- private String getRequiredStorageProperty(String property) {
- String value = System.getProperty(property);
- if (StringUtil.isEmpty(property)) {
- throw new IllegalStateException("The system property [" + property + "] is not set. The RHQ "
- + "server will not be able connect to the RHQ storage node(s). This property should be defined "
- + "in rhq-server.properties.");
- }
- return value;
- }
}
10 years, 7 months
[rhq] Branch 'nightly/rhq.jon' - modules/enterprise
by Simeon Pinder
modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java | 6
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java | 4
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java | 68 ++++------
3 files changed, 39 insertions(+), 39 deletions(-)
New commits:
commit 14b71da818992acb52ba5056c0d763ef5fa5d04d
Author: Simeon Pinder <spinder(a)redhat.com>
Date: Fri Sep 27 11:51:32 2013 -0400
Fix an issue where the storage client init was using system properties
to get the storage user and password. This had two issues:
1) at install the system properties were seeded in AS via
-p rhq-server.properties, but this was prior to the generation of the
storage cluster creds.
2) for HA installs the props file was actually not even correct, the
generated values were superseded by the existing db creds.
This commit syncs the props file and the db, during install, so problem
2 really should no longer be a problem. But this was mainly done to
reduce confusion for a person who may have wondered why the db and props
file had different values. It didn't solve problem 1. To solve problem
1 the storage client should always get its creds from the DB, which it
now does.
Conflicts:
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java - (comment only)
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java - (straight forward)
diff --git a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
index e10c993..445f41e 100644
--- a/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
+++ b/modules/enterprise/server/installer/src/main/java/org/rhq/enterprise/server/installer/InstallerServiceImpl.java
@@ -468,7 +468,8 @@ public class InstallerServiceImpl implements InstallerService {
throw new Exception("Cannot connect to the database: " + testConnectionErrorMessage);
}
- // write the new properties to the rhq-server.properties file (this ensures the encoded password is written out)
+ // write the new properties to the rhq-server.properties file (this ensures the encoded password is written
+ // out). Being paranoid, leaving this here despite the fact that we now write it out again, at the bottom.
saveServerProperties(serverProperties);
// Prepare the db schema.
@@ -548,6 +549,9 @@ public class InstallerServiceImpl implements InstallerService {
ServerInstallUtil.persistStorageNodesIfNecessary(serverProperties, clearTextDbPassword,
parseNodeInformation(serverProperties));
ServerInstallUtil.persistStorageClusterSettingsIfNecessary(serverProperties, clearTextDbPassword);
+
+ // For sanity, make sure the server props file is in sync with the db settings.
+ saveServerProperties(serverProperties);
}
@Override
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
index d99bb7b..dfe44f2 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/StartupBean.java
@@ -435,7 +435,9 @@ public class StartupBean implements StartupLocal {
}
/**
- * Initalizes the storage client subsystem which is needed for reading/writing metric data.
+ * Initializes the storage client subsystem which is needed for reading/writing metric data.
+ *
+ * @return true if the storage subsystem is running
*/
private void initStorageClient() {
storageClientManager.init();
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
index 4ec3583..05ae045 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/storage/StorageClientManagerBean.java
@@ -35,21 +35,17 @@ import javax.ejb.Singleton;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
-import com.datastax.driver.core.Cluster;
-import com.datastax.driver.core.ProtocolOptions;
-import com.datastax.driver.core.Session;
-import com.datastax.driver.core.policies.DefaultRetryPolicy;
-import com.datastax.driver.core.policies.LoggingRetryPolicy;
-import com.datastax.driver.core.policies.RoundRobinPolicy;
-
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.cassandra.schema.SchemaManager;
import org.rhq.cassandra.util.ClusterBuilder;
import org.rhq.core.domain.cloud.StorageNode;
-import org.rhq.core.util.StringUtil;
+import org.rhq.core.domain.common.composite.SystemSetting;
+import org.rhq.core.domain.common.composite.SystemSettings;
+import org.rhq.enterprise.server.auth.SubjectManagerLocal;
import org.rhq.enterprise.server.cloud.StorageNodeManagerLocal;
+import org.rhq.enterprise.server.system.SystemManagerLocal;
import org.rhq.server.metrics.DateTimeService;
import org.rhq.server.metrics.MetricsConfiguration;
import org.rhq.server.metrics.MetricsDAO;
@@ -65,13 +61,17 @@ public class StorageClientManagerBean {
private final Log log = LogFactory.getLog(StorageClientManagerBean.class);
- private static final String USERNAME_PROP = "rhq.storage.username";
- private static final String PASSWORD_PROP = "rhq.storage.password";
private static final String RHQ_KEYSPACE = "rhq";
@EJB
+ private SubjectManagerLocal subjectManager;
+
+ @EJB
private StorageNodeManagerLocal storageNodeManager;
+ @EJB
+ private SystemManagerLocal systemManager;
+
private Cluster cluster;
private StorageSession session;
private MetricsConfiguration metricsConfiguration;
@@ -90,8 +90,10 @@ public class StorageClientManagerBean {
log.info("Initializing storage client subsystem");
- String username = getRequiredStorageProperty(USERNAME_PROP);
- String password = getRequiredStorageProperty(PASSWORD_PROP);
+ // Always get the creds from the DB, system props may not be up to date at install time
+ SystemSettings settings = systemManager.getSystemSettings(subjectManager.getOverlord());
+ final String username = settings.get(SystemSetting.STORAGE_USERNAME);
+ final String password = settings.get(SystemSetting.STORAGE_PASSWORD);
List<StorageNode> storageNodes = new ArrayList<StorageNode>();
for (StorageNode storageNode : storageNodeManager.getStorageNodes()) {
@@ -101,9 +103,9 @@ public class StorageClientManagerBean {
// and REMOVE_MAINTENANCE, but this errors on the side of being safe. Lastly,
// if a storage node does not have a resource, then that means it was was
// deployed prior to installing the server.
- if (storageNode.getOperationMode() == StorageNode.OperationMode.NORMAL ||
- storageNode.getOperationMode() == StorageNode.OperationMode.MAINTENANCE ||
- storageNode.getResource() == null) {
+ if (storageNode.getOperationMode() == StorageNode.OperationMode.NORMAL
+ || storageNode.getOperationMode() == StorageNode.OperationMode.MAINTENANCE
+ || storageNode.getResource() == null) {
storageNodes.add(storageNode);
}
}
@@ -115,9 +117,15 @@ public class StorageClientManagerBean {
+ "storage node to fix this issue.");
}
- checkSchemaCompability(username, password, storageNodes);
-
-
+ try {
+ checkSchemaCompability(username, password, storageNodes);
+ } catch (NoHostAvailableException e) {
+ initialized = false;
+ log.warn("Storage client subsystem wasn't initialized because it wasn't possible to connect to the"
+ + " storage cluster. The RHQ server is set to MAINTENANCE mode. Please start the storage cluster"
+ + " as soon as possible.");
+ return initialized;
+ }
Session wrappedSession = createSession(username, password, storageNodes);
session = new StorageSession(wrappedSession);
@@ -218,21 +226,17 @@ public class StorageClientManagerBean {
ProtocolOptions.Compression compression;
if (compressionEnabled) {
compression = ProtocolOptions.Compression.SNAPPY;
- log.info("Compression has been enabled for the storage client. Be aware that if your storage nodes do " +
- "not support compression then the client will not be able to connect to the storage cluster.");
+ log.info("Compression has been enabled for the storage client. Be aware that if your storage nodes do "
+ + "not support compression then the client will not be able to connect to the storage cluster.");
} else {
compression = ProtocolOptions.Compression.NONE;
log.debug("Storage client compression is disabled");
}
- cluster = new ClusterBuilder()
- .addContactPoints(hostNames.toArray(new String[hostNames.size()]))
- .withCredentialsObfuscated(username, password)
- .withPort(port)
+ cluster = new ClusterBuilder().addContactPoints(hostNames.toArray(new String[hostNames.size()]))
+ .withCredentialsObfuscated(username, password).withPort(port)
.withLoadBalancingPolicy(new RoundRobinPolicy())
- .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE))
- .withCompression(compression)
- .build();
+ .withRetryPolicy(new LoggingRetryPolicy(DefaultRetryPolicy.INSTANCE)).withCompression(compression).build();
return cluster.connect(RHQ_KEYSPACE);
}
@@ -250,14 +254,4 @@ public class StorageClientManagerBean {
metricsServer.setDateTimeService(dateTimeService);
metricsServer.init();
}
-
- private String getRequiredStorageProperty(String property) {
- String value = System.getProperty(property);
- if (StringUtil.isEmpty(property)) {
- throw new IllegalStateException("The system property [" + property + "] is not set. The RHQ "
- + "server will not be able connect to the RHQ storage node(s). This property should be defined "
- + "in rhq-server.properties.");
- }
- return value;
- }
}
10 years, 7 months
[rhq] Changes to 'lkrejci/jon-api-comp'
by lkrejci
New branch 'lkrejci/jon-api-comp' available with the following commits:
commit e5e1732961e6444eabe8ff0c644e307f9bb04e68
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 17:43:01 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 0ba8c5f (among other things) removed several public constants in
MeasurementScheduleCriteria because they were improperly named and didn't
do what they seemed to.
Users might be using those constants even if they don't do what they're
supposed to. The constants have therefore been re-introduced with a
deprecation notice.
commit 753b518342cb0e61eb0e1d0bd6840e800269bdb5
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 16:20:45 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 26959a31d8c37bcb86dc6a845b5707a277bff3cb made the constructor of
the DatabaseQueryUtility private, which it should be, and removed an
unused class.
While the chances of anyone either instantiating the utility class or using
the absolutely useless DatabaseQueryUtility.StatementParameter are very
slim, we need to keep API back-compat.
The public constructor and the class have been reintroduced with
a deprecation notice.
commit 33bedccfcc7ab9e338eff685c0cfe136ce02bc1a
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 15:06:43 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
The fix for bug 840512 changed the way we handle the value of an obfuscated
property, which rendered the obfuscate() method unused. It has been removed
which unfortunately is an API breaking change due to its protected
visibility.
While the chances of anyone using that method are miniscule we cannot break
the API. The method was re-introduced but made a NOOP so that it doesn't
break the obfuscation. The deprecation notice on the method suggests to
stop using it.
commit d551c40411cd790a13e9b35ba0bb06c4717bf910
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 15:02:58 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
The fix for bug 1000006 declared the constructor of
o.r.c.d.configuration.ConfigurationUtility private. It previously had the
default pulic constructor and hence this was a API breaking change.
While the utility class should have had the private constructor in first
place, we cannot break the API, so the public constructor has been
re-introduced with a deprecation notice.
commit 3efb3e45a976187e9e5558ead43bc9e6cf83445e
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:46:57 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit 85f75e0 removed 2 enum fields from the server details, because they
are no longer used due to our move from DB to Cassandra for metric storage.
Nevertheless the clients might be using those fields to get back that
information. To retain the backwards compatibility, we need to keep those
enum fields, making the server details work without recompilation.
The server details will no longer contain any information for the for those
fields. The fact that some information might be missing is part of the
contract of the ServerDetails class though, so the users should be able to
handle that situation.
commit 52020fb226a9141901e9b07d95b9bc74937fe0e3
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:40:42 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Commit a4b78eb6e1adeffaa519115a9ef07b3f00025168 fixed the handling of the
server status, but changed the signature of
o.r.c.d.cloud.Server#clearStatus() method in an incompatible way. Adding
the old method back with a deprecation notice.
The chances of anyone using this method are miniscule but we need to retain
back-compat.
commit 0d6c9e334f1310ee0bf21caf5d748e214a3eccf9
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 27 14:37:22 2013 +0200
[BZ 873866] - Minimizing API changes between JON 3.1.2.GA and JON 3.2.0.GA.
Bug 888927 changed the signature of the
AlertConditionAvailabilityCategoryComposite class to add a missing
parameter.
While the chances of anyone using this method miniscule, we need to retain
the back-compat. Therefore I added the wrong constructor back with
a deprecation notice.
commit 07cf818ae7d14e3a45422855e1439d2798f3754f
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Mon Sep 23 15:37:06 2013 +0200
Adding intentional api changes for the new methods ported over from RHQ 4.4.0.
commit 715c9bdcd9709755711c5c9d70229f7b332a71da
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Sep 20 21:09:02 2013 +0200
(Almost) regain back-compat with RHQ 4.4.0 in script bindings.
10 years, 7 months