[rhq] etc/rhq-ircBot
by ips
etc/rhq-ircBot/pom.xml | 51 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
New commits:
commit bc0ab1018da30382a30d19aa1907837c0ad121ae
Author: Ian Springer <ian.springer(a)redhat.com>
Date: Sat Jun 16 10:49:16 2012 -0400
add needed stuff to get JBoss Nexus to accept the artifact
diff --git a/etc/rhq-ircBot/pom.xml b/etc/rhq-ircBot/pom.xml
index c747084..40b6952 100644
--- a/etc/rhq-ircBot/pom.xml
+++ b/etc/rhq-ircBot/pom.xml
@@ -13,6 +13,28 @@
<name>RHQ IRC Bot</name>
<description>an IRC bot for doing helpful stuff on the Freenode #rhq channel</description>
+ <url>http://www.jboss.org/rhq/</url>
+
+ <scm>
+ <connection>scm:git:git://git.fedorahosted.org/rhq/rhq.git</connection>
+ <developerConnection>scm:git:ssh://git.fedorahosted.org/git/rhq/rhq.git</developerConnection>
+ <url>http://git.fedorahosted.org/git/rhq/rhq.git</url>
+ </scm>
+
+ <licenses>
+ <license>
+ <name>GPL</name>
+ <url>http://www.gnu.org/licenses/gpl.html</url>
+ </license>
+ </licenses>
+
+ <developers>
+ <developer>
+ <name>Ian Springer</name>
+ <timezone>-5</timezone>
+ <url>http://freshjava.blogspot.com/</url>
+ </developer>
+ </developers>
<dependencies>
@@ -72,10 +94,37 @@
</executions>
</plugin>
- </plugins>
+ <plugin>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
+ <distributionManagement>
+
+ <snapshotRepository>
+ <id>jboss-snapshots-repository</id>
+ <name>JBoss Snapshots Repository</name>
+ <url>https://repository.jboss.org/nexus/content/repositories/snapshots/</url>
+ </snapshotRepository>
+
+ <repository>
+ <id>jboss-releases-repository</id>
+ <name>JBoss Releases Repository</name>
+ <url>https://repository.jboss.org/nexus/service/local/staging/deploy/maven2/</url>
+ </repository>
+
+ </distributionManagement>
+
</project>
11 years, 11 months
[rhq] 2 commits - modules/enterprise
by Heiko W. Rupp
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java | 16 +++
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerLocal.java | 8 +
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java | 45 +++++++++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerLocal.java | 14 ++-
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerLocal.java | 5 -
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AvailabilityRest.java | 9 ++
modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl | 3
modules/enterprise/server/jar/src/main/resources/rest_templates/availability.ftl | 6 +
modules/enterprise/server/jar/src/main/resources/rest_templates/genericStringList.ftl | 2
modules/enterprise/server/jar/src/main/resources/rest_templates/listAvailability.ftl | 32 +++++++
modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl | 4
11 files changed, 130 insertions(+), 14 deletions(-)
New commits:
commit a8af1970fd5bec8e03a8e186f4b43f46becd207e
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Sat Jun 16 15:17:00 2012 +0200
Display availability history.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
index b76d7d1..c0efed4 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerBean.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -47,6 +47,7 @@ import javax.ws.rs.core.UriInfo;
import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.criteria.AlertCriteria;
+import org.rhq.core.domain.criteria.AvailabilityCriteria;
import org.rhq.core.domain.discovery.AvailabilityReport;
import org.rhq.core.domain.measurement.Availability;
import org.rhq.core.domain.measurement.AvailabilityType;
@@ -59,6 +60,7 @@ import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceCategory;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.domain.util.PageControl;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.RHQConstants;
import org.rhq.enterprise.server.alert.AlertManagerLocal;
import org.rhq.enterprise.server.core.AgentManagerLocal;
@@ -207,6 +209,47 @@ public class ResourceHandlerBean extends AbstractRestBean implements ResourceHan
}
@Override
+ public Response getAvailabilityHistory(int resourceId, long start, long end, HttpHeaders headers) {
+ if (end==0)
+ end = System.currentTimeMillis();
+
+ if (start==0)
+ start = end - (30*86400*1000L); // 30 days
+
+ AvailabilityCriteria criteria = new AvailabilityCriteria();
+ criteria.addFilterInterval(start,end);
+ criteria.addFilterResourceId(resourceId);
+ criteria.addSortStartTime(PageOrdering.DESC);
+ List<Availability> points = availMgr.findAvailabilityByCriteria(caller,criteria);
+ List<AvailabilityRest> ret = new ArrayList<AvailabilityRest>(points.size());
+ for (Availability avail : points) {
+ AvailabilityRest availabilityRest;
+ if (avail.getAvailabilityType() != null) {
+ availabilityRest = new AvailabilityRest(avail.getAvailabilityType(), avail.getStartTime(), avail
+ .getResource().getId());
+ }
+ else {
+ availabilityRest = new AvailabilityRest(avail.getStartTime(), resourceId);
+ }
+ if (avail.getEndTime()!=null)
+ availabilityRest.setUntil(avail.getEndTime());
+ ret.add(availabilityRest);
+ }
+ MediaType mediaType = headers.getAcceptableMediaTypes().get(0);
+ Response.ResponseBuilder builder;
+
+ if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
+ builder = Response.ok(renderTemplate("listAvailability.ftl",ret), mediaType);
+ } else {
+ GenericEntity<List<AvailabilityRest>> availabilityRest = new GenericEntity<List<AvailabilityRest>>(ret) {};
+ builder = Response.ok(availabilityRest);
+ }
+ return builder.build();
+
+ }
+
+
+ @Override
public void reportAvailability(int resourceId, AvailabilityRest avail) {
if (avail.getResourceId() != resourceId)
throw new IllegalArgumentException("Resource Ids do not match");
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerLocal.java
index 7ae0c0b..867a0e4 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/ResourceHandlerLocal.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -90,7 +90,6 @@ public interface ResourceHandlerLocal {
ResourceWithChildren getHierarchy(
@ApiParam("Id of the resource to start with") @PathParam("id")int baseResourceId);
- @LinkResource(rel = "availability", value = AvailabilityRest.class)
@GET
@Path("/{id}/availability")
@ApiError(code = 404, reason = NO_RESOURCE_FOR_ID)
@@ -98,6 +97,17 @@ public interface ResourceHandlerLocal {
Response getAvailability(
@ApiParam("Id of the resource to query") @PathParam("id") int resourceId, @Context HttpHeaders headers);
+ @GET
+ @Path("/{id}/availability/history")
+ @ApiError(code = 404, reason = NO_RESOURCE_FOR_ID)
+ @ApiOperation(value = "Return the availability history for the passed resource", responseClass = "AvailabilityRest", multiValueResponse = true)
+ Response getAvailabilityHistory(
+ @ApiParam("Id of the resource to query") @PathParam("id") int resourceId,
+ @ApiParam(value="Start time", defaultValue = "30 days ago") @QueryParam("start") long start,
+ @ApiParam(value="End time", defaultValue = "Now") @QueryParam("end") long end,
+
+ @Context HttpHeaders headers);
+
@PUT
@Path("/{id}/availability")
@ApiOperation("Set the current availability of the passed resource")
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AvailabilityRest.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AvailabilityRest.java
index 2534198..2710660 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AvailabilityRest.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/domain/AvailabilityRest.java
@@ -35,6 +35,7 @@ public class AvailabilityRest {
long since;
String type;
+ Long until;
int resourceId;
@@ -80,4 +81,12 @@ public class AvailabilityRest {
public void setResourceId(int resourceId) {
this.resourceId = resourceId;
}
+
+ public Long getUntil() {
+ return until;
+ }
+
+ public void setUntil(Long until) {
+ this.until = until;
+ }
}
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/availability.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/availability.ftl
index d02558a..388d761 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/availability.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/availability.ftl
@@ -22,5 +22,9 @@
<#-- @ftlvariable name="var" type="org.rhq.enterprise.server.rest.domain.AvailabilityRest" -->
State: ${var.type}<br/>
-Since: ${var.since?number_to_time}
+Since: ${var.since?number_to_datetime}
+<#if var.until?has_content>
+ until ${var.until?number_to_datetime}
+</#if>
+<br/>
<a href="/rest/1/resource/${var.resourceId?c}.html">Back to Resource</a>
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/listAvailability.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/listAvailability.ftl
new file mode 100644
index 0000000..128ea65
--- /dev/null
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/listAvailability.ftl
@@ -0,0 +1,32 @@
+<#ftl >
+<#--
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2012 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+-->
+<#-- @ftlvariable name="var" type="java.util.List<org.rhq.enterprise.server.rest.domain.AvailabilityRest>" -->
+<html>
+<ul>
+ <#-- the next looks odd, but the incoming var is a list -->
+ <#list var as var>
+ <li>
+ <#include "availability.ftl"/>
+ </li>
+ </#list>
+</ul>
+<html>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
index 7e96a11..f4bfa15 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
@@ -48,5 +48,6 @@
</table>
<a href="/rest/1/resource/${var.resourceId}/children.html">Children</a><br/>
<a href="/rest/1/resource/${var.resourceId}/schedules.html">Schedules</a><br/>
- <a href="/rest/1/resource/${var.resourceId}/availability.html">Availability</a><br/>
+ <a href="/rest/1/resource/${var.resourceId}/availability.html">Current availability</a><br/>
+ <a href="/rest/1/resource/${var.resourceId}/availability/history.html">Availability History</a><br/>
<a href="/rest/1/alert.html?resourceId=${var.resourceId}">Up to 20 Alerts for this resource</a>
commit fdb022dd24ced74d9682314d32c1a63e35159dba
Author: Heiko W. Rupp <hwr(a)redhat.com>
Date: Sat Jun 16 09:43:18 2012 +0200
Allow to limit alerts by prio and resource. Add linking from/to resource. Fix a bug in the genericString template.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
index a9bcc4e..074199c 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerBean.java
@@ -47,6 +47,7 @@ import org.rhq.core.domain.criteria.Criteria;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
+import org.rhq.core.domain.util.PageOrdering;
import org.rhq.enterprise.server.alert.AlertDefinitionManagerLocal;
import org.rhq.enterprise.server.alert.AlertManagerLocal;
import org.rhq.enterprise.server.rest.domain.*;
@@ -69,7 +70,9 @@ public class AlertHandlerBean extends AbstractRestBean implements AlertHandlerLo
@Override
- public Response listAlerts(int page, String status, boolean slim, Long since, Request request, UriInfo uriInfo, HttpHeaders headers) {
+ public Response listAlerts(int page, String prio, boolean slim, Long since, Integer resourceId, Request request,
+ UriInfo uriInfo,
+ HttpHeaders headers) {
AlertCriteria criteria = new AlertCriteria();
@@ -77,6 +80,17 @@ public class AlertHandlerBean extends AbstractRestBean implements AlertHandlerLo
if (since!=null) {
criteria.addFilterStartTime(since);
}
+
+ if (resourceId!=null) {
+ criteria.addFilterResourceIds(resourceId);
+ }
+
+ if (!prio.equals("All")) {
+ AlertPriority alertPriority = AlertPriority.valueOf(prio.toUpperCase());
+ criteria.addFilterPriorities(alertPriority);
+ }
+ criteria.addSortCtime(PageOrdering.DESC);
+
PageList<Alert> alerts = alertManager.findAlertsByCriteria(caller,criteria);
List<AlertRest> ret = new ArrayList<AlertRest>(alerts.size());
for (Alert al : alerts) {
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerLocal.java
index 5fd7506..4912ca1 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/AlertHandlerLocal.java
@@ -59,11 +59,13 @@ public interface AlertHandlerLocal {
@ApiOperation(value = "List all alerts", multiValueResponse = true, responseClass = "List<AlertRest")
Response listAlerts(
@ApiParam(value = "Page number", defaultValue = "0") @QueryParam("page") int page,
- @ApiParam(value = "Limit to status, UNUSED AT THE MOMENT ") @QueryParam("status") String status,
+ @ApiParam(value = "Limit to priority", allowableValues = "High, Medium, Low, All") @DefaultValue("All") @QueryParam("prio") String prio,
@ApiParam(value = "Should full resources and definitions be sent") @QueryParam("slim") @DefaultValue(
"false") boolean slim,
- @ApiParam(value = "If non-null only send alerts that have fired after this time, time is millisecond since epoch")
- @QueryParam("since") Long since,
+ @ApiParam(
+ value = "If non-null only send alerts that have fired after this time, time is millisecond since epoch")
+ @QueryParam("since") Long since,
+ @ApiParam(value = "Id of a resource to limit search for") @QueryParam("resourceId") Integer resourceId,
@Context Request request, @Context UriInfo uriInfo, @Context HttpHeaders headers);
@GET
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerLocal.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerLocal.java
index 05ef280..9893e8e 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerLocal.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/rest/UserHandlerLocal.java
@@ -1,6 +1,6 @@
/*
* RHQ Management Platform
- * Copyright (C) 2005-2011 Red Hat, Inc.
+ * Copyright (C) 2005-2012 Red Hat, Inc.
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,6 @@ package org.rhq.enterprise.server.rest;
import javax.ejb.Local;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
-import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
@@ -51,7 +50,7 @@ public interface UserHandlerLocal {
@GET
@Path("favorites/resource")
- @ApiOperation(value = "Return a list of favorite resources of the caller", multiValueResponse = true)
+ @ApiOperation(value = "Return a list of favorite resources of the caller", multiValueResponse = true, responseClass = "ResourceWithType")
Response getFavorites(@Context UriInfo uriInfo,@Context HttpHeaders headers);
@PUT
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl
index 60be9fc..fe60590 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/alert.ftl
@@ -31,7 +31,7 @@
</tr>
<tr>
<td>Id</td>
- <td>${var.id}</td>
+ <td>${var.id?c}</td>
</tr>
<tr>
<td>Description</td>
@@ -55,3 +55,4 @@
<a href="/rest/1/alert/${var.id?c}/definition.html">Alert Definition</a>
<a href="/rest/1/alert/${var.id?c}/conditions.html">Condition Logs</a>
<a href="/rest/1/alert/${var.id?c}/notifications.html">Notification Logs</a>
+<a href="/rest/1/resource/${var.resource.getResourceId()}.html">Resource</a>
\ No newline at end of file
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/genericStringList.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/genericStringList.ftl
index d0ad8a2..af116af 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/genericStringList.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/genericStringList.ftl
@@ -21,7 +21,7 @@
-->
<#-- @ftlvariable name="var" type="java.util.List<String>" -->
<ul>
- <#if var.isEmpty()>
+ <#if (var?size==0)>
<i>Nothing to display</i>
<#else>
<#list var as line>
diff --git a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
index bb8f717..7e96a11 100644
--- a/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
+++ b/modules/enterprise/server/jar/src/main/resources/rest_templates/resourceWithType.ftl
@@ -49,3 +49,4 @@
<a href="/rest/1/resource/${var.resourceId}/children.html">Children</a><br/>
<a href="/rest/1/resource/${var.resourceId}/schedules.html">Schedules</a><br/>
<a href="/rest/1/resource/${var.resourceId}/availability.html">Availability</a><br/>
+ <a href="/rest/1/alert.html?resourceId=${var.resourceId}">Up to 20 Alerts for this resource</a>
11 years, 11 months
[rhq] modules/enterprise
by mazz
modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/LoginCommand.java | 4
modules/enterprise/remoting/client-api/src/main/java/org/rhq/enterprise/clientapi/RemoteClient.java | 71 ++++++++++
2 files changed, 72 insertions(+), 3 deletions(-)
New commits:
commit 66fd59f643fdf8f39f199129711d77dfbd5ccbc7
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jun 15 17:29:41 2012 -0400
[BZ 535514] remote client will not connect to the server if the server is not supported. for this commit, "not supported" means the server and cli/remote client aren't the same version.
diff --git a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/LoginCommand.java b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/LoginCommand.java
index 97221af..17cf94e 100644
--- a/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/LoginCommand.java
+++ b/modules/enterprise/remoting/cli/src/main/java/org/rhq/enterprise/client/commands/LoginCommand.java
@@ -24,7 +24,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.auth.Subject;
-import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.client.ClientMain;
import org.rhq.enterprise.client.script.CommandLineParseException;
import org.rhq.enterprise.clientapi.RemoteClient;
@@ -111,8 +110,7 @@ public class LoginCommand implements ClientCommand {
Subject subject = remoteClient.login(username, password);
- ProductInfo info = remoteClient.getSystemManager().getProductInfo(subject);
- String version = info.getVersion() + " (" + info.getBuildNumber() + ")";
+ String version = remoteClient.getServerVersion() + " (" + remoteClient.getServerBuildNumber() + ")";
client.getPrintWriter().println("Remote server version is: " + version);
// this call has the side effect of setting bindings for the new remote client and its 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 0ec565e..d0fb529 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
@@ -24,6 +24,7 @@ import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.maven.artifact.versioning.ComparableVersion;
import org.jboss.remoting.Client;
import org.jboss.remoting.InvokerLocator;
@@ -33,6 +34,7 @@ import org.jboss.remoting.transport.http.ssl.HTTPSClientInvoker;
import org.rhq.bindings.client.RhqFacade;
import org.rhq.bindings.client.RhqManagers;
import org.rhq.core.domain.auth.Subject;
+import org.rhq.core.domain.common.ProductInfo;
import org.rhq.enterprise.communications.util.SecurityUtil;
import org.rhq.enterprise.server.alert.AlertDefinitionManagerRemote;
import org.rhq.enterprise.server.alert.AlertManagerRemote;
@@ -89,6 +91,7 @@ public class RemoteClient implements RhqFacade {
private Subject subject;
private Client remotingClient;
private String subsystem = null;
+ private ProductInfo serverInfo = null;
/**
* Creates a client that will communicate with the server running on the given host
@@ -422,6 +425,24 @@ public class RemoteClient implements RhqFacade {
return this.remotingClient;
}
+ /**
+ * If the client is connected, this is version of the server that the client is talking to.
+ *
+ * @return remote server version
+ */
+ public String getServerVersion() {
+ return (this.serverInfo != null) ? this.serverInfo.getVersion() : null;
+ }
+
+ /**
+ * If the client is connected, this is build number of the server that the client is talking to.
+ *
+ * @return remote server build number
+ */
+ public String getServerBuildNumber() {
+ return (this.serverInfo != null) ? this.serverInfo.getBuildNumber() : null;
+ }
+
private void doDisconnect() {
try {
if (this.remotingClient != null && this.remotingClient.isConnected()) {
@@ -431,6 +452,7 @@ public class RemoteClient implements RhqFacade {
LOG.warn(e); // TODO what to do here?
} finally {
this.remotingClient = null;
+ this.serverInfo = null;
}
}
@@ -446,6 +468,16 @@ public class RemoteClient implements RhqFacade {
Map<String, String> remotingConfig = buildRemotingConfig(locatorURI);
this.remotingClient = new Client(locator, subsystem, remotingConfig);
this.remotingClient.connect();
+
+ // make sure the remote server can support this client
+ this.serverInfo = getSystemManager().getProductInfo(subject);
+ try {
+ checkServerSupported(this.serverInfo);
+ } catch (Exception e) {
+ // our client cannot be supported by the server - disconnect and rethrow the exception
+ doDisconnect();
+ throw e;
+ }
}
private Map<String, String> buildRemotingConfig(String locatorURI) {
@@ -503,4 +535,43 @@ public class RemoteClient implements RhqFacade {
}
return;
}
+
+ /**
+ * Checks to see if the server (whose version information is passed in) supports this client.
+ * This performs version checks and throws an IllegalStateException if the server does not
+ * support this client.
+ *
+ * @param serverVersionInfo the information about the remote server
+ *
+ * @throws IllegalStateException if the remote server does not support this client
+ */
+ private void checkServerSupported(ProductInfo serverVersionInfo) throws IllegalStateException {
+ boolean supported;
+ String clientVersionString;
+ String serverVersionString;
+
+ try {
+ clientVersionString = getClass().getPackage().getImplementationVersion();
+ serverVersionString = this.serverInfo.getVersion();
+ ComparableVersion clientVersion = new ComparableVersion(clientVersionString);
+ ComparableVersion serverVersion = new ComparableVersion(serverVersionString);
+ supported = clientVersion.equals(serverVersion);
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot determine if server version is supported.", e); // assume we can't talk to it
+ }
+
+ if (!supported) {
+ String errMsg = "This client [" + clientVersionString + "] does not support the remote server ["
+ + serverVersionString + "]";
+
+ final String propName = "rhq.client.version-check";
+ String versionCheckProp = System.getProperty(propName, "true");
+ if (versionCheckProp.equalsIgnoreCase("true")) {
+ throw new IllegalStateException(errMsg);
+ } else {
+ LOG.error(errMsg + " - '" + propName
+ + "' was not set to true so this client will be allowed to continue but expect errors");
+ }
+ }
+ }
}
\ No newline at end of file
11 years, 11 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java | 21 +++------
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java | 16 ++----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java | 11 ----
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 23 ++++------
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 3 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties | 5 --
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 4 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 3 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 3 -
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties | 8 +++
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 11 ++--
11 files changed, 44 insertions(+), 64 deletions(-)
New commits:
commit 350b123ae5afb4248eb2936656744112c3950359
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Fri Jun 15 15:53:37 2012 -0400
[831272 - remove all attempts at pluralization to fix i18n messages]
Get rid of the bogus message construction. Also, fix up some I18N stuff.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
index e3ff089..795c55e 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RolesView.java
@@ -18,12 +18,16 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.roles;
+import java.util.ArrayList;
+import java.util.List;
+
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.CellClickEvent;
import com.smartgwt.client.widgets.grid.events.CellClickHandler;
+
import org.rhq.enterprise.gui.coregui.client.IconEnum;
import org.rhq.enterprise.gui.coregui.client.admin.AdministrationView;
import org.rhq.enterprise.gui.coregui.client.components.table.EscapedHtmlCellFormatter;
@@ -32,9 +36,6 @@ import org.rhq.enterprise.gui.coregui.client.components.table.TableSection;
import org.rhq.enterprise.gui.coregui.client.components.view.HasViewName;
import org.rhq.enterprise.gui.coregui.client.components.view.ViewName;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* A table that lists all roles and provides the ability to view details of or delete those roles and to create new
* roles.
@@ -49,7 +50,6 @@ public class RolesView extends TableSection<RolesDataSource> implements HasViewN
public static final String VIEW_PATH = AdministrationView.VIEW_ID + "/"
+ AdministrationView.SECTION_SECURITY_VIEW_ID + "/" + VIEW_ID;
-
private boolean hasManageSecurity;
public RolesView(String locatorId, boolean hasManageSecurity) {
@@ -58,10 +58,10 @@ public class RolesView extends TableSection<RolesDataSource> implements HasViewN
final RolesDataSource datasource = RolesDataSource.getInstance();
setDataSource(datasource);
setEscapeHtmlInDetailsLinkColumn(true);
-
+
this.hasManageSecurity = hasManageSecurity;
}
-
+
@Override
protected void configureTable() {
updateSelectionStyle();
@@ -161,13 +161,8 @@ public class RolesView extends TableSection<RolesDataSource> implements HasViewN
}
@Override
- protected String getDataTypeName() {
- return MSG.common_label_role();
- }
-
- @Override
- protected String getDataTypeNamePlural() {
- return MSG.common_label_roles();
+ protected String getDeleteConfirmMessage() {
+ return MSG.common_msg_deleteConfirm(MSG.common_label_roles());
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
index 6d094e9..e4485bd 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/users/UsersView.java
@@ -18,6 +18,9 @@
*/
package org.rhq.enterprise.gui.coregui.client.admin.users;
+import java.util.ArrayList;
+import java.util.List;
+
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.types.SelectionStyle;
import com.smartgwt.client.widgets.Canvas;
@@ -25,6 +28,7 @@ import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.grid.events.CellClickEvent;
import com.smartgwt.client.widgets.grid.events.CellClickHandler;
+
import org.rhq.core.domain.authz.Permission;
import org.rhq.enterprise.gui.coregui.client.CoreGUI;
import org.rhq.enterprise.gui.coregui.client.IconEnum;
@@ -38,9 +42,6 @@ import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup;
import org.rhq.enterprise.gui.coregui.client.gwt.SubjectGWTServiceAsync;
import org.rhq.enterprise.gui.coregui.client.util.message.Message;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* A table that lists all users and provides the ability to view or edit details of users, delete users, or create new
* users. For the logged in user to view or edit a user other than themselves, they must possess the
@@ -227,13 +228,8 @@ public class UsersView extends TableSection<UsersDataSource> implements HasViewN
}
@Override
- protected String getDataTypeName() {
- return MSG.common_label_user();
- }
-
- @Override
- protected String getDataTypeNamePlural() {
- return MSG.common_label_users();
+ protected String getDeleteConfirmMessage() {
+ return MSG.common_msg_deleteConfirm(MSG.common_label_users());
}
@Override
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java
index 42403da..a89e1e2 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/carousel/Carousel.java
@@ -864,17 +864,6 @@ public abstract class Carousel extends LocatableHLayout implements RefreshableVi
}
}
- protected String getDataTypeName() {
- return "item";
- }
-
- protected String getDataTypeNamePlural() {
- return "items";
- }
-
- protected String getDeleteConfirmMessage() {
- return MSG.common_msg_deleteConfirm(getDataTypeNamePlural());
- }
// -------------- Inner utility classes ------------- //
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
index 70e29d4..27692b8 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java
@@ -1111,10 +1111,9 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
}
if (deletedRecordNames.size() == selectedRecordCount) {
// all selected schedules were successfully deleted.
- Message message = new Message(MSG.widget_recordEditor_info_recordsDeletedConcise(
- String.valueOf(deletedRecordNames.size()), getDataTypeNamePlural()), MSG
- .widget_recordEditor_info_recordsDeletedDetailed(String.valueOf(deletedRecordNames.size()),
- getDataTypeNamePlural(), deletedRecordNames.toString()));
+ String deletedMessage = getDeletedMessage(deletedRecordNames.size());
+ String deletedMessageDetail = deletedMessage + ": [" + deletedRecordNames.toString() + "]";
+ Message message = new Message(deletedMessage, deletedMessageDetail);
CoreGUI.getMessageCenter().notify(message);
refresh();
}
@@ -1124,20 +1123,18 @@ public class Table<DS extends RPCDataSource> extends LocatableHLayout implements
}, requestProperties);
}
- protected String getDataTypeName() {
- return "item";
- }
-
- protected String getDataTypeNamePlural() {
- return "items";
- }
-
protected String getTitleFieldName() {
return FIELD_NAME;
}
+ protected String getDeletedMessage(int numDeleted) {
+ String num = String.valueOf(numDeleted);
+ String thing = (1 == numDeleted) ? MSG.common_label_item() : MSG.common_label_items();
+ return MSG.common_msg_deleted(num, thing);
+ }
+
protected String getDeleteConfirmMessage() {
- return MSG.common_msg_deleteConfirm(getDataTypeNamePlural());
+ return MSG.common_msg_deleteConfirm(MSG.common_label_items());
}
protected void hideField(ListGridField field) {
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 8d228e8..e8d267b 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
@@ -83,6 +83,7 @@ common_msg_areYouSure = Are You Sure?
common_msg_asyncTimeout = {0}. This occurred because the server is taking a long time to complete this request. Please be aware that the server may still be processing your request and it may complete shortly. You can check the server logs to see if any abnormal errors occurred.
common_msg_changeAutoDetected = Change auto-detected
common_msg_deleteConfirm = Are you sure you want to delete the # selected {0}?
+common_msg_deleted = {0} {1} deleted.
common_msg_emphasizedNotePrefix = NOTE:
common_msg_loading = Loading...
common_msg_noItemsToShow = No items to show
@@ -2000,8 +2001,6 @@ widget_recordEditor_info_recordCreatedConcise = {0} created.
widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] created.
widget_recordEditor_info_recordUpdatedConcise = {0} updated.
widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] updated.
-widget_recordEditor_info_recordsDeletedConcise = {0} {1} deleted.
-widget_recordEditor_info_recordsDeletedDetailed = {0} {1} deleted: {2}.
widget_recordEditor_title_edit = Edit {0} [{1}]
widget_recordEditor_title_new = Create New {0}
widget_recordEditor_title_view = View {0} [{1}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
index edf2e50..f02b83b 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
@@ -106,6 +106,7 @@ common_msg_areYouSure = Jste si jistí?
common_msg_asyncTimeout = {0}. Stalo se to, protože serveru trvalo příliš dlouho k vyřízení požadavku. Prosím, vemte na vědomí, že server může stále vyřizovat Váš požadavek. Můžete zkontrolovat logy serveru, zda nenajdete něco neobvyklého.
common_msg_changeAutoDetected = Změnit automaticky detekované
common_msg_deleteConfirm = Jste si jistí, že chcete smazat # vybraných {0}?
+common_msg_deleted = {0} {1} smazáno.
common_msg_emphasizedNotePrefix = POZNÁMKA:
common_msg_loading = Nahrávám...
common_msg_noItemsToShow = Žádné položky k zobrazení
@@ -1562,6 +1563,7 @@ view_inventory_resources_deleteFailed = Nepodařilo se odstranit vybrané zdroje
view_inventory_resources_deleteSuccessful = Požadavek na smazání zdroje byl úspěšně předán všem agentům.
view_inventory_resources_disableConfirm = Jste si jisti, že chcete zneplatnit vybrané zdroje? Při zneplatnění jsou hlášení o dostupnosti zdroje ignorovány. Zneplatňování může být užitečné při údržbě systému, kdy se předpokládá, že zdroje nebudou fungovat (plánovaný restart apod.)
view_inventory_resources_disableFailed = Nepodařilo se zneplatnit vybrané zdroje.
+view_inventory_resources_disableSuccessful = Úspěšně jste zneplatnil vybrané zdroje a jejich potomky, [{0}] zdrojů
view_inventory_resources_enableConfirm = Jste si jisti, že chcete povolit vybrané zdroje? Při povolení se dostupnost nastaví na neznámou (UNKNOWN) dokud neproběhne další agentovo hlášení o dostupnosti zdrojů. Agenti budou požádáni o tento report co nejdříve.
view_inventory_resources_enableFailed = Nepodařilo se povolit vybrané zdroje.
view_inventory_resources_enableSuccessful = Úspěšně jste povolili vybrané zdroje a jejich potomky, [{0}] zdrojů.
@@ -1979,7 +1981,6 @@ view_upload_tooltip_1b = Vyberte soubor k uploadu a klikněte na Další
view_upload_tooltip_2 = Upload souboru minule selhal
view_upload_upload = Upload
view_upload_uploadFile = Upload souboru
-vview_inventory_resources_disableSuccessful = Úspěšně jste zneplatnil vybrané zdroje a jejich potomky, [{0}] zdrojů
widget_colorPicker_tooltip = Klikněte pro výběr nové barvy
widget_durationItem_inputUnitLessThanTargetUnit = Vstupní jednotka je menší než cílová jednotka.
widget_durationItem_unitTypeNotSupported = Typ jednotek [{0}] není podporován třídou DurationItem.
@@ -2018,8 +2019,6 @@ widget_recordEditor_info_recordCreatedConcise = {0} vytvořeno.
widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] vytvořeno.
widget_recordEditor_info_recordUpdatedConcise = {0} změněno.
widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] změněno.
-widget_recordEditor_info_recordsDeletedConcise = {0} {1} smazáno.
-widget_recordEditor_info_recordsDeletedDetailed = {0} {1} smazáno: {2}.
widget_recordEditor_title_edit = Editovat {0} [{1}]
widget_recordEditor_title_new = Vytvořit nový {0}
widget_recordEditor_title_view = Zobrazit {0} [{1}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 3806dd5..4de4df2 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -86,6 +86,7 @@ common_msg_areYouSure = Sind Sie sicher?
common_msg_asyncTimeout = {0}. Dies ist aufgetreten weil der Server lange Zeit für die Bearbeitung der Anfrage benötigt. Bitte beachten Sie, dass der Serer eventuell Ihre Anfrage immer noch bearbeitet und bald fertig sein kann. Sie können die Server-Logs überprüfen, um zu sehen, ob abnormale Bedingungen aufgetreten sind.
common_msg_changeAutoDetected = Änderungen gefunden
##common_msg_deleteConfirm = Are you sure you want to delete the # selected {0}?
+common_msg_deleted = {0} {1} gelöscht.
common_msg_emphasizedNotePrefix = Achtung:
common_msg_loading = Laden...
common_msg_noItemsToShow = Keine Einträge vorhanden
@@ -1341,6 +1342,7 @@ view_inventory_problemGroups = Gruppen mit Problemen
##view_inventory_resources_deleteConfirm = Are you sure you want to delete the selected resources?
##view_inventory_resources_deleteFailed = Failed to delete the selected resources
##view_inventory_resources_deleteSuccessful = A request to perform the resource deletion has been submitted successfully to the agent(s).
+##view_inventory_resources_disableSuccessful = You have successfully disabled the selected resources and their children, [{0}] resources.
##view_inventory_resources_loadFailed = Failed to load resource composite data
##view_inventory_resources_members = Member Resources
view_inventory_sectionHelp = In diesem Abschnitt können neu gefundene Ressourcen, sowie Ressourcen und Gruppen im Inventar angesehen und verwaltet werden.
@@ -1780,8 +1782,6 @@ widget_recordEditor_info_recordCreatedConcise = {0} angelegt.
widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] angelegt.
widget_recordEditor_info_recordUpdatedConcise = {0} aktualisiert.
widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] aktualisiert.
-widget_recordEditor_info_recordsDeletedConcise = {0} {1} gelöscht.
-widget_recordEditor_info_recordsDeletedDetailed = {0} {1} gelöscht: {2}.
widget_recordEditor_title_edit = Bearbeiten {0} [{1}]
widget_recordEditor_title_new = Neue {0} anlegen
widget_recordEditor_title_view = Anzeigen {0} [{1}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 42b166f..ea692e6 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -86,6 +86,7 @@ common_msg_areYouSure = よろしいですか?
common_msg_asyncTimeout = {0}. これが発生したのはサーバーがこのリクエストを完了するのに長時間経過したからです。サーバーがそのリクエストをまだ処理中で短時間で完了可能かどうか注意してください。サーバーログを調べることで異常なエラーが発生したかどうかがわかります。
common_msg_changeAutoDetected = 変更が自動検出されました
common_msg_deleteConfirm = 選択された {0} を削除してもよろしいですか
+common_msg_deleted = {0} {1} が削除されました。
common_msg_emphasizedNotePrefix = 注意:
common_msg_loading = ロード中...
common_msg_noItemsToShow = 表示する項目はありません
@@ -1987,8 +1988,6 @@ widget_recordEditor_info_recordCreatedConcise = {0} が作成されました。
widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] が作成されました。
widget_recordEditor_info_recordUpdatedConcise = {0} が更新されました。
widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] が更新されました。
-widget_recordEditor_info_recordsDeletedConcise = {0} {1} が削除されました。
-widget_recordEditor_info_recordsDeletedDetailed = {0} {1} が削除されました: {2}.
widget_recordEditor_title_edit = 編集 {0} [{1}]
widget_recordEditor_title_new = 新規作成 {0}
widget_recordEditor_title_view = 閲覧 {0} [{1}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index a755166..26f3ab8 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -84,6 +84,7 @@ common_msg_areYouSure = Tem certeza?
common_msg_asyncTimeout = {0}. Isso ocorre porque o servidor est\u00E1 levando muito tempo para atender esta requisi\u00E7\u00E3o. Favor atentar para o fato de que o servidor ainda esteja processando sua requisi\u00E7\u00E3o e pode concluir dentro de mais alguns instantes. Voc\u00EA ainda pode verificar os logs do servidor para identificar se algum erro anormal ocorreu.
common_msg_changeAutoDetected = Mudan\u00E7as detectadas automaticamente
common_msg_deleteConfirm = Tem certeza de que deseja excluir o # selecionado {0}?
+common_msg_deleted = {0} {1} exclu\u00EDdo.
common_msg_emphasizedNotePrefix = NOTA:
common_msg_loading = Carregando...
common_msg_noItemsToShow = N\u00E3o existem itens para apresentar
@@ -2103,8 +2104,6 @@ widget_recordEditor_info_recordCreatedConcise = {0} criado.
widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] criado.
widget_recordEditor_info_recordUpdatedConcise = {0} atualizado.
widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] atualizado.
-widget_recordEditor_info_recordsDeletedConcise = {0} {1} exclu\u00EDdo.
-widget_recordEditor_info_recordsDeletedDetailed = {0} {1} exclu\u00EDdo: {2}.
widget_recordEditor_title_edit = Editar {0} [{1}]
widget_recordEditor_title_new = Criar Novo {0}
widget_recordEditor_title_view = Visualizar {0} [{1}]
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
index c572c62..394ecc9 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
@@ -2093,7 +2093,10 @@ common_label_users = пользователи
common_label_week = неделя
common_label_yesterday = Вчера
common_msg_areYouSure = Вы уверены?
+##common_msg_asyncTimeout = {0}. This occurred because the server is taking a long time to complete this request. Please be aware that the server may still be processing your request and it may complete shortly. You can check the server logs to see if any abnormal errors occurred.
common_msg_changeAutoDetected = Автообнаружение изменений
+##common_msg_deleteConfirm = Are you sure you want to delete the # selected {0}?
+##common_msg_deleted = {0} {1} deleted.
common_msg_emphasizedNotePrefix = Примечание\:
common_msg_loading = Загрузка...
common_msg_noItemsToShow = Отсутствуют элементы для отображения
@@ -2456,6 +2459,7 @@ view_admin_downloads_cli_version = Версия CLI
##view_bundle_revertWizard_getInfoStep_revertDeployDescFull = [REVERT From] {0} [REVERT To] {1}
##view_configEdit_property = Property
##view_configEdit_unset = Unset?
+##view_inventory_resources_disableSuccessful = You have successfully disabled the selected resources and their children, [{0}] resources.
##view_messageCenter_messageRootCause = Root Cause
##view_operationHistoryList_cancelConfirm = Are you sure you want to cancel the selected operations? NOTE: Only those selected operations that are currently "in progress" will be attempted to be canceled.
##view_operationHistoryList_cancelFailure = The cancel request failed for the operation with the history ID of [{0}].
@@ -2464,3 +2468,7 @@ view_admin_downloads_cli_version = Версия CLI
##view_operationHistoryList_deleteFailure = Failed to delete operation history [{0}].
##view_operationHistoryList_deletePartialSuccess = Deleted [{0}] operation history items, but failed to delete the items with the following IDs: {1}
##view_operationHistoryList_deleteSuccess = Deleted [{0}] operation history items.
+##widget_recordEditor_info_recordCreatedConcise = {0} created.
+##widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] created.
+##widget_recordEditor_info_recordUpdatedConcise = {0} updated.
+##widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] updated.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index 8d22ea6..dff469a 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -83,6 +83,7 @@ common_msg_areYouSure = \u4f60\u786e\u5b9a?
common_msg_asyncTimeout = {0}. \u56e0\u4e3a\u670d\u52a1\u5668\u54cd\u5e94\u65f6\u95f4\u592a\u957f. \u8bf7\u6ce8\u610f\u670d\u52a1\u5668\u53ef\u80fd\u4ecd\u5728\u5904\u7406\u60a8\u7684\u8bf7\u6c42\uff0c\u5e76\u53ef\u80fd\u5728\u77ed\u671f\u5185\u5b8c\u6210. \u4f60\u53ef\u4ee5\u68c0\u67e5\u670d\u52a1\u5668\u65e5\u5fd7\uff0c\u67e5\u770b\u662f\u5426\u51fa\u73b0\u4efb\u4f55\u4e0d\u6b63\u5e38\u7684\u9519\u8bef.
##common_msg_changeAutoDetected = Change auto-detected
common_msg_deleteConfirm = \u4f60\u786e\u5b9a\u8981\u5220\u9664# selected {0}?
+##common_msg_deleted = {0} {1} deleted.
common_msg_emphasizedNotePrefix = \u6ce8\u610f:
common_msg_loading = \u52a0\u8f7d\u4e2d...
common_msg_noItemsToShow = \u6ca1\u6709\u6761\u76ee\u663e\u793a
@@ -1982,12 +1983,10 @@ widget_recordEditor_error_operation = \u64cd\u4f5c\u5931\u8d25.\u6709\u9519\u8be
widget_recordEditor_error_operationInvalidValues = \u64cd\u4f5c\u5931\u8d25-\u4e00\u4e2a\u6216\u591a\u4e2a\u5b57\u6bb5\u7684\u503c\u65e0\u6548
widget_recordEditor_error_permissionCreate = \u4f60\u6ca1\u6709\u521b\u5efa\u65b0[{0}]\u7684\u6743\u9650
widget_recordEditor_error_unsupportedOperationType = \u4e0d\u652f\u6301\u7684\u64cd\u4f5c\u7c7b\u578b: [{0}]
-widget_recordEditor_info_recordCreatedConcise = {0} created.
-widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] created.
-widget_recordEditor_info_recordUpdatedConcise = {0} updated.
-widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] updated.
-widget_recordEditor_info_recordsDeletedConcise = {0} {1} deleted.
-widget_recordEditor_info_recordsDeletedDetailed = {0} {1} deleted: {2}.
+##widget_recordEditor_info_recordCreatedConcise = {0} created.
+##widget_recordEditor_info_recordCreatedDetailed = {0} [{1}] created.
+##widget_recordEditor_info_recordUpdatedConcise = {0} updated.
+##widget_recordEditor_info_recordUpdatedDetailed = {0} [{1}] updated.
widget_recordEditor_title_edit = \u7f16\u8f91{0} [{1}]
widget_recordEditor_title_new = \u65b0\u5efa{0}
widget_recordEditor_title_view = \u67e5\u770b{0} [{1}]
11 years, 11 months
[rhq] 2 commits - modules/core modules/plugins
by lkrejci
modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java | 19 +
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java | 68 ++++
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/ManualAddDiscoveryComponent.java | 34 ++
modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/TestResourceComponent.java | 103 ++++++
modules/core/plugin-container-itest/src/test/resources/test-great-grandchild-discovery-plugin.xml | 30 +
modules/core/plugin-container/src/main/java/org/rhq/core/pc/availability/AvailabilityContextImpl.java | 7
modules/core/plugin-container/src/main/java/org/rhq/core/pc/event/EventContextImpl.java | 7
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java | 151 +++++-----
8 files changed, 346 insertions(+), 73 deletions(-)
New commits:
commit ac7fe40163f22ed7b634d1ec8138fb0182e1617d
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Jun 15 17:35:38 2012 +0200
[BZ 832090] - adding an integration test for checking that all the PC
subsystems obtain the synced resource after manual add.
diff --git a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
index 0b7b043..37e4ff2 100644
--- a/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
+++ b/modules/core/arquillian-integration/container/src/main/java/org/rhq/test/arquillian/FakeServerInventory.java
@@ -41,6 +41,7 @@ import org.mockito.stubbing.Answer;
import org.rhq.core.clientapi.agent.upgrade.ResourceUpgradeRequest;
import org.rhq.core.clientapi.agent.upgrade.ResourceUpgradeResponse;
import org.rhq.core.clientapi.server.discovery.InventoryReport;
+import org.rhq.core.domain.discovery.MergeResourceResponse;
import org.rhq.core.domain.discovery.ResourceSyncInfo;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
@@ -186,6 +187,24 @@ public class FakeServerInventory {
return discoveryChecker;
}
+ public synchronized Answer<MergeResourceResponse> addResource() {
+ return new Answer<MergeResourceResponse>() {
+ @Override
+ public MergeResourceResponse answer(InvocationOnMock invocation) throws Throwable {
+ Resource r = (Resource) invocation.getArguments()[0];
+ int subjectId = (Integer) invocation.getArguments()[1];
+
+ LOG.debug("A request to add a resource [" + r + "] made by subject with id " + subjectId);
+
+ boolean exists = getResourceStore().containsKey(r.getUuid());
+
+ r = fakePersist(r, InventoryStatus.COMMITTED, new HashSet<String>());
+
+ return new MergeResourceResponse(r.getId(), exists);
+ }
+ };
+ }
+
public synchronized Answer<ResourceSyncInfo> mergeInventoryReport(final InventoryStatus requiredInventoryStatus) {
return new Answer<ResourceSyncInfo>() {
@Override
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java
index 474c5c9..8880b92 100644
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/DiscoveryTest.java
@@ -19,11 +19,17 @@
package org.rhq.core.pc.inventory;
import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyInt;
import static org.mockito.Mockito.when;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotEquals;
+import static org.testng.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
+import org.mockito.Mockito;
import org.testng.Assert;
import org.testng.annotations.Test;
@@ -34,13 +40,22 @@ import org.jboss.arquillian.testng.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.rhq.core.clientapi.server.discovery.InventoryReport;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.discovery.MergeResourceResponse;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pc.PluginContainer;
import org.rhq.core.pc.PluginContainerConfiguration;
+import org.rhq.core.pc.availability.AvailabilityContextImpl;
+import org.rhq.core.pc.content.ContentContextImpl;
+import org.rhq.core.pc.event.EventContextImpl;
+import org.rhq.core.pc.inventory.testplugin.ManualAddDiscoveryComponent;
import org.rhq.core.pc.inventory.testplugin.TestResourceComponent;
import org.rhq.core.pc.inventory.testplugin.TestResourceDiscoveryComponent;
+import org.rhq.core.pc.operation.OperationContextImpl;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
import org.rhq.test.arquillian.AfterDiscovery;
import org.rhq.test.arquillian.BeforeDiscovery;
import org.rhq.test.arquillian.FakeServerInventory;
@@ -58,7 +73,7 @@ public class DiscoveryTest extends Arquillian {
public static RhqAgentPluginArchive getTestPlugin() {
RhqAgentPluginArchive pluginJar = ShrinkWrap.create(RhqAgentPluginArchive.class, "test-plugin.jar");
return pluginJar.setPluginDescriptor("test-great-grandchild-discovery-plugin.xml").addClasses(
- TestResourceDiscoveryComponent.class, TestResourceComponent.class);
+ TestResourceDiscoveryComponent.class, TestResourceComponent.class, ManualAddDiscoveryComponent.class);
}
@ArquillianResource
@@ -122,6 +137,57 @@ public class DiscoveryTest extends Arquillian {
+ flaggedExecutionCountsByResourceType);
}
+ @Test(groups = "pc.itest.discovery", priority = 10)
+ public void testResourceSyncedWithServerAfterManualAdd() throws Exception {
+ Mockito.when(serverServices.getDiscoveryServerService().addResource(any(Resource.class), anyInt())).then(
+ fakeServerInventory.addResource());
+
+ InventoryManager inventoryManager = pluginContainer.getInventoryManager();
+
+ Resource platform = inventoryManager.getPlatform();
+
+ Configuration myPluginConfig = new Configuration();
+ myPluginConfig.put(new PropertySimple("test", "value"));
+
+ ResourceType resourceType = pluginContainer.getPluginManager().getMetadataManager()
+ .getType("Manual Add Server", "test");
+
+ MergeResourceResponse response = inventoryManager.manuallyAddResource(resourceType, platform.getId(),
+ myPluginConfig, -1);
+
+ assertFalse(response.resourceAlreadyExisted(), "The manual add resource shouldn't have existed");
+ assertNotEquals(response.getResourceId(), 0, "The manual add resource should have had its resource id set");
+
+ ResourceContainer resourceContainer = inventoryManager.getResourceContainer(response.getResourceId());
+ ResourceContext<?> resourceContext = resourceContainer.getResourceContext();
+
+ assertEquals(resourceContext.getPluginConfiguration(), myPluginConfig,
+ "The manual add resource doesn't have the expected plugin config.");
+
+ assertTrue(resourceContext.getAvailabilityContext() instanceof AvailabilityContextImpl,
+ "Unexpected implementation clas of the AvailabilityContext, please fix this test.");
+ assertEquals(((AvailabilityContextImpl) resourceContext.getAvailabilityContext()).getResource().getId(),
+ response.getResourceId(),
+ "Availability subsystem isn't aware of the correct resource id for manual add resource");
+
+ assertTrue(resourceContext.getContentContext() instanceof ContentContextImpl,
+ "Unexpected implementation class of ContentContext, please fix this test");
+ assertEquals(((ContentContextImpl) resourceContext.getContentContext()).getResourceId(),
+ response.getResourceId(),
+ "Content subsystem isn't aware of the correct resource id for manual add resource");
+
+ assertTrue(resourceContext.getEventContext() instanceof EventContextImpl,
+ "Unexpected implementation clas of the EventContext, please fix this test.");
+ assertEquals(((EventContextImpl) resourceContext.getEventContext()).getResource().getId(),
+ response.getResourceId(), "Event subsystem isn't aware of the correct resource id for manual add resource");
+
+ assertTrue(resourceContext.getOperationContext() instanceof OperationContextImpl,
+ "Unexpected implementation clas of the OperationContext, please fix this test.");
+ assertEquals(((OperationContextImpl) resourceContext.getOperationContext()).getResourceId(),
+ response.getResourceId(),
+ "Operation subsystem isn't aware of the correct resource id for manual add resource");
+ }
+
private void validatePluginContainerInventory() throws Exception {
System.out.println("Validating PC inventory...");
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/ManualAddDiscoveryComponent.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/ManualAddDiscoveryComponent.java
new file mode 100644
index 0000000..95701b2
--- /dev/null
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/ManualAddDiscoveryComponent.java
@@ -0,0 +1,34 @@
+package org.rhq.core.pc.inventory.testplugin;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.resource.ResourceType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
+import org.rhq.core.pluginapi.inventory.ManualAddFacet;
+import org.rhq.core.pluginapi.inventory.ResourceComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+
+public class ManualAddDiscoveryComponent implements ResourceDiscoveryComponent<ResourceComponent<?>>,
+ ManualAddFacet<ResourceComponent<?>> {
+
+ @Override
+ public DiscoveredResourceDetails discoverResource(Configuration pluginConfiguration,
+ ResourceDiscoveryContext<ResourceComponent<?>> context) throws InvalidPluginConfigurationException {
+
+ ResourceType resourceType = context.getResourceType();
+
+ return new DiscoveredResourceDetails(resourceType, "SINGLETON", resourceType.getName(), "1.0",
+ resourceType.getDescription(), pluginConfiguration, null);
+ }
+
+ @Override
+ public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<ResourceComponent<?>> context)
+ throws InvalidPluginConfigurationException, Exception {
+ return Collections.emptySet();
+ }
+
+}
diff --git a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/TestResourceComponent.java b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/TestResourceComponent.java
index d56d598..20ccf76 100644
--- a/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/TestResourceComponent.java
+++ b/modules/core/plugin-container-itest/src/test/java/org/rhq/core/pc/inventory/testplugin/TestResourceComponent.java
@@ -18,15 +18,49 @@
*/
package org.rhq.core.pc.inventory.testplugin;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Set;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.content.PackageType;
+import org.rhq.core.domain.content.transfer.DeployPackageStep;
+import org.rhq.core.domain.content.transfer.DeployPackagesResponse;
+import org.rhq.core.domain.content.transfer.RemovePackagesResponse;
+import org.rhq.core.domain.content.transfer.ResourcePackageDetails;
import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.bundle.BundleDeployRequest;
+import org.rhq.core.pluginapi.bundle.BundleDeployResult;
+import org.rhq.core.pluginapi.bundle.BundleFacet;
+import org.rhq.core.pluginapi.bundle.BundlePurgeRequest;
+import org.rhq.core.pluginapi.bundle.BundlePurgeResult;
+import org.rhq.core.pluginapi.configuration.ConfigurationFacet;
+import org.rhq.core.pluginapi.configuration.ConfigurationUpdateReport;
+import org.rhq.core.pluginapi.content.ContentFacet;
+import org.rhq.core.pluginapi.content.ContentServices;
+import org.rhq.core.pluginapi.inventory.CreateChildResourceFacet;
+import org.rhq.core.pluginapi.inventory.CreateResourceReport;
+import org.rhq.core.pluginapi.inventory.DeleteResourceFacet;
import org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException;
import org.rhq.core.pluginapi.inventory.ResourceComponent;
import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.measurement.MeasurementFacet;
+import org.rhq.core.pluginapi.operation.OperationFacet;
+import org.rhq.core.pluginapi.operation.OperationResult;
+import org.rhq.core.pluginapi.support.SnapshotReportRequest;
+import org.rhq.core.pluginapi.support.SnapshotReportResults;
+import org.rhq.core.pluginapi.support.SupportFacet;
/**
+ * This resource component implements most (all?) of the facets so that all the plugin container subsystems can work
+ * with it.
+ *
* @author Ian Springer
*/
-public class TestResourceComponent implements ResourceComponent<ResourceComponent<?>> {
+public class TestResourceComponent implements ResourceComponent<ResourceComponent<?>>, OperationFacet, ContentFacet,
+ ConfigurationFacet, MeasurementFacet, DeleteResourceFacet, CreateChildResourceFacet, BundleFacet, SupportFacet {
private ResourceContext<ResourceComponent<?>> resourceContext;
@@ -46,4 +80,71 @@ public class TestResourceComponent implements ResourceComponent<ResourceComponen
return;
}
+ @Override
+ public SnapshotReportResults getSnapshotReport(SnapshotReportRequest request) throws Exception {
+ return null;
+ }
+
+ @Override
+ public BundleDeployResult deployBundle(BundleDeployRequest request) {
+ return null;
+ }
+
+ @Override
+ public BundlePurgeResult purgeBundle(BundlePurgeRequest request) {
+ return null;
+ }
+
+ @Override
+ public CreateResourceReport createResource(CreateResourceReport report) {
+ return null;
+ }
+
+ @Override
+ public void deleteResource() throws Exception {
+ }
+
+ @Override
+ public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> metrics) throws Exception {
+ }
+
+ @Override
+ public Configuration loadResourceConfiguration() throws Exception {
+ return null;
+ }
+
+ @Override
+ public void updateResourceConfiguration(ConfigurationUpdateReport report) {
+ }
+
+ @Override
+ public List<DeployPackageStep> generateInstallationSteps(ResourcePackageDetails packageDetails) {
+ return null;
+ }
+
+ @Override
+ public DeployPackagesResponse deployPackages(Set<ResourcePackageDetails> packages, ContentServices contentServices) {
+ return null;
+ }
+
+ @Override
+ public RemovePackagesResponse removePackages(Set<ResourcePackageDetails> packages) {
+ return null;
+ }
+
+ @Override
+ public Set<ResourcePackageDetails> discoverDeployedPackages(PackageType type) {
+ return null;
+ }
+
+ @Override
+ public InputStream retrievePackageBits(ResourcePackageDetails packageDetails) {
+ return null;
+ }
+
+ @Override
+ public OperationResult invokeOperation(String name, Configuration parameters) throws InterruptedException,
+ Exception {
+ return null;
+ }
}
diff --git a/modules/core/plugin-container-itest/src/test/resources/test-great-grandchild-discovery-plugin.xml b/modules/core/plugin-container-itest/src/test/resources/test-great-grandchild-discovery-plugin.xml
index 477b3c9..a1e222a 100644
--- a/modules/core/plugin-container-itest/src/test/resources/test-great-grandchild-discovery-plugin.xml
+++ b/modules/core/plugin-container-itest/src/test/resources/test-great-grandchild-discovery-plugin.xml
@@ -27,4 +27,34 @@
</service>
</service>
</server>
+
+ <server name="Manual Add Server"
+ discovery="ManualAddDiscoveryComponent"
+ class="TestResourceComponent">
+ <plugin-configuration>
+ <c:simple-property name="test" />
+ </plugin-configuration>
+ <operation name="test" />
+ <metric property="test" />
+ <event name="test" />
+ <content name="test" category="executableScript" />
+ <resource-configuration>
+ <c:simple-property name="test" />
+ </resource-configuration>
+
+ <drift-definition name="test">
+ <basedir>
+ <value-context>fileSystem</value-context>
+ <value-name>test</value-name>
+ </basedir>
+ </drift-definition>
+
+ <bundle-target>
+ <destination-base-dir name="test">
+ <value-context>fileSystem</value-context>
+ <value-name>test</value-name>
+ </destination-base-dir>
+ </bundle-target>
+
+ </server>
</plugin>
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/availability/AvailabilityContextImpl.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/availability/AvailabilityContextImpl.java
index f34d673..32fb361 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/availability/AvailabilityContextImpl.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/availability/AvailabilityContextImpl.java
@@ -79,4 +79,11 @@ public class AvailabilityContextImpl implements AvailabilityContext {
public void enable() {
PluginContainer.getInstance().getInventoryManager().setResourceEnablement(resource.getId(), true);
}
+
+ /**
+ * Only used in tests
+ */
+ public Resource getResource() {
+ return resource;
+ }
}
diff --git a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/event/EventContextImpl.java b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/event/EventContextImpl.java
index a50a658..fd360cf 100644
--- a/modules/core/plugin-container/src/main/java/org/rhq/core/pc/event/EventContextImpl.java
+++ b/modules/core/plugin-container/src/main/java/org/rhq/core/pc/event/EventContextImpl.java
@@ -108,6 +108,13 @@ public class EventContextImpl implements EventContext {
return getEventManager().getSigar();
}
+ /**
+ * Only used for testing purposes.
+ */
+ public Resource getResource() {
+ return resource;
+ }
+
private void registerEventPollerInternal(final EventPoller poller, int pollingInterval, final String sourceLocation) {
EventDefinition eventDefinition = EventUtility.getEventDefinition(poller.getEventType(),
this.resource.getResourceType());
commit 13663106e701a2390f7dc06a778718994318a4c4
Author: Lukas Krejci <lkrejci(a)redhat.com>
Date: Fri Jun 15 14:14:01 2012 +0200
Trivial - code formatting
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
index 655b0a3..6f84e34 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/DeploymentTest.java
@@ -64,32 +64,32 @@ import org.rhq.test.arquillian.ServerServicesSetup;
@Test(groups = { "integration", "pc", "standalone" }, singleThreaded = true)
public class DeploymentTest extends AbstractJBossAS7PluginTest {
- private enum TestDeployments {
- DEPLOYMENT_1("test-simple.war"), DEPLOYMENT_2("test-simple-2.war");
-
- private String deploymentName;
- private String resourcePath;
- private byte[] hash;
-
- private TestDeployments(String warName) {
- this.deploymentName = warName;
- this.resourcePath = "itest/" + warName;
- hash = computeHash(DeploymentTest.class.getClassLoader().getResourceAsStream(resourcePath));
- }
-
- public String getDeploymentName() {
- return deploymentName;
- }
-
- public String getResourcePath() {
- return resourcePath;
- }
-
- public byte[] getHash() {
- return hash;
- }
- }
-
+ private enum TestDeployments {
+ DEPLOYMENT_1("test-simple.war"), DEPLOYMENT_2("test-simple-2.war");
+
+ private String deploymentName;
+ private String resourcePath;
+ private byte[] hash;
+
+ private TestDeployments(String warName) {
+ this.deploymentName = warName;
+ this.resourcePath = "itest/" + warName;
+ hash = computeHash(DeploymentTest.class.getClassLoader().getResourceAsStream(resourcePath));
+ }
+
+ public String getDeploymentName() {
+ return deploymentName;
+ }
+
+ public String getResourcePath() {
+ return resourcePath;
+ }
+
+ public byte[] getHash() {
+ return hash;
+ }
+ }
+
@ResourceComponentInstances(plugin = PLUGIN_NAME, resourceType = "JBossAS7 Standalone Server")
private Set<StandaloneASComponent> standalones;
@@ -102,7 +102,7 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
private Set<Resource> deploymentResources;
private static TestDeployments DEPLOYMENT_TO_SERVE = TestDeployments.DEPLOYMENT_1;
-
+
private static long copyStreamAndReturnCount(InputStream in, OutputStream out) throws IOException {
int data;
long cnt = 0;
@@ -115,7 +115,7 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
return cnt;
}
-
+
//this is no test method
@ServerServicesSetup
@Test(enabled = false)
@@ -126,16 +126,20 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
new Answer<Long>() {
@Override
public Long answer(InvocationOnMock invocation) throws Throwable {
- InputStream str = getClass().getClassLoader().getResourceAsStream(DEPLOYMENT_TO_SERVE.getResourcePath());
+ InputStream str = getClass().getClassLoader().getResourceAsStream(
+ DEPLOYMENT_TO_SERVE.getResourcePath());
OutputStream out = (OutputStream) invocation.getArguments()[invocation.getArguments().length - 1];
return copyStreamAndReturnCount(str, out);
}
});
-
- Mockito.when(serverServices.getContentServerService().downloadPackageBitsGivenResource(Mockito.anyInt(), Mockito.any(PackageDetailsKey.class), Mockito.any(OutputStream.class))).then(new Answer<Long>() {
+
+ Mockito.when(
+ serverServices.getContentServerService().downloadPackageBitsGivenResource(Mockito.anyInt(),
+ Mockito.any(PackageDetailsKey.class), Mockito.any(OutputStream.class))).then(new Answer<Long>() {
@Override
public Long answer(InvocationOnMock invocation) throws Throwable {
- InputStream str = getClass().getClassLoader().getResourceAsStream(DEPLOYMENT_TO_SERVE.getResourcePath());
+ InputStream str = getClass().getClassLoader()
+ .getResourceAsStream(DEPLOYMENT_TO_SERVE.getResourcePath());
OutputStream out = (OutputStream) invocation.getArguments()[invocation.getArguments().length - 1];
return copyStreamAndReturnCount(str, out);
}
@@ -167,8 +171,8 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
request.setResourceName(packageDetails.getName());
request.setResourceTypeName("Deployment");
- CreateResourceResponse response =
- pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(request);
+ CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
+ request);
assert response.getStatus() == CreateResourceStatus.SUCCESS : "The deoloyment failed with an error mesasge: "
+ response.getErrorMessage();
@@ -181,16 +185,17 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
Resource deployment = deploymentResources.iterator().next();
assert TestDeployments.DEPLOYMENT_1.getDeploymentName().equals(deployment.getName()) : "The deployment doesn't seem to have the expected name";
-
- ContentDiscoveryReport report = pluginContainer.getContentManager().executeResourcePackageDiscoveryImmediately(deployment.getId(), "file");
-
+
+ ContentDiscoveryReport report = pluginContainer.getContentManager().executeResourcePackageDiscoveryImmediately(
+ deployment.getId(), "file");
+
Set<ResourcePackageDetails> details = report.getDeployedPackages();
-
+
assert details != null && details.size() == 1 : "The archived deployment should be backed by exactly 1 package.";
-
+
ResourcePackageDetails actualDetails = details.iterator().next();
ResourcePackageDetails expectedDetails = getTestDeploymentPackageDetails(TestDeployments.DEPLOYMENT_1);
-
+
//we don't expect the resource details to be equal, because the version field
//will be different - the test code simplistically just assigns "1.0"
//but the actual code assigns a sha256, because the test war doesn't contain
@@ -200,39 +205,42 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
String actualType = actualDetails.getPackageTypeName();
String expectedName = expectedDetails.getName();
String expectedType = expectedDetails.getPackageTypeName();
-
- Assert.assertEquals(actualName, expectedName, "The deployment's package details are called differently than expected.");
- Assert.assertEquals(actualType, expectedType, "The deployment's package details have different type than expected.");
+
+ Assert.assertEquals(actualName, expectedName,
+ "The deployment's package details are called differently than expected.");
+ Assert.assertEquals(actualType, expectedType,
+ "The deployment's package details have different type than expected.");
}
@Test(priority = 13)
public void testDeploymentContentRetrieval() throws Exception {
- testContentRetrieval(TestDeployments.DEPLOYMENT_1);
+ testContentRetrieval(TestDeployments.DEPLOYMENT_1);
}
@Test(priority = 14)
public void testRedeploy() throws Exception {
- Resource deployment = deploymentResources.iterator().next();
- //we are updating the deployment 1. So provide a key to the first deployment but later on actually
- //deliver bits of the deployment 2, so that we get the update we "wanted".
- ResourcePackageDetails packageDetails = getTestDeploymentPackageDetails(TestDeployments.DEPLOYMENT_1);
-
- //this is what our mocked serverside is going to serve the package bits for
- TestDeployments origServedDeployemnt = DEPLOYMENT_TO_SERVE;
- DEPLOYMENT_TO_SERVE = TestDeployments.DEPLOYMENT_2;
-
- try {
- DeployPackagesRequest request = new DeployPackagesRequest(1, deployment.getId(), Collections.singleton(packageDetails));
-
- DeployPackagesResponse response = pluginContainer.getContentManager().deployPackagesImmediately(request);
-
- testContentRetrieval(TestDeployments.DEPLOYMENT_2);
- } finally {
- //switch the served deployment back, so that other tests aren't affected
- DEPLOYMENT_TO_SERVE = origServedDeployemnt;
- }
+ Resource deployment = deploymentResources.iterator().next();
+ //we are updating the deployment 1. So provide a key to the first deployment but later on actually
+ //deliver bits of the deployment 2, so that we get the update we "wanted".
+ ResourcePackageDetails packageDetails = getTestDeploymentPackageDetails(TestDeployments.DEPLOYMENT_1);
+
+ //this is what our mocked serverside is going to serve the package bits for
+ TestDeployments origServedDeployemnt = DEPLOYMENT_TO_SERVE;
+ DEPLOYMENT_TO_SERVE = TestDeployments.DEPLOYMENT_2;
+
+ try {
+ DeployPackagesRequest request = new DeployPackagesRequest(1, deployment.getId(),
+ Collections.singleton(packageDetails));
+
+ DeployPackagesResponse response = pluginContainer.getContentManager().deployPackagesImmediately(request);
+
+ testContentRetrieval(TestDeployments.DEPLOYMENT_2);
+ } finally {
+ //switch the served deployment back, so that other tests aren't affected
+ DEPLOYMENT_TO_SERVE = origServedDeployemnt;
+ }
}
-
+
@Test(priority = 15)
public void testUndeploy() throws Exception {
Resource deployment = deploymentResources.iterator().next();
@@ -240,7 +248,7 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
getServerInventory().removeResource(deployment);
pluginContainer.getResourceFactoryManager().deleteResource(request);
}
-
+
private void testContentRetrieval(final TestDeployments deployment) throws Exception {
final boolean[] lockAndTestResult = new boolean[2];
@@ -269,8 +277,8 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
//setup the content retrieval request and execute it
Resource deploymentResource = deploymentResources.iterator().next();
- RetrievePackageBitsRequest request =
- new RetrievePackageBitsRequest(0, deploymentResource.getId(), getTestDeploymentPackageDetails(deployment));
+ RetrievePackageBitsRequest request = new RetrievePackageBitsRequest(0, deploymentResource.getId(),
+ getTestDeploymentPackageDetails(deployment));
pluginContainer.getContentManager().retrievePackageBits(request);
//the content retrieval is async so wait in the test method until the mocked server-side
@@ -282,14 +290,15 @@ public class DeploymentTest extends AbstractJBossAS7PluginTest {
assert lockAndTestResult[1] : "The data obtained from the deployment are different to what should have been deployed.";
}
}
-
+
private ResourcePackageDetails getTestDeploymentPackageDetails(TestDeployments deployment) {
- ResourcePackageDetails details = new ResourcePackageDetails(new PackageDetailsKey(deployment.getDeploymentName(), "1.0", "file", "noarch"));
+ ResourcePackageDetails details = new ResourcePackageDetails(new PackageDetailsKey(
+ deployment.getDeploymentName(), "1.0", "file", "noarch"));
details.setFileName(deployment.getDeploymentName());
details.setDeploymentTimeConfiguration(new Configuration());
-
+
return details;
-
+
}
private static byte[] computeHash(InputStream str) {
11 years, 11 months
[rhq] modules/enterprise
by mazz
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java | 26 +++++-----
1 file changed, 14 insertions(+), 12 deletions(-)
New commits:
commit 19f7fabd25d7beda27499e57a52a3f313c47a343
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Fri Jun 15 11:25:33 2012 -0400
provide more information to the user when the security token is bad
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java
index 851937b..c976f5a 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/core/CoreServerServiceImpl.java
@@ -137,11 +137,8 @@ public class CoreServerServiceImpl implements CoreServerService {
if (agentByName != null) {
// the agent request provided a name that already is in use by an agent. However, the request
// provided a security token that was not assigned to any agent! How can this be? Something is fishy.
- String msg = "The agent asking for registration under the name ["
- + request.getName()
- + "] provided an invalid security token. This request will fail. "
- + "Please consult an administrator to obtain the agent's proper security token "
- + "and restart the agent with the option \"-Drhq.agent.security-token=<the valid security token>\"";
+ String msg = "The agent asking for registration under the name [" + request.getName()
+ + "] provided an invalid security token. This request will fail. " + securityTokenMessage();
throw new AgentRegistrationException(msg);
}
Agent agentByAddressPort = getAgentManager().getAgentByAddressAndPort(request.getAddress(),
@@ -176,11 +173,8 @@ public class CoreServerServiceImpl implements CoreServerService {
+ " and same security token.";
throw new AgentRegistrationException(msg);
} else {
- String msg = "The agent ["
- + request.getName()
- + "] is attempting to re-register without a security token. "
- + "Please consult an administrator to obtain the agent's proper security token "
- + "and restart the agent with the option \"-Drhq.agent.security-token=<the valid security token>\"";
+ String msg = "The agent [" + request.getName()
+ + "] is attempting to re-register without a security token. " + securityTokenMessage();
throw new AgentRegistrationException(msg);
}
@@ -192,8 +186,7 @@ public class CoreServerServiceImpl implements CoreServerService {
String msg = "An agent is trying to register with an existing agent name ["
+ request.getName()
+ "] without providing a valid security token. If you are attempting to re-register this agent, "
- + "please consult an administrator to obtain the agent's proper security token "
- + "and restart the agent with the option \"-Drhq.agent.security-token=<the valid security token>\"";
+ + "you will need the agent's security token. " + securityTokenMessage();
throw new AgentRegistrationException(msg);
}
}
@@ -274,6 +267,15 @@ public class CoreServerServiceImpl implements CoreServerService {
return results;
}
+ private String securityTokenMessage() {
+ return "Please consult an administrator to obtain the agent's proper security token "
+ + "and restart the agent with the option \"-Drhq.agent.security-token=<the valid security token>\". "
+ + "An administrator can find the agent's security token by navigating to the GUI page "
+ + "\"Administration (Topology) > Agents\" and drilling down to this specific agent. "
+ + "You will see the long security token string there. For more information, read: "
+ + "https://docs.jboss.org/author/display/RHQ/Agent+Registration";
+ }
+
/**
* @see CoreServerService#connectAgent(ConnectAgentRequest)
*/
11 years, 11 months
[rhq] modules/enterprise
by mazz
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java | 13 ++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 544aba9cb75ea85b9dd2ceecb56047290856eab7
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 14 17:06:29 2012 -0400
[BZ 832204] protect against npe when the message bar disappears but user still has the root cause context menu option and selects it
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
index 0aba1ba..a2d76e5 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageBar.java
@@ -85,14 +85,19 @@ public class MessageBar extends LocatableHLayout implements MessageCenter.Messag
showRootCauseMenuItem.addClickHandler(new ClickHandler() {
@Override
public void onClick(MenuItemClickEvent event) {
- String rootCause = MessageBar.this.currentMessage.getRootCauseMessage();
- SC.say(MSG.view_messageCenter_messageRootCause(), rootCause);
+ Message msg = MessageBar.this.currentMessage;
+ if (msg != null) {
+ String rootCause = msg.getRootCauseMessage();
+ if (rootCause != null) {
+ SC.say(MSG.view_messageCenter_messageRootCause(), rootCause);
+ }
+ }
}
});
showRootCauseMenuItem.setEnableIfCondition(new MenuItemIfFunction() {
public boolean execute(Canvas target, Menu menu, MenuItem item) {
- return MessageBar.this.currentMessage != null
- && MessageBar.this.currentMessage.getRootCauseMessage() != null;
+ Message msg = MessageBar.this.currentMessage;
+ return msg != null && msg.getRootCauseMessage() != null;
}
});
11 years, 11 months
[rhq] modules/plugins
by snegrea
modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java | 21 ++++++----
1 file changed, 13 insertions(+), 8 deletions(-)
New commits:
commit 0cdd1e4fd3e738b275a59751e0fb0a07bcd1a626
Author: Stefan Negrea <snegrea(a)redhat.com>
Date: Thu Jun 14 15:29:43 2012 -0500
Adding ignored resources along with reason for ignoring them to the load/update integration test.
diff --git a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
index 4eb3519..d11e7ab 100644
--- a/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
+++ b/modules/plugins/jboss-as-7/src/test/java/org/rhq/modules/plugins/jbossas7/itest/standalone/ResourcesStandaloneServerTest.java
@@ -39,8 +39,6 @@ import org.rhq.core.domain.configuration.Configuration;
import org.rhq.core.domain.operation.OperationDefinition;
import org.rhq.core.domain.resource.InventoryStatus;
import org.rhq.core.domain.resource.Resource;
-import org.rhq.core.domain.resource.ResourceCategory;
-import org.rhq.core.domain.resource.ResourceType;
import org.rhq.core.pc.configuration.ConfigurationManager;
import org.rhq.core.pc.inventory.InventoryManager;
import org.rhq.core.pc.inventory.ResourceContainer;
@@ -77,20 +75,26 @@ public class ResourcesStandaloneServerTest extends AbstractJBossAS7PluginTest {
@Test(priority = 12)
public void loadUpdateTemplatedResourceConfiguration() throws Exception {
+ List<String> ignoredResources = new ArrayList<String>();
+
+ //ignored because of differences between test plugin container and real application
+ //works well with real agent
+ ignoredResources.add("VHost");
+
+ //ignored because the settings different when started with arquillian, inet-address is not set correctly
+ //works well with real agent
+ ignoredResources.add("Network Interface");
+
Resource platform = this.pluginContainer.getInventoryManager().getPlatform();
Resource server = getResourceByTypeAndKey(platform, StandaloneServerComponentTest.RESOURCE_TYPE,
StandaloneServerComponentTest.RESOURCE_KEY);
ConfigurationManager configurationManager = this.pluginContainer.getConfigurationManager();
configurationManager.initialize();
- Thread.sleep(100 * 1000L);
+ Thread.sleep(40 * 1000L);
Queue<Resource> unparsedResources = new LinkedList<Resource>();
for (Resource topLevelResource : server.getChildResources()) {
- ResourceType resourceType = new ResourceType(topLevelResource.getResourceType().getName(), PLUGIN_NAME,
- ResourceCategory.SERVICE, null);
- topLevelResource = getResourceByTypeAndKey(server, resourceType, topLevelResource.getResourceKey());
-
if (topLevelResource.getInventoryStatus().equals(InventoryStatus.COMMITTED)) {
unparsedResources.add(topLevelResource);
} else {
@@ -111,7 +115,8 @@ public class ResourcesStandaloneServerTest extends AbstractJBossAS7PluginTest {
}
}
- if (resourceUnderTest.getResourceType().getResourceConfigurationDefinition() != null) {
+ if (resourceUnderTest.getResourceType().getResourceConfigurationDefinition() != null
+ && !ignoredResources.contains(resourceUnderTest.getResourceType().getName())) {
Configuration configUnderTest = configurationManager
.loadResourceConfiguration(resourceUnderTest.getId());
11 years, 11 months
[rhq] modules/enterprise
by Jay Shaughnessy
modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java | 165 +++++-----
1 file changed, 90 insertions(+), 75 deletions(-)
New commits:
commit 6b4d1b0baf4d1d95d51d14fc7387fbc78cbf97fe
Author: Jay Shaughnessy <jshaughn(a)redhat.com>
Date: Thu Jun 14 16:24:46 2012 -0400
[830158 - java.sql.BatchUpdateException when you uninventory everything right after importing it]
The exception is due to badness when trying to uninventory a platform that is
actively merging in new resources. This is an unlikely use case. This commit
does not try to prevent the problem but rather adds some exception handling
and an improved log message indicating the probably scenario, and suggesting the
user retry after waiting for the resources to be merged.
diff --git a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
index 468f619..79c7935 100644
--- a/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
+++ b/modules/enterprise/server/jar/src/main/java/org/rhq/enterprise/server/resource/ResourceManagerBean.java
@@ -276,101 +276,116 @@ public class ResourceManagerBean implements ResourceManagerLocal, ResourceManage
throw new PermissionException("You do not have permission to uninventory resource [" + resourceId + "]");
}
- // if the resource has no parent, its a top root resource and its agent should be purged too
- // test code does not always follow this rule, so catch and continue.
+ // if the resource has no parent, its a platform resource and its agent should be purged too
Agent doomedAgent = null;
- if (resource.getParentResource() == null) {
- try {
+ try {
+ if (resource.getParentResource() == null) {
// note, this needs to be done before the marking because the agent reference is going to be set to null
doomedAgent = agentManager.getAgentByResourceId(subjectManager.getOverlord(), resourceId);
- } catch (Exception e) {
- doomedAgent = null;
- log.warn("This warning should occur in TEST code only! " + e);
+
+ // note - test code does not always provide the agent, if not found, just warn
+ if (doomedAgent == null) {
+ log.warn("Platform resource had no associated agent. This warning should occur in TEST code only!");
+ }
}
- }
- AgentClient agentClient = null;
- try {
- // The test code does not always generate agents for the resources. Catch and log any problem but continue
- agentClient = agentManager.getAgentClient(subjectManager.getOverlord(), resourceId);
- } catch (Throwable t) {
- log.warn("No AgentClient found for resource [" + resource
- + "]. Unable to inform agent of inventory removal (this may be ok): " + t);
- }
+ AgentClient agentClient = null;
+ try {
+ // The test code does not always generate agents for the resources. Catch and log any problem but continue
+ agentClient = agentManager.getAgentClient(subjectManager.getOverlord(), resourceId);
+ } catch (Throwable t) {
+ log.warn("No AgentClient found for resource [" + resource
+ + "]. Unable to inform agent of inventory removal (this may be ok): " + t);
+ }
- // since we delete the resource asynchronously now, we need to make sure we remove things that would cause
- // system side effects after markForDeletion completed but before the resource was actually removed from the DB
- Subject overlord = subjectManager.getOverlord();
+ // since we delete the resource asynchronously now, we need to make sure we remove things that would cause
+ // system side effects after markForDeletion completed but before the resource was actually removed from the DB
+ Subject overlord = subjectManager.getOverlord();
- // delete the resource and all its children
- log.info("User [" + user + "] is marking resource [" + resource + "] for asynchronous uninventory");
+ // delete the resource and all its children
+ log.info("User [" + user + "] is marking resource [" + resource + "] for asynchronous uninventory");
- // set agent references null
- // foobar the resourceKeys
- // update the inventory status to UNINVENTORY
- Query toBeDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_FIND_DESCENDANTS);
- toBeDeletedQuery.setParameter("resourceId", resourceId);
- List<Integer> toBeDeletedResourceIds = toBeDeletedQuery.getResultList();
+ // set agent references null
+ // foobar the resourceKeys
+ // update the inventory status to UNINVENTORY
+ Query toBeDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_FIND_DESCENDANTS);
+ toBeDeletedQuery.setParameter("resourceId", resourceId);
+ List<Integer> toBeDeletedResourceIds = toBeDeletedQuery.getResultList();
- int i = 0;
- log.debug("== total size : " + toBeDeletedResourceIds.size());
+ int i = 0;
+ log.debug("== total size : " + toBeDeletedResourceIds.size());
+
+ while (i < toBeDeletedResourceIds.size()) {
+ int j = i + 1000;
+ if (j > toBeDeletedResourceIds.size())
+ j = toBeDeletedResourceIds.size();
+ List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j);
+ log.debug("== Bounds " + i + ", " + j);
+
+ boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete);
+ if (hasErrors) {
+ throw new IllegalArgumentException("Could not remove resources from their containing groups");
+ }
+ i = j;
+ }
- while (i < toBeDeletedResourceIds.size()) {
- int j = i + 1000;
- if (j > toBeDeletedResourceIds.size())
- j = toBeDeletedResourceIds.size();
- List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j);
- log.debug("== Bounds " + i + ", " + j);
+ // QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION is an expensive recursive query
+ // But luckily we have already (through such a recursive query above) determined the doomed resources
+ // Query markDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION);
+ // markDeletedQuery.setParameter("resourceId", resourceId);
+ // markDeletedQuery.setParameter("status", InventoryStatus.UNINVENTORIED);
+ // int resourcesDeleted = markDeletedQuery.executeUpdate();
- boolean hasErrors = uninventoryResourcesBulkDelete(overlord, idsToDelete);
- if (hasErrors) {
- throw new IllegalArgumentException("Could not remove resources from their containing groups");
+ i = 0;
+ int resourcesDeleted = 0;
+ while (i < toBeDeletedResourceIds.size()) {
+ int j = i + 1000;
+ if (j > toBeDeletedResourceIds.size())
+ j = toBeDeletedResourceIds.size();
+ List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j);
+
+ Query markDeletedQuery = entityManager
+ .createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK);
+ markDeletedQuery.setParameter("resourceIds", idsToDelete);
+ markDeletedQuery.setParameter("status", InventoryStatus.UNINVENTORIED);
+ resourcesDeleted += markDeletedQuery.executeUpdate();
+ i = j;
}
- i = j;
- }
- // QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION is an expensive recursive query
- // But luckily we have already (through such a recursive query above) determined the doomed resources
- // Query markDeletedQuery = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION);
- // markDeletedQuery.setParameter("resourceId", resourceId);
- // markDeletedQuery.setParameter("status", InventoryStatus.UNINVENTORIED);
- // int resourcesDeleted = markDeletedQuery.executeUpdate();
+ if (resourcesDeleted != toBeDeletedResourceIds.size()) {
+ log.error("Tried to uninventory " + toBeDeletedResourceIds.size()
+ + " resources, but actually uninventoried " + resourcesDeleted);
+ }
- i = 0;
- int resourcesDeleted = 0;
- while (i < toBeDeletedResourceIds.size()) {
- int j = i + 1000;
- if (j > toBeDeletedResourceIds.size())
- j = toBeDeletedResourceIds.size();
- List<Integer> idsToDelete = toBeDeletedResourceIds.subList(i, j);
+ // still need to tell the agent about the removed resources so it stops avail reports
+ if (agentClient != null) {
+ try {
+ agentClient.getDiscoveryAgentService().uninventoryResource(resourceId);
+ } catch (Exception e) {
+ log.warn(" Unable to inform agent of inventory removal for resource [" + resourceId + "]", e);
+ }
+ }
- Query markDeletedQuery = entityManager
- .createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK);
- markDeletedQuery.setParameter("resourceIds", idsToDelete);
- markDeletedQuery.setParameter("status", InventoryStatus.UNINVENTORIED);
- resourcesDeleted += markDeletedQuery.executeUpdate();
- i = j;
- }
+ // now remove the dommed agent. Call flush() to force out any problems with agent removal
+ // so that we can catch them and report a better exception.
+ if (doomedAgent != null) {
+ agentManager.deleteAgent(doomedAgent);
+ entityManager.flush();
+ }
- if (resourcesDeleted != toBeDeletedResourceIds.size()) {
- log.error("Tried to uninventory " + toBeDeletedResourceIds.size()
- + " resources, but actually uninventoried " + resourcesDeleted);
- }
+ return toBeDeletedResourceIds;
- // still need to tell the agent about the removed resources so it stops avail reports
- if (agentClient != null) {
- try {
- agentClient.getDiscoveryAgentService().uninventoryResource(resourceId);
- } catch (Exception e) {
- log.warn(" Unable to inform agent of inventory removal for resource [" + resourceId + "]", e);
+ } catch (RuntimeException e) {
+ if (doomedAgent != null) {
+ // The most likely reason for a failure, although unlikely in itself, is that newly discovered resources
+ // are currently being merged into the platform, and associated with the doomed agent. In this case
+ // the user must wait until the merge is complete. Make sure the caller knows about this possibility.
+ throw new IllegalStateException(
+ "Failed to uninventory platform. This can happen if new resources were actively being imported. Please wait and try again shortly.");
}
- }
- if (doomedAgent != null) {
- agentManager.deleteAgent(doomedAgent);
+ throw e;
}
-
- return toBeDeletedResourceIds;
}
@SuppressWarnings("unchecked")
11 years, 11 months
[rhq] etc/m2 modules/core modules/enterprise pom.xml
by mazz
etc/m2/settings.xml | 6 +++---
etc/m2/smartgwt-war-archetype/pom.xml | 2 +-
modules/core/plugindoc/src/main/java/org/rhq/core/tool/plugindoc/PluginDocGenerator.java | 4 ++--
modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 3 ++-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties | 10 +++++-----
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties | 2 +-
modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties | 2 +-
modules/enterprise/gui/installer-war/pom.xml | 6 +++---
modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_ko.properties | 8 --------
modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties | 2 --
modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_zh.properties | 1 -
modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties | 4 ++--
modules/enterprise/gui/portal-war/src/main/webapp/rhq/common/menu/menu.xhtml | 2 +-
modules/enterprise/server/container/src/main/downloadable-resources/connectors/README.txt | 2 +-
modules/enterprise/server/container/src/main/resources/etc/RHQ-mib.txt | 4 ++--
modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml | 2 +-
modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java | 2 +-
modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java | 2 +-
pom.xml | 8 ++++----
24 files changed, 36 insertions(+), 46 deletions(-)
New commits:
commit f33a3aca5c5915df31276bdebe287d81c7f9942d
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jun 14 15:16:27 2012 -0400
[BZ 825338] fix the doc links to point to the new jboss.org RHQ confluence docs
diff --git a/etc/m2/settings.xml b/etc/m2/settings.xml
index 0464376..8bb17aa 100644
--- a/etc/m2/settings.xml
+++ b/etc/m2/settings.xml
@@ -248,7 +248,7 @@
<!--<rhq.containerDir>C:/home/bob/rhq-dev-container</rhq.containerDir>-->
<!-- set browser(s) to compile the GWT stuff for
- ~~ See http://rhq-project.org/display/RHQ/Advanced+Build+Notes#AdvancedBuildNote...
+ ~~ See https://docs.jboss.org/author/display/RHQ/Advanced+Build+Notes#AdvancedBu...
~~ for details and browser versions
~~ Possible values are: ie6,ie8,ie9,gecko,gecko1_8,safari,opera
-->
@@ -277,8 +277,8 @@
<profile>
<id>publish</id>
<properties>
- <confluenceUrl>http://rhq-project.org/</confluenceUrl>
- <confluenceSpace>JOPR2</confluenceSpace>
+ <confluenceUrl>https://docs.jboss.org/author/display/</confluenceUrl>
+ <confluenceSpace>RHQ</confluenceSpace>
<confluenceParentPageTitle>Managed Resources</confluenceParentPageTitle>
<confluenceUserName>SET_ME</confluenceUserName>
<confluencePassword>SET_ME</confluencePassword>
diff --git a/etc/m2/smartgwt-war-archetype/pom.xml b/etc/m2/smartgwt-war-archetype/pom.xml
index 19ef9be..fdec67d 100644
--- a/etc/m2/smartgwt-war-archetype/pom.xml
+++ b/etc/m2/smartgwt-war-archetype/pom.xml
@@ -16,7 +16,7 @@
<name>smartgwt-war-archetype</name>
<description>archetype for a Maven project for a SmartGWT web application (WAR)</description>
- <url>http://rhq-project.org/</url>
+ <url>http://www.jboss.org/rhq/</url>
<licenses>
<license>
diff --git a/modules/core/plugindoc/src/main/java/org/rhq/core/tool/plugindoc/PluginDocGenerator.java b/modules/core/plugindoc/src/main/java/org/rhq/core/tool/plugindoc/PluginDocGenerator.java
index 605b644..dbf047d 100644
--- a/modules/core/plugindoc/src/main/java/org/rhq/core/tool/plugindoc/PluginDocGenerator.java
+++ b/modules/core/plugindoc/src/main/java/org/rhq/core/tool/plugindoc/PluginDocGenerator.java
@@ -115,8 +115,8 @@ public class PluginDocGenerator {
}
public void loadProperties(Properties props) {
- this.confluenceUrl = props.getProperty("confluenceUrl", "http://rhq-project.org/");
- this.confluenceSpace = props.getProperty("confluenceSpace", "JOPR2");
+ this.confluenceUrl = props.getProperty("confluenceUrl", "https://docs.jboss.org/author/display/");
+ this.confluenceSpace = props.getProperty("confluenceSpace", "RHQ");
this.confluenceParentPageTitle = props.getProperty("confluenceParentPageTitle", "Management Plugins");
this.confluenceUserName = props.getProperty("confluenceUserName");
this.confluencePassword = props.getProperty("confluencePassword");
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
index 52e3a8f..cae2d20 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java
@@ -323,7 +323,8 @@ public class DashboardsView extends LocatableVLayout implements DashboardContain
DashboardPortlet news = new DashboardPortlet(MashupPortlet.NAME, MashupPortlet.KEY, 300);
if (isRHQ) {
- news.getConfiguration().put(new PropertySimple("address", "http://rhq-project.org/display/RHQ/Home"));
+ news.getConfiguration()
+ .put(new PropertySimple("address", "https://docs.jboss.org/author/display/RHQ/Home"));
} else {
news.getConfiguration().put(
new PropertySimple("address",
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties
index 5f4e2d9..c3b641e 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/MessageConstants.properties
@@ -33,17 +33,17 @@ view_help_section_1_title = Documentation
view_help_section_1_item_count = 3
view_help_section_1_propTitle_1 = Frequently Asked Questions (FAQ)
-view_help_section_1_propUrl_1 = http://www.rhq-project.org/display/JOPR2/FAQ
+view_help_section_1_propUrl_1 = https://docs.jboss.org/author/display/RHQ/FAQ
view_help_section_1_propTitle_2 = Documentation Set
-view_help_section_1_propUrl_2 = http://www.rhq-project.org/display/JOPR2/Home
+view_help_section_1_propUrl_2 = https://docs.jboss.org/author/display/RHQ/Home
view_help_section_1_propTitle_3 = API Javadoc
-view_help_section_1_propUrl_3 = http://www.rhq-project.org/display/JOPR2/API+Documentation
+view_help_section_1_propUrl_3 = https://docs.jboss.org/author/display/RHQ/API+Documentation
view_help_section_2_title = Tutorial
view_help_section_2_item_count = 4
view_help_section_2_propTitle_1 = Demo: All Demos
-view_help_section_2_propUrl_1 = http://www.rhq-project.org/display/JOPR2/Demos
+view_help_section_2_propUrl_1 = https://docs.jboss.org/author/display/RHQ/Demos
view_help_section_2_propTitle_2 = Demo: Bundle Provisioning
view_help_section_2_propUrl_2 = http://management-platform.blogspot.com/2011/01/bundle-provisioning-via-r...
view_help_section_2_propTitle_3 = How to build Group Definitions
@@ -51,4 +51,4 @@ view_help_section_2_propIcon_3 = [SKIN]/../actions/help.png
view_help_section_2_propUrl_3 = http://docs.redhat.com/docs/en-US/JBoss_Operations_Network/2.4/html/Basic...
view_help_section_2_propTitle_4 = How to use the Search Bar
view_help_section_2_propIcon_4 = [SKIN]/../actions/help.png
-view_help_section_2_propUrl_4 = http://www.rhq-project.org/display/JOPR2/Search
+view_help_section_2_propUrl_4 = https://docs.jboss.org/author/display/RHQ/Search
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 0e948cd..8d228e8 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
@@ -3,7 +3,7 @@
#
# Developers: See the following wiki page for how to work with this file:
#
-# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
+# https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
common_alert_high = High
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
index a5d71dd..edf2e50 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_cs.properties
@@ -26,7 +26,7 @@
#
# Developers: See the following wiki page for how to work with this file:
#
-# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
+# https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
common_alert_high = Vysoká
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
index 57ffe8d..3806dd5 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_de.properties
@@ -6,7 +6,7 @@
#
# Developers: See the following wiki page for how to work with this file:
#
-# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
+# https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
common_alert_high = HOCH
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
index 0644243..42b166f 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ja.properties
@@ -6,7 +6,7 @@
#
# Developers: See the following wiki page for how to work with this file:
#
-# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
+# https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
common_alert_high = 高
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
index 923ace3..a755166 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_pt.properties
@@ -3,7 +3,7 @@
#
# Developers: See the following wiki page for how to work with this file:
#
-# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
+# https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
F3view_admin_systemSettings_BaselineDataSet_desc = Quantidade de dados mensurados que ser\u00E1 utilizada para determinar um baseline. Valor especificado em dias.
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
index f34cb82..c572c62 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_ru.properties
@@ -3,7 +3,7 @@
##
## Developers: See the following wiki page for how to work with this file:
##
-## http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
+## https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
##
####################################
#common_alert_high = High
diff --git a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
index bafb045..8d22ea6 100644
--- a/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
+++ b/modules/enterprise/gui/coregui/src/main/resources/org/rhq/enterprise/gui/coregui/client/Messages_zh.properties
@@ -3,7 +3,7 @@
#
# Developers: See the following wiki page for how to work with this file:
#
-# http://rhq-project.org/display/RHQ/Working+with+the+Resource+Bundles
+# https://docs.jboss.org/author/display/RHQ/Working+with+the+Resource+Bundles
#
###################################
common_alert_high = High
diff --git a/modules/enterprise/gui/installer-war/pom.xml b/modules/enterprise/gui/installer-war/pom.xml
index ba0518f..e26a864 100644
--- a/modules/enterprise/gui/installer-war/pom.xml
+++ b/modules/enterprise/gui/installer-war/pom.xml
@@ -25,16 +25,16 @@
<product.shortName>RHQ</product.shortName>
<product.name>RHQ</product.name>
<product.fullName>RHQ</product.fullName>
- <product.url.domain>rhq-project.org</product.url.domain>
+ <product.url.domain>jboss.org</product.url.domain>
<product.sales.email>rhq-users(a)lists.fedorahosted.org</product.sales.email>
<product.support.email>rhq-users(a)lists.fedorahosted.org</product.support.email>
<product.version>${project.version}</product.version>
- <product.help.doc.root>http://www.rhq-project.org/display/JOPR2/</product.help.doc.root>
+ <product.help.doc.root>https://docs.jboss.org/author/display/RHQ/</product.help.doc.root>
<product.help.installation>Installation</product.help.installation>
<product.help.guide.server>Running+the+RHQ+Server</product.help.guide.server>
<product.help.guide.agent>Running+the+RHQ+Agent</product.help.guide.agent>
<product.help.FAQ>FAQ</product.help.FAQ>
- <product.help.config.props>http://www.rhq-project.org/display/JOPR2/Startup+Properties#StartupProper...</product.help.config.props>
+ <product.help.config.props>https://docs.jboss.org/author/display/RHQ/Startup+Properties#StartupPrope...</product.help.config.props>
</properties>
<dependencies>
diff --git a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_ko.properties b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_ko.properties
index f206aef..719a354 100644
--- a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_ko.properties
+++ b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_ko.properties
@@ -1,10 +1,3 @@
-product.shortName=RHQ
-product.name=RHQ
-product.fullName=RHQ
-product.url=http://rhq-project.org/
-product.sales.email=sales(a)rhq-project.org
-product.support.email=info(a)rhq-project.org
-helpDocRoot=http://support.rhq-project.org/display/JOPR2/
createDatabaseUserTitle=\uc0dd\uc131 \ub370\uc774\ud130\ubca0\uc774\uc2a4/\uc0ac\uc6a9\uc790
createDatabaseUserHelp=\uc5ec\uae30\uc5d0 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uad00\ub9ac\uc790 \uc815\ubcf4\ub97c \uc785\ub825\ud558\uace0 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \uc0ac\uc6a9\uc790\ub97c \ub9cc\ub4e4 \uc218 \uc788\ub294 \ubc84\ud2bc\uc744 \ub204\ub974\uc2ed\uc2dc\uc624.
adminConnectionUrl=DB \uc5f0\uacb0 URL
@@ -156,7 +149,6 @@ helpDocRHQAgentUsersGuide=Running+the+RHQ+Agent
helpDocRHQAgentUsersGuideLabel=RHQ \uc5d0\uc774\uc804\ud2b8 \uc0ac\uc6a9\uc790 \uac00\uc774\ub4dc
helpDocFaq=FAQ
helpDocFaqLabel=\uc790\uc8fc \ubb3b\ub294 \uc9c8\ubb38
-helpDocRHQServerPropParentPage=http://support.rhq-project.org/display/JOPR2/Startup+Properties#ConfiguringtheServer
newServerSelectItem=\uc2e0\uaddc \uc11c\ubc84
registeredServersLabel=\ub4f1\ub85d\ub41c \uc11c\ubc84:
propertyHighAvailabilityName=\uc11c\ubc84 \uc774\ub984
diff --git a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
index c3af5ba..d5845f4 100644
--- a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
+++ b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_pt.properties
@@ -1,4 +1,3 @@
-helpDocRoot=http://support.rhq-project.org/display/RHQ/
createDatabaseUserTitle=Criar Base de Dados/Usu\u00E1rio
createDatabaseUserHelp=Entre com as informa\u00E7\u00F5es do administrador do banco de dados e clique no bot\u00E3o para criar o baco de dados e o usu\u00E1rio.
adminConnectionUrl=URL de conex\u00E3o com BD
@@ -59,7 +58,6 @@ helpDocRHQGuiConsoleUsersGuideLabel=RHQ GUI Console - Guia do Usu\u00E1rio
helpDocRHQServerUsersGuideLabel=RHQ Server - Guia do Usu\u00E1rio
helpDocRHQAgentUsersGuideLabel=RHQ Agent - Guia do Usu\u00E1rio
helpDocFaqLabel=Perguntas Frequentes (FAQ)
-helpDocRHQServerPropParentPage=http://support.rhq-project.org/display/RHQ/Configuring+the+Server#ConfiguringtheServer
newServerSelectItem=Novo Servidor
registeredServersLabel=Servidores Registrados
propertyHighAvailabilityName=Nome do Servidor
diff --git a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_zh.properties b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_zh.properties
index e392202..8878300 100644
--- a/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_zh.properties
+++ b/modules/enterprise/gui/installer-war/src/main/resources/InstallerMessages_zh.properties
@@ -150,7 +150,6 @@ helpDocRHQAgentUsersGuide=Running+the+RHQ+Agent
helpDocRHQAgentUsersGuideLabel=RHQ Agent\u7528\u6237\u6307\u5357
helpDocFaq=FAQ
helpDocFaqLabel=\u7591\u96be\u89e3\u7b54
-helpDocRHQServerPropParentPage=http://support.rhq-project.org/display/JOPR2/Startup+Properties#ConfiguringtheServer
newServerSelectItem=\u65b0\u670d\u52a1\u5668
registeredServersLabel=\u6ce8\u518c\u7684\u670d\u52a1\u5668:
propertyHighAvailabilityName=\u670d\u52a1\u5668\u540d\u79f0
diff --git a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
index fd3edea..96c0e3b 100644
--- a/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
+++ b/modules/enterprise/gui/portal-war/src/main/webapp-filtered/WEB-INF/classes/ApplicationResources.properties
@@ -88,7 +88,7 @@ common.field.value=Value
common.marketing.FeatureDisabled=This feature is unavailable, please contact sales to upgrade
-common.url.help=http://www.rhq-project.org/display/JOPR2
+common.url.help=https://docs.jboss.org/author/display/RHQ/User+Documentation
common.error.invalid.oid=OID specified is invalid, please enter OID in form of 1.2.3.4
@@ -2952,7 +2952,7 @@ software.common.InstallPreview.PatchTitle=Title
software.common.InstallPreview.StepDescription=Step Description
software.common.InstallPreview.ShortDescription=Short Description
software.common.InstallPreview.LongDescription=Detailed Description
-software.common.InstallPreview.TopMessage=Clicking the [Install] button will begin the execution of the steps listed below. Review each step carefully before proceeding with the update installation.<br/><ul><li>Prior to installing this update, if you have applied any one-off fixes to this instance, please check the update description to see that they are included in the fixes that make up this update. If they are not included then this update may overwrite the one-off fix and leave your instance in an unstable state.</li><li>When updating a JBoss instance that shares a common server configuration, follow the instructions documented in the wiki\: <a href\="http://www.rhq-project.org/display/JOPR2/Demos#Demos-ContentSubsystem" target\="_new">Installing a Patch</a>. Please contact support for more information.</li></ul>
+software.common.InstallPreview.TopMessage=Clicking the [Install] button will begin the execution of the steps listed below. Review each step carefully before proceeding with the update installation.<br/><ul><li>Prior to installing this update, if you have applied any one-off fixes to this instance, please check the update description to see that they are included in the fixes that make up this update. If they are not included then this update may overwrite the one-off fix and leave your instance in an unstable state.</li><li>When updating a JBoss instance that shares a common server configuration, follow the instructions documented in the wiki\: <a href\="https://docs.jboss.org/author/display/RHQ/Demos#Demos-ContentSubsystem" target\="_new">Installing a Patch</a>. Please contact support for more information.</li></ul>
software.common.InstallPreview.NotAllowedToInstall=This user doesn't have the appropriate rights to install an update. Only users that can control a resource may install an update.
software.common.ManualUninstall.TableTitle=Manual Update Uninstallation
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 c855e67..010d29d 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
@@ -625,7 +625,7 @@ v <rich:menuItem submitMode="none"
</p>
<p>
- <a href="http://rhq-project.org/">
+ <a href="http://www.jboss.org/rhq">
<h:graphicImage value="/images/logo_icon.png" style="vertical-align:middle" />
RHQ Project
</a>
diff --git a/modules/enterprise/server/container/src/main/downloadable-resources/connectors/README.txt b/modules/enterprise/server/container/src/main/downloadable-resources/connectors/README.txt
index e0e10d5..c1dc783 100644
--- a/modules/enterprise/server/container/src/main/downloadable-resources/connectors/README.txt
+++ b/modules/enterprise/server/container/src/main/downloadable-resources/connectors/README.txt
@@ -18,5 +18,5 @@ required for earlier versions of Tomcat, since they already include that jar.
For details on how to deploy the filter to various versions of JBoss AS and
Tomcat, see:
-http://rhq-project.org/display/JOPR2/Managed+Product+Configuration
+https://docs.jboss.org/author/display/RHQ/Managed+Product+Configuration
diff --git a/modules/enterprise/server/container/src/main/resources/etc/RHQ-mib.txt b/modules/enterprise/server/container/src/main/resources/etc/RHQ-mib.txt
index 20bb110..ced6071 100644
--- a/modules/enterprise/server/container/src/main/resources/etc/RHQ-mib.txt
+++ b/modules/enterprise/server/container/src/main/resources/etc/RHQ-mib.txt
@@ -13,12 +13,12 @@ IMPORTS
rhqMIB MODULE-IDENTITY
LAST-UPDATED "201112200000Z"
ORGANIZATION "RHQ-Project"
- CONTACT-INFO "http://www.rhq-project.org/"
+ CONTACT-INFO "http://www.jboss.org/rhq"
DESCRIPTION
"The MIB module for RHQ alerts.
This file is part of the RHQ management platform
- Copyright (C) 2005-2011 Red Hat, Inc.
+ Copyright (C) 2005-2012 Red Hat, Inc.
All rights reserved.
"
diff --git a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
index 4d68e6e..1f996f5 100644
--- a/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
+++ b/modules/enterprise/server/plugins/validate-all-serverplugins/pom.xml
@@ -30,7 +30,7 @@
<classpath>
<pathelement path="${test.classpath}" />
- <!-- See also: http://rhq-project.org/display/RHQ/Design-Server+Side+Plugins#Design-Serv... -->
+ <!-- See also: https://docs.jboss.org/author/display/RHQ/Design-Server+Side+Plugins#Desi... -->
<pathelement location="../disk/target/rhq-serverplugin-disk-${project.version}.jar" />
<pathelement location="../jboss-software/target/rhq-serverplugin-jboss-software-${project.version}.jar" />
diff --git a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
index 1e3bae0..3f36ee8 100644
--- a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
+++ b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/ServerPluginDescriptorUtil.java
@@ -73,7 +73,7 @@ public abstract class ServerPluginDescriptorUtil {
static {
// maps all xsd files to their generated package names for all known server plugin types;
// if a new plugin type is ever added, you must ensure you add the new plugin type's xsd/package here
- // See also: http://rhq-project.org/display/RHQ/Design-Server+Side+Plugins#Design-Serv...
+ // See also: https://docs.jboss.org/author/display/RHQ/Design-Server+Side+Plugins#Desi...
PLUGIN_SCHEMA_PACKAGES = new HashMap<String, String>();
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN, XmlSchemas.PKG_SERVERPLUGIN);
PLUGIN_SCHEMA_PACKAGES.put(XmlSchemas.XSD_SERVERPLUGIN_GENERIC, XmlSchemas.PKG_SERVERPLUGIN_GENERIC);
diff --git a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
index ce46022..9141ae8 100644
--- a/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
+++ b/modules/enterprise/server/xml-schemas/src/main/java/org/rhq/enterprise/server/xmlschema/XmlSchemas.java
@@ -28,7 +28,7 @@ import org.rhq.core.clientapi.descriptor.DescriptorPackages;
* Defines constants related to the server-side XML Schemas, including their JAXB generated package names
* and their .xsd files, as found in the server's classpath.
*
- * See also: http://rhq-project.org/display/RHQ/Design-Server+Side+Plugins#Design-Serv...
+ * See also: https://docs.jboss.org/author/display/RHQ/Design-Server+Side+Plugins#Desi...
*
* @author John Mazzitelli
*/
diff --git a/pom.xml b/pom.xml
index b023384..4799e55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
<name>RHQ</name>
<description>RHQ is a server management and monitoring suite primarily targeted at JBoss software.</description>
- <url>http://rhq-project.org/</url>
+ <url>http://www.jboss.org/rhq/</url>
<inceptionYear>2008</inceptionYear>
<organization>
@@ -47,12 +47,12 @@
<product.shortName>RHQ</product.shortName>
<product.name>RHQ</product.name>
<product.fullName>RHQ</product.fullName>
- <product.url>http://www.rhq-project.org/</product.url>
- <product.urlDomain>rhq-project.org</product.urlDomain>
+ <product.url>http://www.jboss.org/rhq</product.url>
+ <product.urlDomain>jboss.org</product.urlDomain>
<product.salesEmail>rhq-users(a)lists.fedorahosted.org</product.salesEmail>
<product.supportEmail>rhq-users(a)lists.fedorahosted.org</product.supportEmail>
<product.version>${project.version}</product.version>
- <product.helpDocRoot>http://www.rhq-project.org/display/JOPR2/</product.helpDocRoot>
+ <product.helpDocRoot>https://docs.jboss.org/author/display/RHQ/User+Documentation</product.helpDocRoot>
<product.buildPropertiesFile>target/build.properties</product.buildPropertiesFile>
<doUpdate>false</doUpdate>
11 years, 11 months