Package org.cipango.util

Examples of org.cipango.util.ReadOnlyAddress


  @Test
  public void testProxyAddress() throws Exception
  {
    SipRequest request = new SipRequest();
    NameAddr address = new NameAddr("sip:alice@atlanta.com");
    Address readOnlyAddress = new ReadOnlyAddress(address);
   
    request.addAddressHeader("p-asserted-identity", readOnlyAddress, true);
   
    Address addr = request.getAddressHeader("p-asserted-identity");
    assertEquals("alice", ((SipURI) addr.getURI()).getUser());
View Full Code Here


    }
   
    request.addAddressHeader("foo", address, false);
    assertEquals("foo", ((SipURI) request.getAddressHeader("FOO").getURI()).getHost());
   
    request.addAddressHeader("bar", new ReadOnlyAddress(address), false);
    assertEquals("foo", ((SipURI) request.getAddressHeader("Bar").getURI()).getHost());
   
    request.setAddressHeader("bar", new ReadOnlyAddress(address));
    assertEquals("foo", ((SipURI) request.getAddressHeader("Bar").getURI()).getHost());
  }
View Full Code Here

    }
   
    if (buffer == SipHeaders.CONTACT_BUFFER && isSystemHeader(hi) && !isCommitted() && address != null)
      return new ContactAddress(address);
    else if ((isSystemHeader(hi) || isCommitted()) && address != null)
      return new ReadOnlyAddress(address);
    else
      return address;
  }
View Full Code Here

    if (isSystemHeader(hi) || isCommitted())
    {
      return new ListIteratorProxy<Address>(it)
      {
        @Override
        public Address next() { return new ReadOnlyAddress(super.next()); }
        @Override
        public Address previous() { return new ReadOnlyAddress(super.previous()); }
      };
    }
    return it;
  }
View Full Code Here

  /**
   * @see SipServletMessage#getFrom()
   */
  public Address getFrom()
  {
    return new ReadOnlyAddress(_fields.getAddress(SipHeaders.FROM_BUFFER));
  }
View Full Code Here

  /**
   * @see SipServletMessage#getTo()
   */
  public Address getTo()
  {
    return new ReadOnlyAddress(_fields.getAddress(SipHeaders.TO_BUFFER));
  }
View Full Code Here

  /**
   * @see SipSession#getLocalParty()
   */
  public Address getLocalParty()
  {
    return new ReadOnlyAddress(_localParty);
  }
View Full Code Here

  /**
   * @see SipSession#getRemoteParty()
   */
  public Address getRemoteParty()
  {
    return new ReadOnlyAddress(_remoteParty);
  }
View Full Code Here

TOP

Related Classes of org.cipango.util.ReadOnlyAddress

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.