/**
     * Adds a <tt>payload-type</tt> element defined by XEP-0167: Jingle RTP Sessions to this
     * <tt>channel</tt>.
     *
     * @param payloadType the <tt>payload-type</tt> element to be added to this <tt>channel</tt>
     * @return <tt>true</tt> if the list of <tt>payload-type</tt> elements associated with this
     *     <tt>channel</tt> has been modified as part of the method call; otherwise, <tt>false</tt>
     * @throws NullPointerException if the specified <tt>payloadType</tt> is <tt>null</tt>
     */
    public boolean addPayloadType(PayloadTypePacketExtension payloadType) {
      if (payloadType == null) throw new NullPointerException("payloadType");

      // Make sure that the COLIBRI namespace is used.
      payloadType.setNamespace(null);
      for (ParameterPacketExtension p : payloadType.getParameters()) p.setNamespace(null);

      return payloadTypes.contains(payloadType) ? false : payloadTypes.add(payloadType);
    }
 /**
  * Adds <tt>WebRtcDataStreamListener</tt> to the list of listeners.
  *
  * @param listener the <tt>WebRtcDataStreamListener</tt> to be added to the listeners list.
  */
 public void addChannelListener(WebRtcDataStreamListener listener) {
   if (listener == null) {
     throw new NullPointerException("listener");
   } else {
     synchronized (listeners) {
       if (!listeners.contains(listener)) {
         listeners.add(listener);
       }
     }
   }
 }
  /**
   * 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();
  }
Beispiel #4
0
  /**
   * Determines whether a specific format is supported by the <tt>Recorder</tt> represented by this
   * <tt>RecordButton</tt>.
   *
   * @param format the format which is to be checked whether it is supported by the
   *     <tt>Recorder</tt> represented by this <tt>RecordButton</tt>
   * @return <tt>true</tt> if the specified <tt>format</tt> is supported by the <tt>Recorder</tt>
   *     represented by this <tt>RecordButton</tt>; otherwise, <tt>false</tt>
   */
  private boolean isSupportedFormat(String format) {
    Recorder recorder;

    try {
      recorder = getRecorder();
    } catch (OperationFailedException ofex) {
      logger.error("Failed to get Recorder", ofex);
      return false;
    }

    List<String> supportedFormats = recorder.getSupportedFormats();

    return (supportedFormats != null) && supportedFormats.contains(format);
  }
  /**
   * Adds a specific {@link Content} instance to the list of <tt>Content</tt> instances included
   * into this <tt>conference</tt> IQ.
   *
   * @param content the <tt>Content</tt> instance to be added to this list of <tt>Content</tt>
   *     instances included into this <tt>conference</tt> IQ
   * @return <tt>true</tt> if the list of <tt>Content</tt> instances included into this
   *     <tt>conference</tt> IQ has been modified as a result of the method call; otherwise,
   *     <tt>false</tt>
   * @throws NullPointerException if the specified <tt>content</tt> is <tt>null</tt>
   */
  public boolean addContent(Content content) {
    if (content == null) throw new NullPointerException("content");

    return contents.contains(content) ? false : contents.add(content);
  }
    /**
     * Adds a <tt>SourcePacketExtension</tt> to the list of sources of this channel.
     *
     * @param source the <tt>SourcePacketExtension</tt> to add to the list of sources of this
     *     channel
     * @return <tt>true</tt> if the list of sources of this channel changed as a result of the
     *     execution of the method; otherwise, <tt>false</tt>
     */
    public synchronized boolean addSource(SourcePacketExtension source) {
      if (source == null) throw new NullPointerException("source");

      return sources.contains(source) ? false : sources.add(source);
    }
    /**
     * Adds a specific <tt>SctpConnection</tt> to the list of <tt>SctpConnection</tt>s included into
     * this <tt>Content</tt>.
     *
     * @param conn the <tt>SctpConnection</tt> to be included into this <tt>Content</tt>
     * @return <tt>true</tt> if the list of <tt>SctpConnection</tt>s included into this
     *     <tt>Content</tt> was modified as a result of the execution of the method; otherwise,
     *     <tt>false</tt>
     * @throws NullPointerException if the specified <tt>conn</tt> is <tt>null</tt>
     */
    public boolean addSctpConnection(SctpConnection conn) {
      if (conn == null) throw new NullPointerException("Sctp connection");

      return !sctpConnections.contains(conn) && sctpConnections.add(conn);
    }
    /**
     * Adds a specific <tt>Channel</tt> to the list of <tt>Channel</tt>s included into this
     * <tt>Content</tt>.
     *
     * @param channel the <tt>Channel</tt> to be included into this <tt>Content</tt>
     * @return <tt>true</tt> if the list of <tt>Channel</tt>s included into this <tt>Content</tt>
     *     was modified as a result of the execution of the method; otherwise, <tt>false</tt>
     * @throws NullPointerException if the specified <tt>channel</tt> is <tt>null</tt>
     */
    public boolean addChannel(Channel channel) {
      if (channel == null) throw new NullPointerException("channel");

      return channels.contains(channel) ? false : channels.add(channel);
    }