Package org.cipango.sip.SipHeaders

Examples of org.cipango.sip.SipHeaders.HeaderInfo


      for (Entry<String, List<String>> entry : headerMap.entrySet())
      {
        String s = entry.getKey();
       
        CachedBuffer name = SipHeaders.getCachedName(s);
        HeaderInfo hi = SipHeaders.getType(name);
        int ordinal = hi.getOrdinal();
       
        if (hi.isSystem())
        {
          if (ordinal == SipHeaders.FROM_ORDINAL || ordinal == SipHeaders.TO_ORDINAL)
          {
            List<String> l = entry.getValue();
            if (l.size() > 0)
View Full Code Here


  {
    if (isCommitted())
      throw new IllegalStateException("Message is committed");
   
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (hi.getType() != HeaderInfo.ADDRESS && hi.getOrdinal() != -1)
      throw new IllegalArgumentException("Header: " + name + " is not of address type");

    if (isSystemHeader(hi))
      throw new IllegalArgumentException(name + " is a system header");
   
View Full Code Here

  {
    if (isCommitted())
      throw new IllegalStateException("Message is committed");
   
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (isSystemHeader(hi))
      throw new IllegalArgumentException(name + " is a system header");
   
    if (value == null || name == null)
View Full Code Here

   * @see SipServletMessage#getAddressHeader(java.lang.String)
   */
  public Address getAddressHeader(String name) throws ServletParseException
  {
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (hi.getType() != HeaderInfo.ADDRESS && hi.getOrdinal() != -1)
      throw new ServletParseException("Header: " + name + " is not of address type");
   
    Address address;
    try
    {
View Full Code Here

   * @see SipServletMessage#getAddressHeaders(String)
   */
  public ListIterator<Address> getAddressHeaders(String name) throws ServletParseException
  {
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (hi.getType() != HeaderInfo.ADDRESS && hi.getOrdinal() != -1)
      throw new ServletParseException("Header: " + name + " is not of address type");
   
    ListIterator<Address> it = _fields.getAddressValues(buffer);
    try
    {
View Full Code Here

  {
    if (isCommitted())
      throw new IllegalStateException("Message is committed");
   
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (isSystemHeader(hi))
      throw new IllegalArgumentException(name + " is a system header");

    _fields.remove(buffer);
View Full Code Here

  {
    if (isCommitted())
      throw new IllegalStateException("Message is committed");
   
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (isSystemHeader(hi))
      throw new IllegalArgumentException(name + " is a system header");

    _fields.setAddress(buffer, addr);
View Full Code Here

   
    if (name == null || value == null)
      throw new NullPointerException("Null value or name");
   
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (isSystemHeader(hi))
      throw new IllegalArgumentException(name + " is a system header");

    getFields().setString(buffer, value);
View Full Code Here

  {
    if (isCommitted())
      throw new IllegalStateException("Message is committed");
   
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (isSystemHeader(hi))
      throw new IllegalArgumentException(name + " is a system header");
   
    if (hi.getType() != HeaderInfo.PARAMETERABLE && hi.getOrdinal() != -1)
      throw new IllegalArgumentException("Header " + name + " is not of parameterable type");
   
    getFields().addParameterable(buffer, (ParameterableImpl) value, first);
  }
View Full Code Here

   * @see SipServletMessage#getParameterableHeader(String)
   */
  public Parameterable getParameterableHeader(String name) throws ServletParseException
  {
    Buffer buffer = SipHeaders.CACHE.lookup(name);
    HeaderInfo hi = SipHeaders.getType(buffer);
   
    if (hi.getType() != HeaderInfo.PARAMETERABLE && hi.getType() != HeaderInfo.ADDRESS && hi.getOrdinal() != -1)
      throw new ServletParseException("Header: " + name + " is not of parameterable type");
   
    Parameterable p = getFields().getParameterable(buffer);
   
    if ((isSystemHeader(hi) || isCommitted()) && p != null)
View Full Code Here

TOP

Related Classes of org.cipango.sip.SipHeaders.HeaderInfo

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.