<commit_before>/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*/

/*
 * ***************************************************************
 * The LEAP libraries, when combined with certain JADE platform components,
 * provide a run-time environment for enabling FIPA agents to execute on
 * lightweight devices running Java. LEAP and JADE teams have jointly
 * designed the API for ease of integration and hence to take advantage
 * of these dual developments and extensions so that users only see
 * one development platform and a
 * single homogeneous set of APIs. Enabling deployment to a wide range of
 * devices whilst still having access to the full development
 * environment and functionalities that JADE provides.
 * Copyright (C) 2001 Siemens AG.
 * 
 * GNU Lesser General Public License
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation,
 * version 2.1 of the License.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 * **************************************************************
 */

package jade.imtp.leap;

import jade.core.*;
import jade.util.leap.List;
import jade.util.leap.ArrayList;
import jade.util.leap.Iterator;
import java.io.IOException;
import java.io.DataOutputStream;
import java.io.ByteArrayOutputStream;

/**
 * The <code>Command</code> object is used to represent a platform command.
 * @author <NAME>
 * @author <NAME>
 * @author <NAME> - FRAMeTech s.r.l.
 */
public class Command {


  /**
   * Unspecified object id
   */
  static final int        DUMMY_ID = -1;

  /**
   * Command identifier code for response command.
   */

    // Lower limit for service and node management related commands
    static final int SERVICE_BASE = 0;

    // Service and node management related command IDs
    public static final int GET_PLATFORM_NAME = 1;
    public static final int ADD_NODE = 2;
    public static final int REMOVE_NODE = 3;
    public static final int ACTIVATE_SERVICE = 4;
    public static final int DEACTIVATE_SERVICE = 5;
    public static final int FIND_SLICE_NODE = 6;
    public static final int FIND_ALL_NODES = 7;
    public static final int ACCEPT_COMMAND = 8;
    public static final int PING_NODE_BLOCKING = 9;
    public static final int PING_NODE_NONBLOCKING = 10;
    public static final int EXIT_NODE = 11;
    public static final int INTERRUPT_NODE = 12;





  static final int        NO_OPERATION = 0;
  static final int        OK = 1;
  static final int        ERROR = 2;
    //  static final int        GET_PLATFORM_NAME = 3;
  static final int        ADD_CONTAINER = 4;
  static final int        REMOVE_CONTAINER = 5;
  static final int        LOOKUP = 6;
  static final int        BORN_AGENT = 7;
  static final int        DEAD_AGENT = 8;
  static final int        NEW_MTP = 9;
  static final int        DEAD_MTP = 10;
  static final int        TRANSFER_IDENTITY = 11;
  static final int        GET_PROXY = 12;
  static final int        CREATE_AGENT_FROM_NAME = 13;
  static final int        CREATE_AGENT_FROM_DATA = 14;
  static final int        FETCH_CLASS_FILE = 15;
  static final int        SUSPEND_AGENT = 16;
  static final int        RESUME_AGENT = 17;
  static final int        WAIT_AGENT = 18;
  static final int        WAKE_AGENT = 19;
  static final int        MOVE_AGENT = 20;
  static final int        COPY_AGENT = 21;
  static final int        KILL_AGENT = 22;
  static final int        EXIT = 23;
  static final int        POST_TRANSFER_RESULT = 24;
  static final int        DISPATCH = 25;
  public static final int PING = 26;             // see 38, blocking ping!
  static final int        INSTALL_MTP = 27;
  static final int        UNINSTALL_MTP = 28;
  static final int        UPDATE_ROUTING_TABLE = 29;
  static final int        ROUTE_OUT = 30;
  static final int        ENABLE_SNIFFER = 31;
  static final int        DISABLE_SNIFFER = 32;
  static final int        ENABLE_DEBUGGER = 33;
  static final int        DISABLE_DEBUGGER = 34;
  static final int        SUSPENDED_AGENT = 35;
  static final int        RESUMED_AGENT = 36;
  static final int        FORWARD = 37;
  public static final int BLOCKING_PING = 38;    // make public for getCommandType()
  static final int        CHANGED_AGENT_PRINCIPAL = 39;
  static final int        SIGN = 40;
  static final int        CHANGE_AGENT_PRINCIPAL = 41;
  static final int        CHANGE_CONTAINER_PRINCIPAL = 42;
  static final int        GET_PUBLIC_KEY = 43;
  static final int        GET_AGENT_PRINCIPAL = 44;


  /**
   * Code defining the type of command.
   */
  private int             commandCode;

  /**
   * Identifier of the remote object this Command is directed to.
   */
  private int             objectID;

  /**
   * This list represents the argument list of this platform command.
   */
  private List            commandParameters;

