Examples of ClientCommandSenderConfiguration


Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

    /**
     * @see AgentPromptCommand#execute(AgentMain, String[])
     */
    public boolean execute(AgentMain agent, String[] args) {
        AgentConfiguration agent_config = agent.getConfiguration();
        ClientCommandSenderConfiguration sender_config = agent_config.getClientCommandSenderConfiguration();

        if (sender_config.commandSpoolFileName == null) {
            agent.getOut().println(MSG.getMsg(AgentI18NResourceKeys.DUMPSPOOL_NO_FILE));
            return true;
        }
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

    }

    static InputStream remoteStream(InputStream stream) {
        RemoteInputStream remoteStream = (RemoteInputStream) stream;
        ServiceContainer serviceContainer = ServerCommunicationsServiceUtil.getService().getServiceContainer();
        ClientCommandSenderConfiguration config = serviceContainer.getClientConfiguration();
        ClientCommandSender sender = serviceContainer.createClientCommandSender(remoteStream.getServerEndpoint(),
            config);
        sender.startSending();
        remoteStream.setClientCommandSender(sender);
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

                    if (remote_uri == null) {
                        remote_uri = "socket://" + agent_address + ":" + agent_port;
                    }
                }

                ClientCommandSenderConfiguration client_config = getSenderConfiguration(agent);
                ClientCommandSender sender = getServiceContainer().createClientCommandSender(remote_uri, client_config);
                agent_client = new AgentClientImpl(agent, sender);

                // add the new cache entry, or replace the dirty cache entry (note that dirty cache entries don't
                // need to be destroyed as the new one is "logically" the same, but with updated auth info.)
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

            // purge the spool file, if it exists
            File spool_file = null;

            try {
                ClientCommandSenderConfiguration sender_config = getSenderConfiguration(agent);
                if (sender_config.commandSpoolFileName != null) {
                    spool_file = new File(sender_config.dataDirectory, sender_config.commandSpoolFileName);
                    if (spool_file.exists()) {
                        // first truncate it, in case Windows is locking it; then try to delete
                        new FileOutputStream(spool_file, false).close();
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

        ClientCommandSender sender = null;
        boolean pinged = false;

        try {
            ServerConfiguration server_config = getConfiguration();
            ClientCommandSenderConfiguration client_config = server_config.getClientCommandSenderConfiguration();

            // prepare this sender to simply send a ping - do not need any advanced features
            client_config.commandSpoolFileName = null;
            client_config.enableQueueThrottling = false;
            client_config.enableSendThrottling = false;
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

     *
     * @return configuration for a {@link ClientCommandSender} that will talk to the given agent
     */
    private ClientCommandSenderConfiguration getSenderConfiguration(Agent agent) {
        ServerConfiguration server_config = getConfiguration();
        ClientCommandSenderConfiguration client_config = server_config.getClientCommandSenderConfiguration();

        // make sure it uses a unique spool file.  Senders cannot share spool files; each remote endpoint
        // must have its own spool file since the spool file contains command requests for a single, specific, agent.
        // (a null spool filename means we will never guarantee message delivery to agents)
        if (client_config.commandSpoolFileName != null) {
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

     * getClientSenderXXX methods and puts all the data in the returned data object.
     *
     * @return the full client sender configuration
     */
    public ClientCommandSenderConfiguration getClientCommandSenderConfiguration() {
        ClientCommandSenderConfiguration config = new ClientCommandSenderConfiguration();

        config.defaultTimeoutMillis = getClientSenderCommandTimeout();
        config.maxConcurrent = getClientSenderMaxConcurrent();
        config.queueSize = getClientSenderQueueSize();
        config.dataDirectory = getDataDirectory();
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

     * getClientSenderXXX methods and puts all the data in the returned data object.
     *
     * @return the full client sender configuration
     */
    public ClientCommandSenderConfiguration getClientCommandSenderConfiguration() {
        ClientCommandSenderConfiguration config = new ClientCommandSenderConfiguration();

        config.defaultTimeoutMillis = getClientSenderCommandTimeout();
        config.maxConcurrent = getClientSenderMaxConcurrent();
        config.queueSize = getClientSenderQueueSize();
        config.dataDirectory = getDataDirectory();
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

     *
     * @throws Exception if the configured server locator URI in malformed
     */
    private ClientCommandSender createClientCommandSender() throws Exception {
        RemoteCommunicator remote_comm = createServerRemoteCommunicator(null, true, true);
        ClientCommandSenderConfiguration config = m_configuration.getClientCommandSenderConfiguration();

        ClientCommandSender client_sender = new ClientCommandSender(remote_comm, config, m_previouslyQueueCommands);

        for (CommandPreprocessor preproc : client_sender.getCommandPreprocessors()) {
            if (preproc instanceof SecurityTokenCommandPreprocessor) {
View Full Code Here

Examples of org.rhq.enterprise.communications.command.client.ClientCommandSenderConfiguration

        prefs1.put(ServiceContainerConfigurationConstants.MBEANSERVER_NAME, "commstreamtest1");
        prefs1.put(ServiceContainerConfigurationConstants.CMDSERVICE_DIRECTORY_DYNAMIC_DISCOVERY, "false");

        serviceContainer1 = new ServiceContainer();
        try {
            serviceContainer1.start(prefs1, new ClientCommandSenderConfiguration());
        } catch (Exception e) {
            throw new Exception("Failed to bind server socket to 127.0.0.1:" + CommTestConstants.CONNECTOR_BIND_PORT, e);
        }

        // setup the server #2
        Preferences prefs2 = getPrefs1();
        prefs2.put(ServiceContainerConfigurationConstants.CONNECTOR_TRANSPORT, "socket");
        prefs2.put(ServiceContainerConfigurationConstants.CONNECTOR_BIND_ADDRESS, "127.0.0.1");
        prefs2.put(ServiceContainerConfigurationConstants.CONNECTOR_BIND_PORT, CommTestConstants.CONNECTOR2_BIND_PORT);
        prefs2.put(ServiceContainerConfigurationConstants.CONFIG_SCHEMA_VERSION, ""
            + ServiceContainerConfigurationConstants.CURRENT_CONFIG_SCHEMA_VERSION);
        prefs2.put(ServiceContainerConfigurationConstants.DATA_DIRECTORY, "target/data2");
        prefs2.put(ServiceContainerConfigurationConstants.MBEANSERVER_NAME, "commstreamtest2");
        prefs2.put(ServiceContainerConfigurationConstants.CMDSERVICE_DIRECTORY_DYNAMIC_DISCOVERY, "false");

        serviceContainer2 = new ServiceContainer();
        try {
            serviceContainer2.start(prefs2, new ClientCommandSenderConfiguration());
        } catch (BindException e) {
            throw new Exception("Failed to bind server socket to 127.0.0.1:" + CommTestConstants.CONNECTOR2_BIND_PORT, e);
        }

        Thread.sleep(5000);

        // install our streaming pojo in our server #2
        pojoImpl = new CommTestStreamPojo(this);
        serviceContainer2.addRemotePojo(pojoImpl, ICommTestStreamPojo.class);

        // setup the client to server #2
        RemoteCommunicator comm = new JBossRemotingRemoteCommunicator("socket://127.0.0.1:" +
            CommTestConstants.CONNECTOR2_BIND_PORT + "/?force_remote=true");
        ClientCommandSenderConfiguration config = new ClientCommandSenderConfiguration();
        config.maxConcurrent = Integer.MAX_VALUE; // let the sender send as fast as it can
        config.defaultTimeoutMillis = 60000L;
        config.commandSpoolFileName = null;
        config.enableQueueThrottling = false;
        config.enableSendThrottling = false;
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.