Examples of AgentVersion


Examples of org.rhq.core.clientapi.server.core.AgentVersion

    @Override
    public ConnectAgentResults connectAgent(ConnectAgentRequest request) throws AgentRegistrationException,
        AgentNotSupportedException {

        String agentName = request.getAgentName();
        AgentVersion agentVersion = request.getAgentVersion();

        log.info("Agent [" + agentName + "][" + agentVersion + "] would like to connect to this server");

        AgentVersionCheckResults agentVersionCheckResults = getAgentManager().isAgentVersionSupported(agentVersion);
        if (!agentVersionCheckResults.isSupported()) {
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

                            ServiceContainerConfiguration server_config = agent_config.getServiceContainerPreferences();
                            String agent_name = agent_config.getAgentName();
                            String address = server_config.getConnectorBindAddress();
                            int port = server_config.getConnectorBindPort();
                            String remote_endpoint = server_config.getConnectorRemoteEndpoint();
                            AgentVersion agentVersion = getAgentVersion();
                            String installId = System.getProperty(AgentRegistrationRequest.SYSPROP_INSTALL_ID);
                            String installLocation = getAgentHomeDirectory();
                            if (installLocation != null && installLocation.trim().length() == 0) {
                                installLocation = null; // tells the server we don't know it
                            }
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

                // version as the latest agent version as told to us by the server, then this agent should update now.
                // Notice we will only check the build number (hash), the version may be the same but the
                // build hashes will be different.
                boolean agentUpdateEnabled = getConfiguration().isAgentUpdateEnabled();
                if (agentUpdateEnabled) {
                    AgentVersion latestVersion = results.getLatestAgentVersion();
                    if (latestVersion != null && latestVersion.getBuild() != null) {
                        AgentVersion ourVersion = getAgentVersion();
                        if (!ourVersion.getBuild().equals(latestVersion.getBuild())) {
                            throw new AgentNotSupportedException(MSG.getMsg(
                                AgentI18NResourceKeys.AGENT_BUILD_DOES_NOT_MATCH_AUTO_UPDATE_NOW, ourVersion,
                                latestVersion));
                        }
                    }
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

     * @return agent version POJO
     */
    private AgentVersion getAgentVersion() {
        String version = Version.getProductVersion();
        String build = Version.getBuildNumber();
        AgentVersion agentVersion = new AgentVersion(version, build);
        return agentVersion;
    }
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

    private Command createConnectAgentCommand() throws Exception {
        AgentConfiguration config = getConfiguration();
        String agentName = config.getAgentName();
        boolean agentUpdateEnabled = config.isAgentUpdateEnabled();
        AgentVersion version = getAgentVersion();
        ConnectAgentRequest request = new ConnectAgentRequest(agentName, version, agentUpdateEnabled);

        RemotePojoInvocationCommand connectCommand = new RemotePojoInvocationCommand();
        Method connectMethod = CoreServerService.class.getMethod("connectAgent", ConnectAgentRequest.class);
        NameBasedInvocation inv = new NameBasedInvocation(connectMethod, new Object[] { request });
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

    // our agent manager to use to run the check - its the real AgentManagerBean that doesn't require any EE infrastructure for this test
    private AgentManagerBean agentManager = new AgentManagerStub();

    public void testLatestAgentBuildCheck() {
        AgentVersion agentVersionInfo = setLatestAgentVersionAndBuildToCheck("1.0.GA", "cafebabe0", "1.0.GA",
            "cafebabe0");
        assert true == agentManager.isAgentVersionSupported(agentVersionInfo).isSupported();
        agentVersionInfo = setLatestAgentVersionAndBuildToCheck("1.0.GA", "cafebabe0", "1.0.RC1", "cafebabe1");
        assert false == agentManager.isAgentVersionSupported(agentVersionInfo).isSupported();
        agentVersionInfo = setLatestAgentVersionAndBuildToCheck("1.0.GA", "nocafe", "2.0.GA", "cafebabe2");
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

        checkFail(regex, "cafebabe9");
    }

    public void testLatestAgentBuildCheckRegex() {
        String regexOptions = "cafebabe0|3degf01|cafebabe9";
        AgentVersion agentVersionInfo = setSupportedBuildsToCheck(regexOptions, "1.0.GA", "cafebabe0");
        assert true == agentManager.isAgentVersionSupported(agentVersionInfo).isSupported();
        agentVersionInfo = setSupportedBuildsToCheck(regexOptions, "1.0.RC1", "cafebabe1");
        assert false == agentManager.isAgentVersionSupported(agentVersionInfo).isSupported();
        agentVersionInfo = setSupportedBuildsToCheck(regexOptions, "2.0.GA", "3deg");
        assert false == agentManager.isAgentVersionSupported(agentVersionInfo).isSupported();
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

        check(supportedBuilds, agentBuildToCheck, false);
    }

    private void check(String supportedBuilds, String agentBuildToCheck, boolean expectedResult) {
        //Version string completely ignored in this case and only specific build identifier matters.
        AgentVersion agentVersionInfo = setSupportedBuildsToCheck(supportedBuilds, "", agentBuildToCheck);
        assert expectedResult == agentManager.isAgentVersionSupported(agentVersionInfo).isSupported() : "supportedBuilds="
            + supportedBuilds + "; agentBuildToCheck=" + agentBuildToCheck;
    }
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

    private AgentVersion setSupportedBuildsToCheck(String supportedBuildsRegex, String agentVersionToCheck,
        String agentBuildToCheck) {
        this.supportedBuildsRegex = supportedBuildsRegex;

        return new AgentVersion(agentVersionToCheck, agentBuildToCheck);
    }
View Full Code Here

Examples of org.rhq.core.clientapi.server.core.AgentVersion

        String agentBuildToCheck) {
        this.supportedBuildsRegex = null;
        this.agentLatestBuild = agentLatestBuild;
        this.agentLatestVersion = agentLatestVersion;

        return new AgentVersion(agentVersionToCheck, agentBuildToCheck);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.