Пример #1
0
  /**
   * Creates an instance of <tt>CallPeerGibberishImpl</tt> by specifying the call peer
   * <tt>address</tt> and the parent <tt>owningCall</tt>.
   *
   * @param address the address of the peer
   * @param owningCall the parent call
   */
  public CallPeerGibberishImpl(String address, CallGibberishImpl owningCall) {
    this.peerAddress = address;
    this.call = owningCall;

    // create the uid
    this.peerID = String.valueOf(System.currentTimeMillis()) + String.valueOf(hashCode());

    final Random random = new Random();

    // Make this peer a conference focus.
    if (owningCall.getCallPeerCount() > 1) {
      this.setConferenceFocus(true);
      final ConferenceMemberGibberishImpl member1 =
          new ConferenceMemberGibberishImpl(this, "Dragancho@gibberish");
      member1.setDisplayName("Dragancho");
      member1.setState(ConferenceMemberState.CONNECTED);
      this.addConferenceMember(member1);

      final ConferenceMemberGibberishImpl member2 =
          new ConferenceMemberGibberishImpl(this, "Ivancho@gibberish");
      member2.setDisplayName("Ivancho");
      member2.setState(ConferenceMemberState.CONNECTED);
      this.addConferenceMember(member2);

      Timer timer1 = new Timer(false);
      timer1.scheduleAtFixedRate(
          new TimerTask() {
            @Override
            public void run() {
              fireConferenceMembersSoundLevelEvent(
                  new HashMap<ConferenceMember, Integer>() {
                    {
                      put(member1, new Integer(random.nextInt(255)));
                      put(member2, new Integer(random.nextInt(255)));
                    }
                  });
            }
          },
          500,
          100);
    }
  }
Пример #2
0
 /**
  * Returns the protocol provider that this peer belongs to.
  *
  * @return a reference to the ProtocolProviderService that this peer belongs to.
  */
 public ProtocolProviderServiceGibberishImpl getProtocolProvider() {
   return call.getProtocolProvider();
 }