1package javax.sip.header;
2
3import java.text.ParseException;
4import java.util.Calendar;
5import java.util.List;
6import java.util.Locale;
7import javax.sip.InvalidArgumentException;
8import javax.sip.address.Address;
9import javax.sip.address.URI;
10
11public interface HeaderFactory {
12    void setPrettyEncoding(boolean flag);
13
14    AcceptEncodingHeader createAcceptEncodingHeader(String encoding)
15            throws ParseException;
16
17    AcceptHeader createAcceptHeader(String contentType, String contentSubType)
18            throws ParseException;
19
20    AcceptLanguageHeader createAcceptLanguageHeader(Locale language);
21
22    AlertInfoHeader createAlertInfoHeader(URI alertInfo);
23
24    AllowEventsHeader createAllowEventsHeader(String eventType)
25            throws ParseException;
26
27    AllowHeader createAllowHeader(String method) throws ParseException;
28
29    AuthenticationInfoHeader createAuthenticationInfoHeader(String response)
30            throws ParseException;
31
32    AuthorizationHeader createAuthorizationHeader(String scheme)
33            throws ParseException;
34
35    CallIdHeader createCallIdHeader(String callId) throws ParseException;
36
37    CallInfoHeader createCallInfoHeader(URI callInfo);
38
39    ContactHeader createContactHeader();
40
41    ContactHeader createContactHeader(Address address);
42
43    ContentDispositionHeader createContentDispositionHeader(
44            String contentDispositionType) throws ParseException;
45
46    ContentEncodingHeader createContentEncodingHeader(String encoding)
47            throws ParseException;
48
49    ContentLanguageHeader createContentLanguageHeader(Locale contentLanguage);
50
51    ContentLengthHeader createContentLengthHeader(int contentLength)
52            throws InvalidArgumentException;
53
54    ContentTypeHeader createContentTypeHeader(String contentType,
55            String contentSubType) throws ParseException;
56
57    /**
58     * @deprecated
59     * @see #createCSeqHeader(long, String)
60     */
61    CSeqHeader createCSeqHeader(int sequenceNumber, String method)
62            throws ParseException, InvalidArgumentException;
63
64    CSeqHeader createCSeqHeader(long sequenceNumber, String method)
65            throws ParseException, InvalidArgumentException;
66
67    DateHeader createDateHeader(Calendar date);
68
69    ErrorInfoHeader createErrorInfoHeader(URI errorInfo);
70
71    EventHeader createEventHeader(String eventType) throws ParseException;
72
73    ExpiresHeader createExpiresHeader(int expires)
74            throws InvalidArgumentException;
75
76    ExtensionHeader createExtensionHeader(String name, String value)
77            throws ParseException;
78
79    FromHeader createFromHeader(Address address, String tag)
80            throws ParseException;
81
82    Header createHeader(String name, String value) throws ParseException;
83    Header createHeader(String headerText) throws ParseException;
84
85    List createHeaders(String headers) throws ParseException;
86
87    InReplyToHeader createInReplyToHeader(String callId) throws ParseException;
88
89    MaxForwardsHeader createMaxForwardsHeader(int maxForwards)
90            throws InvalidArgumentException;
91
92    MimeVersionHeader createMimeVersionHeader(int majorVersion,
93            int minorVersion) throws InvalidArgumentException;
94
95    MinExpiresHeader createMinExpiresHeader(int minExpires)
96            throws InvalidArgumentException;
97
98    OrganizationHeader createOrganizationHeader(String organization)
99            throws ParseException;
100
101    PriorityHeader createPriorityHeader(String priority) throws ParseException;
102
103    ProxyAuthenticateHeader createProxyAuthenticateHeader(String scheme)
104            throws ParseException;
105
106    ProxyAuthorizationHeader createProxyAuthorizationHeader(String scheme)
107            throws ParseException;
108
109    ProxyRequireHeader createProxyRequireHeader(String optionTag)
110            throws ParseException;
111
112    RAckHeader createRAckHeader(long rSeqNumber, long cSeqNumber, String method)
113            throws InvalidArgumentException, ParseException;
114
115    /**
116     * @deprecated
117     * @see #createRAckHeader(long, long, String)
118     */
119    RAckHeader createRAckHeader(int rSeqNumber, int cSeqNumber, String method)
120            throws InvalidArgumentException, ParseException;
121
122    ReasonHeader createReasonHeader(String protocol, int cause, String text)
123            throws InvalidArgumentException, ParseException;
124
125    RecordRouteHeader createRecordRouteHeader(Address address);
126
127    ReferToHeader createReferToHeader(Address address);
128
129    ReplyToHeader createReplyToHeader(Address address);
130
131    RequireHeader createRequireHeader(String optionTag) throws ParseException;
132
133    RetryAfterHeader createRetryAfterHeader(int retryAfter)
134            throws InvalidArgumentException;
135
136    RouteHeader createRouteHeader(Address address);
137
138    RSeqHeader createRSeqHeader(long sequenceNumber)
139            throws InvalidArgumentException;
140
141    /**
142     * @deprecated
143     * @see #createRSeqHeader(long)
144     */
145    RSeqHeader createRSeqHeader(int sequenceNumber)
146            throws InvalidArgumentException;
147
148    ServerHeader createServerHeader(List product) throws ParseException;
149
150    SIPETagHeader createSIPETagHeader(String etag) throws ParseException;
151
152    SIPIfMatchHeader createSIPIfMatchHeader(String etag) throws ParseException;
153
154    SubjectHeader createSubjectHeader(String subject) throws ParseException;
155
156    SubscriptionStateHeader createSubscriptionStateHeader(
157            String subscriptionState) throws ParseException;
158
159    SupportedHeader createSupportedHeader(String optionTag)
160            throws ParseException;
161
162    TimeStampHeader createTimeStampHeader(float timeStamp)
163            throws InvalidArgumentException;
164
165    ToHeader createToHeader(Address address, String tag) throws ParseException;
166
167    UnsupportedHeader createUnsupportedHeader(String optionTag)
168            throws ParseException;
169
170    UserAgentHeader createUserAgentHeader(List product) throws ParseException;
171
172    ViaHeader createViaHeader(String host, int port, String transport,
173            String branch) throws InvalidArgumentException, ParseException;
174
175    WarningHeader createWarningHeader(String agent, int code, String comment)
176            throws InvalidArgumentException, ParseException;
177
178    WWWAuthenticateHeader createWWWAuthenticateHeader(String scheme)
179            throws ParseException;
180}
181