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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5295 - (show annotations) (download)
Mon Aug 22 00:30:05 2005 UTC (14 years, 3 months ago) by jason
File size: 5271 byte(s)
merged 5270:HEAD from b-directory-reorg
1 #if !defined(RESIP_SUBSCRIPTIONHANDLER_HXX)
2 #define RESIP_SUBSCRIPTIONHANDLER_HXX
3
4 #include "resip/dum/Handles.hxx"
5 #include "resip/stack/Mime.hxx"
6 #include "resip/stack/Contents.hxx"
7
8 namespace resip
9 {
10 class SipMessage;
11 class SecurityAttributes;
12
13 class ClientSubscriptionHandler
14 {
15 public:
16 virtual ~ClientSubscriptionHandler() { }
17
18 virtual void onRefreshRejected(ClientSubscriptionHandle, const SipMessage& rejection)=0;
19
20 //Client must call acceptUpdate or rejectUpdate for any onUpdateFoo
21 virtual void onUpdatePending(ClientSubscriptionHandle, const SipMessage& notify)=0;
22 virtual void onUpdateActive(ClientSubscriptionHandle, const SipMessage& notify)=0;
23 //unknown Subscription-State value
24 virtual void onUpdateExtension(ClientSubscriptionHandle, const SipMessage& notify)=0;
25
26 virtual int onRequestRetry(ClientSubscriptionHandle, int retrySeconds, const SipMessage& notify)=0;
27
28 //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 virtual void onNewSubscription(ClientSubscriptionHandle, const SipMessage& notify)=0;
32 };
33
34 class ServerSubscriptionHandler
35 {
36 public:
37 virtual ~ServerSubscriptionHandler() {}
38
39 virtual void onNewSubscription(ServerSubscriptionHandle, const SipMessage& sub)=0;
40 virtual void onRefresh(ServerSubscriptionHandle, const SipMessage& sub);
41 virtual void onPublished(ServerSubscriptionHandle associated,
42 ServerPublicationHandle publication,
43 const Contents* contents,
44 const SecurityAttributes* attrs);
45
46 virtual void onNotifyRejected(ServerSubscriptionHandle, const SipMessage& msg);
47
48 //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 //will be called when a NOTIFY is not delivered(with a usage terminating
54 //statusCode), or the Dialog is destroyed
55 virtual void onError(ServerSubscriptionHandle, const SipMessage& msg);
56
57 //app can synchronously decorate terminating NOTIFY messages. The only
58 //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
63 virtual bool hasDefaultExpires() const;
64 virtual int getDefaultExpires() const;
65
66 const Mimes& getSupportedMimeTypes() const;
67 };
68
69 }
70
71 #endif
72
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