/**
   * Expires a specific <tt>Content</tt> of this <tt>Conference</tt> (i.e. if the specified
   * <tt>content</tt> is not in the list of <tt>Content</tt>s of this <tt>Conference</tt>, does
   * nothing).
   *
   * @param content the <tt>Content</tt> to be expired by this <tt>Conference</tt>
   */
  public void expireContent(Content content) {
    boolean expireContent;

    synchronized (contents) {
      if (contents.contains(content)) {
        contents.remove(content);
        expireContent = true;
      } else expireContent = false;
    }
    if (expireContent) content.expire();
  }
  /**
   * Permanently removes locally stored message history for the chatroom, remove any recent contacts
   * if any.
   */
  public void eraseLocallyStoredHistory(ChatRoom room) {
    ComparableEvtObj toRemove = null;
    synchronized (recentMessages) {
      for (ComparableEvtObj msg : recentMessages) {
        if (msg.getRoom() != null && msg.getRoom().equals(room)) {
          toRemove = msg;
          break;
        }
      }

      if (toRemove == null) return;

      recentMessages.remove(toRemove);
    }

    if (recentQuery != null) recentQuery.fireContactRemoved(toRemove);
  }
示例#3
0
  /**
   * Remove Java language specific properties from the given list of property descriptors.
   *
   * @param properties is the list of property descriptors
   */
  protected static void removeJavaProperties(List<InternalEventPropDescriptor> properties) {
    List<InternalEventPropDescriptor> toRemove = new LinkedList<InternalEventPropDescriptor>();

    // add removed entries to separate list
    for (InternalEventPropDescriptor desc : properties) {
      if ((desc.getPropertyName().equals("class"))
          || (desc.getPropertyName().equals("getClass"))
          || (desc.getPropertyName().equals("toString"))
          || (desc.getPropertyName().equals("hashCode"))) {
        toRemove.add(desc);
      }
    }

    // remove
    for (InternalEventPropDescriptor desc : toRemove) {
      properties.remove(desc);
    }
  }
示例#4
0
  /**
   * Removed duplicate properties using the property name to find unique properties.
   *
   * @param properties is a list of property descriptors
   */
  protected static void removeDuplicateProperties(List<InternalEventPropDescriptor> properties) {
    LinkedHashMap<String, InternalEventPropDescriptor> set =
        new LinkedHashMap<String, InternalEventPropDescriptor>();
    List<InternalEventPropDescriptor> toRemove = new LinkedList<InternalEventPropDescriptor>();

    // add duplicates to separate list
    for (InternalEventPropDescriptor desc : properties) {
      if (set.containsKey(desc.getPropertyName())) {
        toRemove.add(desc);
        continue;
      }
      set.put(desc.getPropertyName(), desc);
    }

    // remove duplicates
    for (InternalEventPropDescriptor desc : toRemove) {
      properties.remove(desc);
    }
  }