Package javax.servlet.sip

Examples of javax.servlet.sip.URI


    @Override
    public void startRequest(Buffer method, Buffer uri, Buffer version) throws IOException
    {
      try
      {
        URI ruri = URIFactory.parseURI(uri.toString());
        SipRequest request = new SipRequest();
        request.setMethod(method.toString());
        request.setRequestURI(ruri);
        _message = request;
      }
View Full Code Here


  @Override
  public boolean equals(Object o)
  {
    if (o == null || !(o instanceof URI))
      return false;
    URI uri = (URI) o;
    if (!_scheme.equals(uri.getScheme()))
      return false;
   
    // FIXME improve equals
    if (!toString().equals(uri.toString()))
      return false;
   
    return true;
     
  }
View Full Code Here

    try { readOnly.setHeader("subject", "toto"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeHeader("to"); fail();} catch (IllegalStateException e) {}
    assertEquals(orig, readOnly);
    assertEquals(readOnly, orig);
    assertEquals(orig.toString(), readOnly.toString());
    URI clone = (URI) readOnly.clone();
    clone.setParameter("a", "b");
    testSerializable(readOnly);
  }
View Full Code Here

    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("user");   fail();} catch (IllegalStateException e) {}
    assertEquals(orig, readOnly);
    assertEquals(readOnly, orig);
    assertEquals(orig.toString(), readOnly.toString());
    URI clone = (URI) readOnly.clone();
    clone.setParameter("a", "b");
    testSerializable(readOnly);
  }
View Full Code Here

  }

  @Test
  public void testURI() throws Exception
  {
    URI orig = new URIImpl("http://www.nexcom.fr;user=me");
    URI readOnly = new ReadOnlyURI((URI) orig.clone());
   
    assertEquals(orig, readOnly);
    try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
    try { readOnly.removeParameter("user");   fail();} catch (IllegalStateException e) {}
    assertEquals(orig, readOnly);
    assertEquals(readOnly, orig);
    assertEquals(orig.toString(), readOnly.toString());
    URI clone = (URI) readOnly.clone();
    clone.setParameter("a", "b");
    testSerializable(readOnly);
  }
View Full Code Here

      throw new IllegalArgumentException("Invalid expression: tel after " + token);
  }
 
  public Object extract(Object input)
  {
    URI uri = (URI) input;
    if (uri.isSipURI())
    {
          SipURI sipuri = (SipURI) uri;
          if ("phone".equals(sipuri.getParameter("user")))
              return stripVisuals(sipuri.getUser());
      }
    else if ("tel".equals(uri.getScheme()))
    {
          return stripVisuals(((TelURL) uri).getPhoneNumber());
      }
      return null;
  }
View Full Code Here

    return false;
  }
 
  protected Branch addTarget(URI uri)
  {
    URI target = uri.clone();
    if (target.isSipURI())
    {
      SipURI sipUri = (SipURI) target;
      sipUri.removeParameter("method");
      Iterator<String> it = sipUri.getHeaderNames();
      while (it.hasNext())
View Full Code Here

  }

  @Test
  public void testGenericUri() throws Exception
  {
    URI uri = URIFactory.parseURI("foo://bar");
    assertEquals("foo", uri.getScheme());
    assertEquals("foo://bar", uri.toString());
   
    try
    {
      URIFactory.parseURI("1foo://bar");
      fail();
View Full Code Here

      throw new IllegalArgumentException("Invalid expression: user after " + token);
  }
 
  public Object extract(Object input)
  {
    URI uri = (URI) input;
    if (uri.isSipURI())
            return ((SipURI)uri).getUser();
        else
            return null;
  }
View Full Code Here

      throw new IllegalArgumentException("Invalid expression: port after " + token);
  }
 
  public Object extract(Object input)
  {
    URI uri = (URI) input;
    if (uri.isSipURI())
    {
          SipURI sipuri = (SipURI) uri;
          int port = sipuri.getPort();
          if (port < 0)
          {
View Full Code Here

TOP

Related Classes of javax.servlet.sip.URI

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.