public ListIterator<Parameterable> getParameterableHeaders(String name) throws ServletParseException { ListIterator<Header> headers = this.message .getHeaders(getCorrectHeaderName(name)); ArrayList<Parameterable> result = new ArrayList<Parameterable>(); while (headers != null && headers.hasNext()) result.add(createParameterable(headers.next(), getFullHeaderName(name), message instanceof Request)); if(!isParameterable(name)) { throw new ServletParseException(name + " header is not parameterable !"); } return result.listIterator(); }
public Parameterable getParameterableHeader(String name) throws ServletParseException { if (name == null) throw new NullPointerException( "Parametrable header name cant be null!!!"); String nameToSearch = getCorrectHeaderName(name); Header h = this.message.getHeader(nameToSearch); if(!isParameterable(name)) { throw new ServletParseException(name + " header is not parameterable !"); } if(h == null) { return null; } return createParameterable(h, getFullHeaderName(name), message instanceof Request); }
/** * {@inheritDoc} */ public Parameterable createParameterable(String value) throws ServletParseException { try { Header header = SipFactoryImpl.headerFactory.createHeader(ContactHeader.NAME, value); return SipServletMessageImpl.createParameterable(header, SipServletMessageImpl.getFullHeaderName(header.getName()), true); } catch (ParseException e) { try { Header header = SipFactoryImpl.headerFactory.createHeader(ContentTypeHeader.NAME, value); return SipServletMessageImpl.createParameterable(header, SipServletMessageImpl.getFullHeaderName(header.getName()), true); } catch (ParseException pe) { // Contribution from Nishihara, Naoki from Japan for Issue http://code.google.com/p/mobicents/issues/detail?id=1856 // Cannot create a parameterable header for Session-Expires try { Header header = SipFactoryImpl.headerFactory.createHeader(ContentDispositionHeader.NAME, value); return SipServletMessageImpl.createParameterable(header, SipServletMessageImpl.getFullHeaderName(header.getName()), true); } catch (ParseException pe2) { throw new ServletParseException("Impossible to parse the following parameterable "+ value , pe2); } } } }
Parameterable parametrable = createParameterable(header, header.getName(), message instanceof Request); try { AddressImpl addressImpl = new AddressImpl(SipFactoryImpl.addressFactory.createAddress(parametrable.getValue()), ((ParameterableHeaderImpl)parametrable).getInternalParameters(), getModifiableRule(hName));
Parameterable parametrable = createParameterable(first, first.getName(), message instanceof Request); try { logger.debug("parametrable Value " + parametrable.getValue());