/** * Returns a command that represents an instance of a command in a remote * host. It is used to execute remote commands. The concept is similar to * RMI. Every invocation on this command is equivalent to an invocation in * the remote command. * * @param jid the full JID of the host of the remote command * @param node the identifier of the command * @return a local instance equivalent to the remote command. */ public RemoteCommand getRemoteCommand(Jid jid, String node) { return new RemoteCommand(connection(), node, jid); }
@Override public void complete(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { executeAction(Action.complete, form); }
/** * Creates a new RemoteCommand that uses an specific connection to execute a * command identified by <code>node</code> in the host identified by * <code>jid</code> * * @param connection the connection to use for the execution. * @param node the identifier of the command. * @param jid the JID of the host. */ protected RemoteCommand(XMPPConnection connection, String node, Jid jid) { super(); this.connection = connection; this.jid = jid; this.setNode(node); }
data.setTo(getOwnerJID()); data.setNode(getNode()); data.setSessionID(sessionID); data.setAction(action);
private static final String URL = "http://maps.googleapis.com/maps/api/geocode/xml"; public static RemoteCommand getLocation(String theAddress){ RemoteCommand result = new RemoteCommand(); result.setType(Type.GET); result.setUrl(URL); result.addGetParam("address", theAddress); result.addGetParam("sensor", "false"); result.addGetParam("language", "en"); // See description about GeocoderXMLHandler result.setXmlHandler(new GeocoderXMLHandler()); return result; }
data.setTo(getOwnerJID()); data.setNode(getNode()); data.setSessionID(sessionID); data.setAction(action);
@Override public void execute() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { executeAction(Action.execute); }
data.setTo(getOwnerJID()); data.setNode(getNode()); data.setSessionID(sessionID); data.setAction(action);
/** * Returns a command that represents an instance of a command in a remote * host. It is used to execute remote commands. The concept is similar to * RMI. Every invocation on this command is equivalent to an invocation in * the remote command. * * @param jid the full JID of the host of the remote command * @param node the identifier of the command * @return a local instance equivalent to the remote command. */ public RemoteCommand getRemoteCommand(String jid, String node) { return new RemoteCommand(connection, node, jid); }
/** * Creates a new RemoteCommand that uses an specific connection to execute a * command identified by <code>node</code> in the host identified by * <code>jid</code> * * @param connection the connection to use for the execution. * @param node the identifier of the command. * @param jid the JID of the host. */ protected RemoteCommand(Connection connection, String node, String jid) { super(); this.connection = connection; this.jid = jid; this.setNode(node); this.packetReplyTimeout = SmackConfiguration.getPacketReplyTimeout(); }
@Override public void prev() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { executeAction(Action.prev); }
data.setTo(getOwnerJID()); data.setNode(getNode()); data.setSessionID(sessionID); data.setAction(action);
/** * Returns a command that represents an instance of a command in a remote * host. It is used to execute remote commands. The concept is similar to * RMI. Every invocation on this command is equivalent to an invocation in * the remote command. * * @param jid the full JID of the host of the remote command * @param node the identifier of the command * @return a local instance equivalent to the remote command. */ public RemoteCommand getRemoteCommand(String jid, String node) { return new RemoteCommand(connection, node, jid); }
/** * Creates a new RemoteCommand that uses an specific connection to execute a * command identified by <code>node</code> in the host identified by * <code>jid</code> * * @param connection the connection to use for the execution. * @param node the identifier of the command. * @param jid the JID of the host. */ protected RemoteCommand(Connection connection, String node, String jid) { super(); this.connection = connection; this.jid = jid; this.setNode(node); this.packetReplyTimeout = SmackConfiguration.getPacketReplyTimeout(); }
@Override public void next(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { executeAction(Action.next, form); }
/** * Returns a command that represents an instance of a command in a remote * host. It is used to execute remote commands. The concept is similar to * RMI. Every invocation on this command is equivalent to an invocation in * the remote command. * * @param jid the full JID of the host of the remote command * @param node the identifier of the command * @return a local instance equivalent to the remote command. */ public RemoteCommand getRemoteCommand(String jid, String node) { return new RemoteCommand(connection, node, jid); }
/** * Creates a new RemoteCommand that uses an specific connection to execute a * command identified by <code>node</code> in the host identified by * <code>jid</code> * * @param connection the connection to use for the execution. * @param node the identifier of the command. * @param jid the JID of the host. */ protected RemoteCommand(Connection connection, String node, String jid) { super(); this.connection = connection; this.jid = jid; this.setNode(node); this.packetReplyTimeout = SmackConfiguration.getPacketReplyTimeout(); }
private void executeAction(Action action) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { executeAction(action, null); }
@Override public void cancel() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { executeAction(Action.cancel); }
/** * Executes the default action of the command with the information provided * in the Form. This form must be the answer form of the previous stage. If * there is a problem executing the command it throws an XMPPException. * * @param form the form answer of the previous stage. * @throws XMPPErrorException if an error occurs. * @throws NoResponseException if there was no response from the server. * @throws NotConnectedException * @throws InterruptedException */ public void execute(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException { executeAction(Action.execute, form); }