Re: Why are the header classes final?

[email protected]
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
On Wed, 8 Nov 2006 at 20:53, Jeroen van Bemmel wrote:
> They are not all final, but in any case the public interfaces of this library 
> are in javax.sip (and javax.sdp). The design is such that an application 
> would only deal with those packages.

So why is gov.nist.javax.sip.header.Contact final if not all the
headers are?  Like I said, I'm new to Java so I don't know the
motivations for using final.

> Which need do you have that it cannot be done using the public API?

Well, we're trying to send a Response.MOVED_TEMPORARILY to Asterix
boxes, and we were told on the Asterix mailing list that Asterix
wouldn't recognize it unless the form of the Contact header
in the response was:

     Contact: Transfer <uri>

I tried just using Transfer as the DisplayName, but that produces:

     Contact: "Transfer" <uri>

and that doesn't seem to be good enough.  Now, I'm not personally
convinced that even getting rid of the quotes is going to fix the
problem with Asterix, but I need to run the experiment.  So I was
going to subclass Contact and change the toString so that there
were no quotes around Transfer, and use my custom header in 
constructing the response.

--David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.