Package jade.util.leap

Examples of jade.util.leap.Properties


  /**
   * Create a Profile object initialized with the settings specified
   * in a given property file
   */
  public ProfileImpl(String fileName) throws ProfileException {
    props = new Properties();
    if (fileName != null) {
      try {
        props.load(fileName);
      }
      catch (IOException ioe) {
View Full Code Here


    }
  }
 
  public static final Properties parseCreateMediatorRequest(String s) throws ICPException {
    StringTokenizer st = new StringTokenizer(s, "=#");
    Properties p = new Properties();
    while (st.hasMoreTokens()) {
      String key = st.nextToken();
      if (!st.hasMoreTokens()) {
        throw new ICPException("Wrong initialization properties format.");
      }
      p.setProperty(key, st.nextToken());
    }
    return p;
  }
View Full Code Here

   * This is automatically added by the StringACLCodec.
   * @param key the property key.
   * @param value the property value
   */
  public void addUserDefinedParameter(String key, String value) {
    userDefProps = (userDefProps == null ? new Properties() : userDefProps);
    userDefProps.setProperty(key,value);
  }
View Full Code Here

 
  /**
   * Return all user defined parameters of this ACLMessage in form of a Properties object
   **/
  public Properties getAllUserDefinedParameters() {
    userDefProps = (userDefProps == null ? new Properties() : userDefProps);
    return userDefProps;
  }
View Full Code Here

    String protocol = msg.getProtocol();
    String conversationId = msg.getConversationId();
    String inReplyTo = msg.getInReplyTo();
    String replyWith = msg.getReplyWith();
    Date replyBy = msg.getReplyByDate();
    Properties props = msg.getAllUserDefinedParameters();
    if (props.size() > 63) {
      throw new IOException("Cannot serialize more than 63 params");
    }

    if (sender != null) { presence1 |= 0x80; }
    if (language != null) { presence1 |= 0x40; }
    if (ontology != null) { presence1 |= 0x20; }
    if (encoding != null) { presence1 |= 0x10; }
    if (protocol != null) { presence1 |= 0x08; }
    if (conversationId != null) { presence1 |= 0x04; }
    if (inReplyTo != null) { presence1 |= 0x02; }
    if (replyWith != null) { presence1 |= 0x01; }
    if (replyBy != null) { presence2 |= 0x80; }
    presence2 |= (props.size() & 0x3F);
    dos.writeByte(presence1);
    dos.writeByte(presence2);

    if (sender != null) { serializeAID(sender, dos); }
    if (language != null) { dos.writeUTF(language); }
View Full Code Here

  public final static void serializeAID(AID id, DataOutputStream dos) throws IOException {
    byte presence = 0;
    String name = id.getName();
    Iterator addresses = id.getAllAddresses();
    Iterator resolvers = id.getAllResolvers();
    Properties props = id.getAllUserDefinedSlot();
    if (props.size() > 31) {
      throw new IOException("Cannot serialize more than 31 slots");
    }
    if (name != null) { presence |= 0x80; }
    if (addresses.hasNext()) { presence |= 0x40; }
    if (resolvers.hasNext()) { presence |= 0x20; }
    presence |= (props.size() & 0x1F);
    dos.writeByte(presence);

    if (name != null) { dos.writeUTF(name); }
    // Addresses
    while (addresses.hasNext()) {
View Full Code Here

TOP

Related Classes of jade.util.leap.Properties

Copyright © 2018 www.massapicom. 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.