  /**
   * Construct a default NO_OPERATION command.<commit_msg>Added new constants for commands. Commented out obsoleted ones.<commit_after>/*--- formatted by Jindent 2.1, (www.c-lab.de/~jindent) ---*/

/*
 * ***************************************************************
 * The LEAP libraries, when combined with certain JADE platform components,
 * provide a run-time environment for enabling FIPA agents to execute on
 * lightweight devices running Java. LEAP and JADE teams have jointly
 * designed the API for ease of integration and hence to take advantage
 * of these dual developments and extensions so that users only see
 * one development platform and a
 * single homogeneous set of APIs. Enabling deployment to a wide range of
 * devices whilst still having access to the full development
 * environment and functionalities that JADE provides.
 * Copyright (C) 2001 Siemens AG.
 * 
 * GNU Lesser General Public License
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation,
 * version 2.1 of the License.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 * **************************************************************
 */

package jade.imtp.leap;

import jade.core.*;
import jade.util.leap.List;
import jade.util.leap.ArrayList;
import jade.util.leap.Iterator;
import java.io.IOException;
import java.io.DataOutputStream;
import java.io.ByteArrayOutputStream;

/**
 * The <code>Command</code> object is used to represent a platform command.
 * @author <NAME>
 * @author <NAME>
 * @author <NAME> - FRAMeTech s.r.l.
 */
public class Command {


  /**
   * Unspecified object id
   */
  static final int        DUMMY_ID = -1;

  /**
   * Command identifier code for response command.
   */

    // Lower limit for service and node management related commands
    static final int SERVICE_BASE = 0;

    // Service and node management related command IDs
    public static final int GET_PLATFORM_NAME = 1;
    public static final int ADD_NODE = 2;
    public static final int REMOVE_NODE = 3;
    public static final int ACTIVATE_SERVICE = 4;
    public static final int DEACTIVATE_SERVICE = 5;
    public static final int FIND_SLICE_NODE = 6;
    public static final int FIND_ALL_NODES = 7;
    public static final int ACCEPT_COMMAND = 8;
    public static final int PING_NODE_BLOCKING = 9;
    public static final int PING_NODE_NONBLOCKING = 10;
    public static final int EXIT_NODE = 11;
    public static final int INTERRUPT_NODE = 12;
    public static final int SERVICE_MANAGER_PING = 13;
    public static final int SERVICE_MANAGER_ADD_REPLICA = 14;
    public static final int SERVICE_MANAGER_UPDATE_COUNTERS = 15;


  static final int        NO_OPERATION = 0;
  static final int        OK = 1;
  static final int        ERROR = 2;
  static final int        FORWARD = 37;

    /******************************************
    //  static final int        GET_PLATFORM_NAME = 3;
  static final int        ADD_CONTAINER = 4;
  static final int        REMOVE_CONTAINER = 5;
  static final int        LOOKUP = 6;
  static final int        BORN_AGENT = 7;
  static final int        DEAD_AGENT = 8;
  static final int        NEW_MTP = 9;
  static final int        DEAD_MTP = 10;
  static final int        TRANSFER_IDENTITY = 11;
  static final int        GET_PROXY = 12;
  static final int        CREATE_AGENT_FROM_NAME = 13;
  static final int        CREATE_AGENT_FROM_DATA = 14;
  static final int        FETCH_CLASS_FILE = 15;
  static final int        SUSPEND_AGENT = 16;
  static final int        RESUME_AGENT = 17;
  static final int        WAIT_AGENT = 18;
  static final int        WAKE_AGENT = 19;
  static final int        MOVE_AGENT = 20;
  static final int        COPY_AGENT = 21;
  static final int        KILL_AGENT = 22;
  static final int        EXIT = 23;
  static final int        POST_TRANSFER_RESULT = 24;
  static final int        DISPATCH = 25;
  public static final int PING = 26;             // see 38, blocking ping!
  static final int        INSTALL_MTP = 27;
  static final int        UNINSTALL_MTP = 28;
  static final int        UPDATE_ROUTING_TABLE = 29;
  static final int        ROUTE_OUT = 30;
  static final int        ENABLE_SNIFFER = 31;
  static final int        DISABLE_SNIFFER = 32;
  static final int        ENABLE_DEBUGGER = 33;
  static final int        DISABLE_DEBUGGER = 34;
  static final int        SUSPENDED_AGENT = 35;
  static final int        RESUMED_AGENT = 36;
  static final int        FORWARD = 37;
  public static final int BLOCKING_PING = 38;    // make public for getCommandType()
  static final int        CHANGED_AGENT_PRINCIPAL = 39;
  static final int        SIGN = 40;
  static final int        CHANGE_AGENT_PRINCIPAL = 41;
  static final int        CHANGE_CONTAINER_PRINCIPAL = 42;
  static final int        GET_PUBLIC_KEY = 43;
  static final int        GET_AGENT_PRINCIPAL = 44;
    ************************************************************************/

  /**
   * Code defining the type of command.
   */
  private int             commandCode;

  /**
   * Identifier of the remote object this Command is directed to.
   */
  private int             objectID;

  /**
   * This list represents the argument list of this platform command.
   */
  private List            commandParameters;

  /**
   * Construct a default NO_OPERATION command.
{'fraction_non_alphanumeric': 0.08956815354540608, 'fraction_numerical': 0.02221432379598365, 'mean_word_length': 2.7692565304755528, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3501774', 'n_tokens_mistral': 3478, 'n_tokens_neox': 3113, 'n_words': 1288}