This repository has been archived by the owner on Jul 11, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from rhq-project/bug/1124614
BZ 1124614 - auto-update agent if its version doesn't match the latest agent version
- Loading branch information
Showing
10 changed files
with
203 additions
and
26 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
modules/core/client-api/intentional-api-changes-since-4.12.0.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0"?> | ||
<!-- | ||
~ RHQ Management Platform | ||
~ Copyright (C) 2005-2014 Red Hat, Inc. | ||
~ All rights reserved. | ||
~ | ||
~ This program is free software; you can redistribute it and/or modify | ||
~ it under the terms of the GNU General Public License as published by | ||
~ the Free Software Foundation version 2 of the License. | ||
~ | ||
~ This program is distributed in the hope that it will be useful, | ||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
~ GNU General Public License for more details. | ||
~ | ||
~ You should have received a copy of the GNU General Public License | ||
~ along with this program; if not, write to the Free Software Foundation, Inc., | ||
~ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA | ||
--> | ||
|
||
<differences> | ||
<difference> | ||
<className>org/rhq/core/clientapi/server/core/ConnectAgentRequest</className> | ||
<differenceType>7004</differenceType> <!-- number of args changed --> | ||
<method>ConnectAgentRequest(*)</method> | ||
<justification>Only agents use this method and this is needed to fix BZ 1124614</justification> | ||
</difference> | ||
<difference> | ||
<className>org/rhq/core/clientapi/server/core/ConnectAgentResults</className> | ||
<differenceType>7004</differenceType> <!-- number of args changed --> | ||
<method>ConnectAgentResults(*)</method> | ||
<justification>Only agents use this method and this is needed to fix BZ 1124614</justification> | ||
</difference> | ||
</differences> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...ise/server/jar/src/main/java/org/rhq/enterprise/server/core/AgentVersionCheckResults.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* RHQ Management Platform | ||
* Copyright (C) 2005-2014 Red Hat, Inc. | ||
* All rights reserved. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
*/ | ||
package org.rhq.enterprise.server.core; | ||
|
||
import java.io.Serializable; | ||
import java.util.Properties; | ||
|
||
import org.rhq.core.clientapi.server.core.AgentVersion; | ||
|
||
/** | ||
* A simple POJO that returns results from the AgentManagerBean that indicates if | ||
* a particular version is supported or not. As part of these results, you get some information | ||
* from the agent version file that is maintained by the server in case additional information | ||
* is needed after the version check is made (such as, if the agent version is not supported, this | ||
* addition information can tell you what is supported). | ||
* | ||
* @author John Mazzitelli | ||
*/ | ||
public class AgentVersionCheckResults implements Serializable { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private final boolean isSupported; | ||
private final AgentVersion latestAgentVersion; | ||
|
||
public AgentVersionCheckResults(boolean isSupported, AgentVersion latestAgentVersion) { | ||
this.isSupported = isSupported; | ||
this.latestAgentVersion = (AgentVersion) ((latestAgentVersion != null) ? latestAgentVersion : new Properties()); | ||
|
||
} | ||
|
||
public boolean isSupported() { | ||
return isSupported; | ||
} | ||
|
||
/** | ||
* Returns the latest agent version information as known by the server. This contains | ||
* information about the agent update distribution that the server provides. | ||
* | ||
* This will be null if the latest agent version information could not be determined. | ||
* | ||
* @return latest agent version information | ||
*/ | ||
public AgentVersion getLatestAgentVersion() { | ||
return latestAgentVersion; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder str = new StringBuilder("AgentVersionCheckResults: "); | ||
str.append("is-supported=["); | ||
str.append(this.isSupported); | ||
str.append("; latest-agent-version=["); | ||
str.append(this.latestAgentVersion); | ||
str.append("]"); | ||
return str.toString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.