reSIProcate/DialogUsageManager  9694
RegistrationHandler.hxx
Go to the documentation of this file.
00001 #if !defined(RESIP_REGISTRATIONHANDLER_HXX)
00002 #define RESIP_REGISTRATIONHANDLER_HXX
00003 
00004 #include "resip/dum/Handles.hxx"
00005 #include "rutil/SharedPtr.hxx"
00006 #include "resip/dum/ContactInstanceRecord.hxx"
00007 
00008 namespace resip
00009 {
00010 
00011 class SipMessage;
00012 class NameAddr;
00013 class MasterProfile;
00014 
00015 class ClientRegistrationHandler
00016 {
00017    public:
00018       virtual ~ClientRegistrationHandler() { }
00021       virtual void onSuccess(ClientRegistrationHandle, const SipMessage& response)=0;
00022 
00023       // Called when all of my bindings have been removed
00024       virtual void onRemoved(ClientRegistrationHandle, const SipMessage& response) = 0;
00025       
00028       virtual int onRequestRetry(ClientRegistrationHandle, int retrySeconds, const SipMessage& response)=0;
00029       
00032       virtual void onFailure(ClientRegistrationHandle, const SipMessage& response)=0;
00033 
00036       //  Called only if clientOutbound is enabled on the UserProfile and the first hop server 
00039       virtual void onFlowTerminated(ClientRegistrationHandle);
00040 };
00041 
00042 class ServerRegistrationHandler
00043 {
00044    public:
00045       virtual ~ServerRegistrationHandler() {}
00046 
00048       virtual void onRefresh(ServerRegistrationHandle, const SipMessage& reg)=0;
00049       
00051       virtual void onRemove(ServerRegistrationHandle, const SipMessage& reg)=0;
00052       
00054       virtual void onRemoveAll(ServerRegistrationHandle, const SipMessage& reg)=0;
00055       
00058       virtual void onAdd(ServerRegistrationHandle, const SipMessage& reg)=0;
00059 
00061       virtual void onQuery(ServerRegistrationHandle, const SipMessage& reg)=0;
00062 
00069       virtual void getGlobalExpires(const SipMessage& msg, 
00070                                     SharedPtr<MasterProfile> masterProfile, 
00071                                     UInt32 &expires, 
00072                                     UInt32 &returnCode);
00073 
00080       virtual void getContactExpires(const NameAddr &contact, 
00081                                      SharedPtr<MasterProfile> masterProfile, 
00082                                      UInt32 &expires, 
00083                                      UInt32 &returnCode);
00084 
00087       virtual bool asyncProcessing(void) const
00088       {
00089          return false;
00090       } 
00091 
00095       virtual void asyncGetContacts(ServerRegistrationHandle, const Uri& aor)
00096       {
00097       }
00098 
00103       virtual void asyncUpdateContacts(ServerRegistrationHandle,
00104                                        const Uri& aor,
00105                                        std::auto_ptr<ContactPtrList> modifiedContactList, 
00106                                        std::auto_ptr<ContactRecordTransactionLog> transactionLog)
00107       {
00108       }
00109 
00113       virtual void asyncRemoveExpired(ServerRegistrationHandle, 
00114                                       const resip::Uri& aor,
00115                                       std::auto_ptr<resip::ContactPtrList> contacts)
00116       {
00117       }
00118 };
00119 
00120 }
00121 
00122 #endif
00123 
00124 /* ====================================================================
00125  * The Vovida Software License, Version 1.0 
00126  * 
00127  * Copyright (c) 2000 Vovida Networks, Inc.  All rights reserved.
00128  * 
00129  * Redistribution and use in source and binary forms, with or without
00130  * modification, are permitted provided that the following conditions
00131  * are met:
00132  * 
00133  * 1. Redistributions of source code must retain the above copyright
00134  *    notice, this list of conditions and the following disclaimer.
00135  * 
00136  * 2. Redistributions in binary form must reproduce the above copyright
00137  *    notice, this list of conditions and the following disclaimer in
00138  *    the documentation and/or other materials provided with the
00139  *    distribution.
00140  * 
00141  * 3. The names "VOCAL", "Vovida Open Communication Application Library",
00142  *    and "Vovida Open Communication Application Library (VOCAL)" must
00143  *    not be used to endorse or promote products derived from this
00144  *    software without prior written permission. For written
00145  *    permission, please contact vocal@vovida.org.
00146  *
00147  * 4. Products derived from this software may not be called "VOCAL", nor
00148  *    may "VOCAL" appear in their name, without prior written
00149  *    permission of Vovida Networks, Inc.
00150  * 
00151  * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
00152  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
00153  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
00154  * NON-INFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL VOVIDA
00155  * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
00156  * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
00157  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00158  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00159  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00160  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00161  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
00162  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
00163  * DAMAGE.
00164  * 
00165  * ====================================================================
00166  * 
00167  * This software consists of voluntary contributions made by Vovida
00168  * Networks, Inc. and many individuals on behalf of Vovida Networks,
00169  * Inc.  For more information on Vovida Networks, Inc., please see
00170  * <http://www.vovida.org/>.
00171  *
00172  */