Examples of CommandRequest


Examples of com.cisco.telnet.server.domain.request.CommandRequest

    return CONNECTION_TIMEOUT_MESSAGE + connectionIdleTimeoutInMs / 1000 + " seconds";
  }

  private String executeCommand(String command, TelnetCommand telnetCommand) {
    String response;
    CommandRequest commandRequest = new StringCommandRequest(command);
    CommandResponse commandResponse = telnetCommand.execute(commandRequest, sessionContext);
    response = commandResponse.getResultAsString();
    return response;
  }
View Full Code Here

Examples of mungbean.protocol.message.CommandRequest

    public boolean isMaster() {
        try {
            return execute(new DBConversation<Boolean>() {
                @Override
                public Boolean execute(Connection connection) {
                    CommandResponse response = connection.execute(new CommandRequest("$cmd", "ismaster"));
                    Object value = response.get("ismaster");
                    return value.equals(1L) || Boolean.TRUE.equals(value);
                }
            });
        } catch (RuntimeIOException e) {
View Full Code Here

Examples of mungbean.protocol.message.CommandRequest

    @Override
    protected boolean isValid(Connection connection) {
        if (settings.validateConnections()) {
            try {
                connection.execute(new CommandRequest("ismaster"));
            } catch (RuntimeIOException e) {
                return false;
            }
        }
        return true;
View Full Code Here

Examples of mungbean.protocol.message.CommandRequest

    public String password() {
        return password;
    }

    public void authenticate(DBConnection connection) {
        final String nonce = (String) connection.execute(new CommandRequest(database(), "getnonce")).get("nonce");
        LinkedHashMap<String, Object> authenticationParameters = authenticationRequest(nonce);
        CommandResponse value = connection.execute(new CommandRequest(database(), authenticationParameters, CommandRequest.DEFAULT_CODERS));
        if (!value.get("ok").equals(1D)) {
            throw new MongoException("Authentication failed for database " + database(), value);
        }
    }
View Full Code Here

Examples of mungbean.protocol.message.CommandRequest

            }
        });
    }

    private <ResponseType> ResponseType executeCommand(AbstractCommand<ResponseType> command, Connection connection) {
        CommandResponse response = connection.execute(new CommandRequest(dbName, command.requestMap(AbstractDBCollection.this), queryCoders));
        if (response == null) {
            throw new NotFoundException("Value not returned for command: " + command);
        }
        Object result = response.get("ok");
        if (!result.equals(1D) && !result.equals(Boolean.TRUE)) {
View Full Code Here

Examples of net.rim.device.api.command.registrar.CommandRequest

                null, null);

        // Execute a command retrieved from RemoteCommandRegistrarConnection
        final CommandRegistrarConnection connection =
                new RemoteCommandRegistrarConnection();
        final CommandRequest request =
                new CommandRequest("CommandFrameworkDemoRemoteAppCommand");
        final Command command = connection.getCommand(request);

        // The Command reference may be null if the
        // CommandFrameworkDemoRemoteApp
        // project has not been loaded.
View Full Code Here

Examples of net.rim.device.api.command.registrar.CommandRequest

     * @return A Command object if one is found for the given criteria,
     *         otherwise null
     */
    private Command queryCommand(final String[] commandCategories,
            final String[] contextCategories, final Object context) {
        final CommandRequest request = new CommandRequest();

        CategoryCollection categoryCollection =
                new CategoryCollection(commandCategories);
        if (categoryCollection != null) {
            request.setCommandCategories(categoryCollection);
        }

        categoryCollection = new CategoryCollection(contextCategories);
        if (categoryCollection != null) {
            request.setContextCategories(categoryCollection);
        }

        final LocalCommandRegistrarConnection connection =
                new LocalCommandRegistrarConnection();
        final Command command = connection.getCommand(request);
View Full Code Here

Examples of net.rim.device.api.command.registrar.CommandRequest

                new LocalCommandRegistrarConnection();

        // Add a MenuItem for the PopupDialogCommand to the menu
        final MenuItem menuItem =
                new MenuItem(new StringProvider("Popup Dialog"), 0x230010, 0);
        menuItem.setCommand(connection.getCommand(new CommandRequest(
                "PopupDialogCommand")));
        menu.add(menuItem);

        super.makeMenu(menu, context);
    }
View Full Code Here

Examples of net.rim.device.api.command.registrar.CommandRequest

            Vector items = null;

            if (field == _contentHandlerMenuLabel) {
                final CommandRegistrarConnection connection =
                        new RemoteCommandRegistrarConnection();
                final CommandRequest request =
                        new CommandRequest("ContentHandlerCommand");
                final Command command = connection.getCommand(request);
                items = new Vector();
                items.addElement(new CommandItem(
                        new StringProvider("Open with"), null, command));
            }
View Full Code Here

Examples of org.apache.geronimo.datastore.impl.remote.messaging.CommandRequest

        // One does not send the actual ReplicantCapable in the case of an
        // update. Instead, one sends only its identifier.
        ReplicationCapable target = (ReplicationCapable) anEvent.getTarget();
        anEvent.setTarget(target.getID());
        sender.sendSyncRequest(
            new CommandRequest("mergeWithUpdate", new Object[] {anEvent}),
            requestOut, targetNodes);
    }
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.