Examples of AgentConfig


Examples of com.almende.eve.agent.AgentConfig

      final ClassLoader cl) {
    final Config config = YamlReader.load(is).expand();
   
    final ArrayNode agents = (ArrayNode) config.get("agents");
    for (final JsonNode agent : agents) {
      final AgentConfig agentConfig = new AgentConfig((ObjectNode) agent);
      final Agent newAgent = new AgentBuilder().withWakeService(ws)
          .withClassLoader(cl).with(agentConfig).build();
      LOG.info("Created agent:" + newAgent.getId());
    }
  }
View Full Code Here

Examples of com.day.cq.replication.AgentConfig

    @Test
    public void testGetFlushAgents() throws Exception {
        final Agent agent1 = mock(Agent.class);
        final Agent agent2 = mock(Agent.class);

        final AgentConfig agentConfig1 = mock(AgentConfig.class);
        final AgentConfig agentConfig2 = mock(AgentConfig.class);

        @SuppressWarnings("unchecked")
        final Map<String, Agent> agents = mock(Map.class);
        final Collection<Agent> agentValues = Arrays.asList(new Agent[]{ agent1, agent2 });

        when(agentManager.getAgents()).thenReturn(agents);

        when(agents.values()).thenReturn(agentValues);

        when(agent1.getId()).thenReturn("Agent 1");
        when(agent1.isEnabled()).thenReturn(true);
        when(agent1.getConfiguration()).thenReturn(agentConfig1);

        when(agent2.getId()).thenReturn("Agent 2");
        when(agent2.isEnabled()).thenReturn(true);
        when(agent2.getConfiguration()).thenReturn(agentConfig2);

        when(agentConfig1.getSerializationType()).thenReturn("flush");
        when(agentConfig2.getSerializationType()).thenReturn("notflush");

        when(agentConfig1.getTransportURI()).thenReturn("http://localhost/dispatcher/invalidate.cache");
        when(agentConfig2.getTransportURI()).thenReturn("ftp://localhost/dispatcher/invalidate.cache");

        Map<String, Object> tmp = new HashMap<String, Object>();
        tmp.put(AgentConfig.PROTOCOL_HTTP_HEADERS, new String[] {"CQ-Action:{action}", "CQ-Handle:{path}",
                "CQ-Path: {path}"});

        when(agentConfig1.getProperties()).thenReturn(new ValueMapDecorator(tmp));
        when(agentConfig2.getProperties()).thenReturn(new ValueMapDecorator(tmp));


        final Agent[] actual = dispatcherFlusher.getFlushAgents();

        assertEquals(1, actual.length);
View Full Code Here

Examples of com.day.cq.replication.AgentConfig

        continue;
      }
      if (!agent.isValid()) {
        continue;
      }
      AgentConfig agentConfig = agent.getConfiguration();
      if (!filter.matches(agentConfig)) {
        continue;
      }
      String transportUri = agentConfig.getTransportURI();
      if (StringUtils.isNotBlank(transportUri)) {
        URI uri = new URI(transportUri);
        if (!StringUtils.startsWith(uri.getScheme(), "http")) {
          continue;
        }
View Full Code Here

Examples of com.jitlogic.zorka.core.AgentConfig

        String home = System.getProperties().getProperty("zorka.home.dir", args);

        boolean retransformSupported = supportsRetransform(instrumentation);

        AgentConfig config = new AgentConfig(ZorkaUtil.path(home));
        instance = new AgentInstance(config, instantiateRetransformer(instrumentation, config,
                "com.jitlogic.zorka.core.spy." + (retransformSupported ? "RealSpyRetransformer" : "DummySpyRetransformer")));

        instance.start();
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

                CLILogger.getInstance().printDetailMessage(_strMgr.getString("DomainPasswordChanged",
                    new Object[] {domainName}));
                //END WARNING!!!
            } else {
                agentName = getAgentName();           
                AgentConfig config = new AgentConfig(agentName,
                    getAgentPath());          
                AgentManager manager = getAgentManager(config);
                //Ensure that the node agent exists
                manager.validateNodeAgent(config, true);
                masterPassword = getMasterPassword(manager, config);

                config.put(AgentConfig.K_MASTER_PASSWORD, masterPassword);
                manager.validateMasterPassword(config, true);

                //getPassword(optionName, allowedOnCommandLine, readPrefsFile, readPasswordOptionFromPrefs,
                //readMasterPasswordFile, mgr, config,
                //promptUser, confirm, validate)
                newMasterPassword = getNewMasterPassword();
                Boolean saveMasterPassword = getSaveMasterPassword(null);               
                config.put(AgentConfig.K_NEW_MASTER_PASSWORD, newMasterPassword);
                config.put(AgentConfig.K_SAVE_MASTER_PASSWORD, saveMasterPassword);
                manager.changeMasterPassword(config);    
                CLILogger.getInstance().printDetailMessage(_strMgr.getString("NodeAgentPasswordChanged",
                    new Object[] {agentName}));
            }
        } catch (Exception e) {
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

  validateOptions();

        try {
            final String agentName = (String)operands.firstElement();                      

            AgentConfig agentConfig = new AgentConfig(agentName, getAgentPath());
            AgentManager manager = getAgentManager(agentConfig);
            manager.deleteNodeAgent();
          
            CLILogger.getInstance().printDetailMessage(getLocalizedString(
                                                       "CommandSuccessful",
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

    }     
 
    protected String[] getAgents() throws CommandException
    {
       try {                           
            AgentConfig agentConfig = new AgentConfig(null, getAgentPath());
            AgentManager manager = getAgentManager(agentConfig);
            return manager.listNodeAgents();
       } catch (Exception ex) {
           throw new CommandException(ex);
       }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

            }

            // log agentname for debug
            CLILogger.getInstance().printDebugMessage("agentName = " + agentName);
           
            AgentConfig agentConfig = new AgentConfig(agentName,
                getAgentPath());
            AgentManager manager = getAgentManager(agentConfig);             
            manager.validateNodeAgent(agentConfig, false);
        } catch (Exception e) {
            if (e.getLocalizedMessage() != null)
                CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());

            throw new CommandException(getLocalizedString(
                "CommandUnSuccessful", new Object[] {name} ), e);
        }
       
        try {                      
            Properties agentProperties = getAgentProperties(getOption(AGENT_PROPERTIES));
            final String adminUser = getUser();
            final String adminPassword = getPassword();
           
                //need to call setOption before calling getMasterPassword() since
                //getMasterPassword() needs to get ADMIN_PASSWORD first.
            setOption(ADMIN_PASSWORD, adminPassword);
           
            boolean saveMasterPasswordSpecified = getBooleanOption(SAVE_MASTER_PASSWORD);
            String masterPassword = null;
            if (saveMasterPasswordSpecified)
            {
               masterPassword = getMasterPasswordWithDefaultPrompt(null, null);
            }
           
            final String adminPort = String.valueOf(getPort());
            final String adminHost = getHost();
           
            Boolean saveMasterPassword = getSaveMasterPassword(masterPassword)
           
            //The --secure option is a synonymn for --agentproperties agent.das.isSecure=false           
            if (!getBooleanOption(SECURE)) {               
                agentProperties.setProperty(AgentConfig.AGENT_DAS_IS_SECURE, "false");
            }                      

            //System.out.println("adminPassword=" + adminPassword + " masterPassword=" + masterPassword +
            //    " saveMasterPassword=" + saveMasterPassword);           
           
            if (adminHost == null || adminPort == null || adminUser == null || adminPassword == null) {
                throw new CommandValidationException(_strMgr.getString("InvalidDASConfiguration"));
            }
       
            // defaulted protocol and clientHostName until moved to cli if deemed appropriate ???
            // temporary fix to remove agent user & password, for now map them to das user & password???
            AgentConfig agentConfig = new AgentConfig(agentName, getAgentPath(), adminUser,
                adminPassword, new Integer(getAdminPort()),
                adminHost, adminPort, adminUser, adminPassword,
                masterPassword,
                saveMasterPassword, agentProperties);                                               
           
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

    protected void validateNodeAgent(File typeDir) throws CommandException
    {
        String nodeAgentName = typeDir.getName();
        String nodeAgentRoot = typeDir.getParent();
        try {
            AgentConfig ac = new AgentConfig(nodeAgentName, nodeAgentRoot);
            AgentManager agentManager = new AgentManager(ac);
            agentManager.validateNodeAgent(ac, true);
        }catch (AgentException ae){
            throw new CommandException(ae);
        }
View Full Code Here

Examples of com.sun.enterprise.ee.admin.servermgmt.AgentConfig

      validateOptions();

        try {
            final String agentName = getAgentName();
            String stopInstancesOverride=getOption(STOP_INSTANCES_OVERRIDE);
            AgentConfig agentConfig = new AgentConfig(agentName,
                getAgentPath());
            AgentManager manager = getAgentManager(agentConfig);
                //validate node-agent to make sure it exists
            manager.validateNodeAgent(agentConfig, true);
            if (isNotRunning(manager,agentConfig)) {
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.