/[resiprocate]/main/resip/dum/SubscriptionHandler.hxx
ViewVC logotype

Annotation of /main/resip/dum/SubscriptionHandler.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5271 - (hide annotations) (download)
Thu Aug 18 23:43:07 2005 UTC (14 years, 3 months ago) by jason
Original Path: branches/b-directory-reorg/sip/resiprocate/dum/SubscriptionHandler.hxx
File size: 5277 byte(s)
new directory reorg proposal
1 jason 2727 #if !defined(RESIP_SUBSCRIPTIONHANDLER_HXX)
2     #define RESIP_SUBSCRIPTIONHANDLER_HXX
3    
4 jason 2941 #include "resiprocate/dum/Handles.hxx"
5 derek 3570 #include "resiprocate/Mime.hxx"
6 greg 4829 #include "resiprocate/Contents.hxx"
7 jason 2727
8     namespace resip
9     {
10     class SipMessage;
11 jason 3545 class SecurityAttributes;
12 jason 2727
13     class ClientSubscriptionHandler
14     {
15     public:
16 greg 4768 virtual ~ClientSubscriptionHandler() { }
17    
18 derek 3058 virtual void onRefreshRejected(ClientSubscriptionHandle, const SipMessage& rejection)=0;
19 derek 3676
20     //Client must call acceptUpdate or rejectUpdate for any onUpdateFoo
21 derek 3058 virtual void onUpdatePending(ClientSubscriptionHandle, const SipMessage& notify)=0;
22 derek 3067 virtual void onUpdateActive(ClientSubscriptionHandle, const SipMessage& notify)=0;
23     //unknown Subscription-State value
24 derek 3079 virtual void onUpdateExtension(ClientSubscriptionHandle, const SipMessage& notify)=0;
25 derek 3066
26 dlb 4052 virtual int onRequestRetry(ClientSubscriptionHandle, int retrySeconds, const SipMessage& notify)=0;
27    
28 derek 3066 //subscription can be ended through a notify or a failure response.
29     virtual void onTerminated(ClientSubscriptionHandle, const SipMessage& msg)=0;
30     //not sure if this has any value.
31 derek 3570 virtual void onNewSubscription(ClientSubscriptionHandle, const SipMessage& notify)=0;
32 jason 2727 };
33    
34     class ServerSubscriptionHandler
35     {
36 derek 3067 public:
37 greg 4768 virtual ~ServerSubscriptionHandler() {}
38    
39 derek 3058 virtual void onNewSubscription(ServerSubscriptionHandle, const SipMessage& sub)=0;
40 derek 3450 virtual void onRefresh(ServerSubscriptionHandle, const SipMessage& sub);
41 jason 3545 virtual void onPublished(ServerSubscriptionHandle associated,
42     ServerPublicationHandle publication,
43     const Contents* contents,
44     const SecurityAttributes* attrs);
45 derek 3066
46 derek 3676 virtual void onNotifyRejected(ServerSubscriptionHandle, const SipMessage& msg);
47    
48 derek 3066 //called when this usage is destroyed for any reason. One of the following
49     //three methods will always be called before this, but this is the only
50     //method that MUST be implemented by a handler
51     virtual void onTerminated(ServerSubscriptionHandle)=0;
52    
53 derek 3676 //will be called when a NOTIFY is not delivered(with a usage terminating
54     //statusCode), or the Dialog is destroyed
55 derek 3067 virtual void onError(ServerSubscriptionHandle, const SipMessage& msg);
56 derek 3066
57 jason 3433 //app can synchronously decorate terminating NOTIFY messages. The only
58 derek 3066 //graceful termination mechanism is expiration, but the client can
59     //explicity end a subscription with an Expires header of 0.
60     virtual void onExpiredByClient(ServerSubscriptionHandle, const SipMessage& sub, SipMessage& notify);
61     virtual void onExpired(ServerSubscriptionHandle, SipMessage& notify);
62 derek 3450
63     virtual bool hasDefaultExpires() const;
64     virtual int getDefaultExpires() const;
65 derek 3570
66     const Mimes& getSupportedMimeTypes() const;
67 jason 2727 };
68    
69     }
70    
71 derek 3058 #endif
72 jason 4010
73     /* ====================================================================
74     * The Vovida Software License, Version 1.0
75     *
76     * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
77     *
78     * Redistribution and use in source and binary forms, with or without
79     * modification, are permitted provided that the following conditions
80     * are met:
81     *
82     * 1. Redistributions of source code must retain the above copyright
83     * notice, this list of conditions and the following disclaimer.
84     *
85     * 2. Redistributions in binary form must reproduce the above copyright
86     * notice, this list of conditions and the following disclaimer in
87     * the documentation and/or other materials provided with the
88     * distribution.
89     *
90     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
91     * and "Vovida Open Communication Application Library (VOCAL)" must
92     * not be used to endorse or promote products derived from this
93     * software without prior written permission. For written
94     * permission, please contact vocal@vovida.org.
95     *
96     * 4. Products derived from this software may not be called "VOCAL", nor
97     * may "VOCAL" appear in their name, without prior written
98     * permission of Vovida Networks, Inc.
99     *
100     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
101     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
102     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
103     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
104     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
105     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
106     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
107     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
108     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
109     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
110     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
111     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
112     * DAMAGE.
113     *
114     * ====================================================================
115     *
116     * This software consists of voluntary contributions made by Vovida
117     * Networks, Inc. and many individuals on behalf of Vovida Networks,
118     * Inc. For more information on Vovida Networks, Inc., please see
119     * <http://www.vovida.org/>.
120     *
121     */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27