Package org.apache.ace.agent

Examples of org.apache.ace.agent.IdentificationHandler


        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        reset(configurationHandler);
        expect(configurationHandler.get(eq(AgentConstants.CONFIG_IDENTIFICATION_AGENTID), anyObject(String.class)))
            .andReturn("qqq").once();
        replay(configurationHandler);
        IdentificationHandler identificationHandler = m_agentContext.getHandler(IdentificationHandler.class);
        assertEquals(identificationHandler.getAgentId(), "qqq");
    }
View Full Code Here


        expect(configurationHandler.get(eq(AgentConstants.CONFIG_IDENTIFICATION_AGENTID), anyObject(String.class)))
            .andReturn("qqq").once();
        expect(configurationHandler.get(eq(AgentConstants.CONFIG_IDENTIFICATION_AGENTID), anyObject(String.class)))
            .andReturn("yyy").once();
        replay(configurationHandler);
        IdentificationHandler identificationHandler = m_agentContext.getHandler(IdentificationHandler.class);
        assertEquals(identificationHandler.getAgentId(), "qqq");
        assertEquals(identificationHandler.getAgentId(), "yyy");
    }
View Full Code Here

        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        reset(configurationHandler);
        expect(configurationHandler.get(eq(AgentConstants.CONFIG_IDENTIFICATION_AGENTID), anyObject(String.class)))
            .andReturn(null).once();
        replay(configurationHandler);
        IdentificationHandler identificationHandler = m_agentContext.getHandler(IdentificationHandler.class);
        assertNull(identificationHandler.getAgentId());
    }
View Full Code Here

        ConfigurationHandler configurationHandler = m_agentContext.getHandler(ConfigurationHandler.class);
        reset(configurationHandler);
        expect(configurationHandler.get(eq(AgentConstants.CONFIG_IDENTIFICATION_AGENTID), anyObject(String.class)))
            .andReturn(null).once();
        replay(configurationHandler);
        IdentificationHandler identificationHandler = m_agentContext.getHandler(IdentificationHandler.class);
        assertNull(identificationHandler.getAgentId());
    }
View Full Code Here

        DeploymentPackage deploymentPackage3 = addTestMock(DeploymentPackage.class);
        expect(deploymentPackage3.getName()).andReturn(identification).anyTimes();
        expect(deploymentPackage3.getVersion()).andReturn(Version.parseVersion("3.0.0")).anyTimes();

        IdentificationHandler identificationHandler = addTestMock(IdentificationHandler.class);
        expect(identificationHandler.getAgentId()).andReturn(identification).anyTimes();

        DiscoveryHandler discoveryHandler = addTestMock(DiscoveryHandler.class);
        expect(discoveryHandler.getServerUrl()).andReturn(serverURL).anyTimes();

        ConfigurationHandler configurationHandler = addTestMock(ConfigurationHandler.class);
View Full Code Here

        m_webServer.start();

        DiscoveryHandler discoveryHandler = addTestMock(DiscoveryHandler.class);
        expect(discoveryHandler.getServerUrl()).andReturn(serverURL).anyTimes();

        IdentificationHandler identificationHandler = addTestMock(IdentificationHandler.class);
        expect(identificationHandler.getAgentId()).andReturn("identification").anyTimes();

        replayTestMocks();
        m_agentContext.setHandler(DiscoveryHandler.class, discoveryHandler);
        m_agentContext.setHandler(IdentificationHandler.class, identificationHandler);
        m_agentContext.setHandler(ConnectionHandler.class, new ConnectionHandlerImpl());
View Full Code Here

    protected void doTearDown() throws Exception {
        resetAgentBundleState();
    }

    private ServiceRegistration registerIdentification(final String id, final int rank) {
        return m_bundleContext.registerService(IdentificationHandler.class.getName(), new IdentificationHandler() {
            @Override
            public String getAgentId() {
                return id;
            }
View Full Code Here

        m_agentContext.setHandler(DownloadHandler.class, new DownloadHandlerImpl(bundleDataArea));
        m_agentContext.setHandler(DeploymentHandler.class, new DeploymentHandlerImpl(context, m_packageAdmin));
        m_agentContext.setHandler(AgentUpdateHandler.class, new AgentUpdateHandlerImpl(context));
        m_agentContext.setHandler(FeedbackHandler.class, new FeedbackHandlerImpl());

        IdentificationHandler identificationHandler = (m_identificationHandler != null) ? m_identificationHandler : new IdentificationHandlerImpl();
        m_agentContext.setHandler(IdentificationHandler.class, identificationHandler);

        DiscoveryHandler discoveryHandler = (m_discoveryHandler != null) ? m_discoveryHandler : new DiscoveryHandlerImpl();
        m_agentContext.setHandler(DiscoveryHandler.class, discoveryHandler);
View Full Code Here

    private String getStoreName(long storeId, int fileNo) {
        return String.format("%s%d", getBaseStoreName(storeId), fileNo);
    }

    private String getTargetID() {
        IdentificationHandler idHandler = m_agentContext.getHandler(IdentificationHandler.class);
        return idHandler.getAgentId();
    }
View Full Code Here

TOP

Related Classes of org.apache.ace.agent.IdentificationHandler

Copyright © 2018 www.massapicom. 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.