reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
RegSyncServer.hxx
Go to the documentation of this file.
1#if !defined(RegSyncServer_hxx)
2#define RegSyncServer_hxx
3
4#include <rutil/Data.hxx>
6#include <rutil/XMLCursor.hxx>
10
11#define REGSYNC_VERSION 4
12
13namespace repro
14{
15class RegSyncServer;
16
20{
21public:
23 int port,
24 resip::IpVersion version,
26#ifdef BUILD_QPID_PROTON
30#endif
31 virtual ~RegSyncServer();
32
33 // thread safe
34 virtual void sendResponse(unsigned int connectionId,
35 unsigned int requestId,
37 unsigned int resultCode,
38 const resip::Data& resultText);
39
40 // Use connectionId == 0 to send to all connections
41 virtual void sendRegistrationModifiedEvent(unsigned int connectionId, const resip::Uri& aor);
42 virtual void sendRegistrationModifiedEvent(unsigned int connectionId, const resip::Uri& aor, const resip::ContactList& contacts);
45
46protected:
47 virtual void handleRequest(unsigned int connectionId, unsigned int requestId, const resip::Data& request);
48
49 // InMemorySyncRegDbHandler methods
50 virtual void onAorModified(const resip::Uri& aor, const resip::ContactList& contacts);
51 virtual void onInitialSyncAor(unsigned int connectionId, const resip::Uri& aor, const resip::ContactList& contacts);
52
53 // InMemorySyncPubDbHandler methods
55 virtual void onDocumentRemoved(bool sync, const resip::Data& eventType, const resip::Data& documentKey, const resip::Data& eTag, uint64_t lastUpdated);
57
58private:
59 void handleInitialSyncRequest(unsigned int connectionId, unsigned int requestId, resip::XMLCursor& xml);
60 void streamContactInstanceRecord(std::stringstream& ss, const resip::ContactInstanceRecord& rec);
61
64};
65
66}
67
68#endif
69
70/* ====================================================================
71 * The Vovida Software License, Version 1.0
72 *
73 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
74 * Copyright (c) 2015 SIP Spectrum, Inc. All rights reserved.
75 * Copyright (c) 2022 Daniel Pocock https://danielpocock.com
76 * Copyright (c) 2022 Software Freedom Institute LLC https://softwarefreedom.institute
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 */
virtual void onInitialSyncDocument(unsigned int connectionId, const resip::Data &eventType, const resip::Data &documentKey, const resip::Data &eTag, uint64_t expirationTime, uint64_t lastUpdated, const resip::Contents *contents, const resip::SecurityAttributes *securityAttributes)
virtual void sendDocumentModifiedEvent(unsigned int connectionId, const resip::Data &eventType, const resip::Data &documentKey, const resip::Data &eTag, uint64_t expirationTime, uint64_t lastUpdated, const resip::Contents *contents, const resip::SecurityAttributes *securityAttributes)
virtual void onInitialSyncAor(unsigned int connectionId, const resip::Uri &aor, const resip::ContactList &contacts)
virtual void sendRegistrationModifiedEvent(unsigned int connectionId, const resip::Uri &aor)
virtual void handleRequest(unsigned int connectionId, unsigned int requestId, const resip::Data &request)
virtual void sendResponse(unsigned int connectionId, unsigned int requestId, const resip::Data &responseData, unsigned int resultCode, const resip::Data &resultText)
virtual void onDocumentModified(bool sync, const resip::Data &eventType, const resip::Data &documentKey, const resip::Data &eTag, uint64_t expirationTime, uint64_t lastUpdated, const resip::Contents *contents, const resip::SecurityAttributes *securityAttributes)
virtual void onDocumentRemoved(bool sync, const resip::Data &eventType, const resip::Data &documentKey, const resip::Data &eTag, uint64_t lastUpdated)
virtual void sendDocumentRemovedEvent(unsigned int connectionId, const resip::Data &eventType, const resip::Data &documentKey, const resip::Data &eTag, uint64_t lastUpdated)
virtual void onAorModified(const resip::Uri &aor, const resip::ContactList &contacts)
A single contact record, bound to an Aor during registration.
Base class for all SIP body types.
Definition Contents.hxx:51
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Implementation of a persistence manager.
Implementation of a persistence manager.
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
This Class is used to implement a primitive form of RPC using loose XML formatting.
IpVersion
An enumeration of IP versions.
std::list< ContactInstanceRecord > ContactList
unsigned __int64 uint64_t
Definition stdint.h:95
void list()
Definition userAdmin.cxx:66