reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
WsCookieContextFactory.hxx
Go to the documentation of this file.
1#ifndef RESIP_WsCookieContextFactory_hxx
2#define RESIP_WsCookieContextFactory_hxx
3
4#include "Cookie.hxx"
5#include "rutil/Data.hxx"
6#include "Uri.hxx"
7#include "WsCookieContext.hxx"
8
9#include <memory>
10
11namespace resip
12{
13
15{
16 public:
20 virtual ~WsCookieContextFactory() = default;
21
24
25 virtual std::shared_ptr<WsCookieContext> makeCookieContext(const CookieList& cookieList, const Uri& requestUri) = 0;
26};
27
30{
31 public:
32 explicit BasicWsCookieContextFactory(const Data& infoCookieName = "", const Data& extraCookieName = "", const Data& macCookieName = "")
33 : mInfoCookieName(infoCookieName.empty() ? "WSSessionInfo" : infoCookieName),
34 mExtraCookieName(extraCookieName.empty() ? "WSSessionExtra": extraCookieName),
35 macCookieName(macCookieName.empty() ? "WSSessionMAC" : macCookieName)
36 {
37 }
38
39 std::shared_ptr<WsCookieContext> makeCookieContext(const CookieList& cookieList, const Uri& requestUri) override
40 {
41 return std::make_shared<WsCookieContext>(cookieList, mInfoCookieName, mExtraCookieName, macCookieName, requestUri);
42 }
43
44 private:
45 Data mInfoCookieName;
46 Data mExtraCookieName;
47 Data macCookieName;
48};
49
50}
51
52#endif
53
54/* ====================================================================
55 * BSD License
56 *
57 * Copyright (c) 2013 Daniel Pocock http://danielpocock.com All rights reserved.
58 *
59 * Redistribution and use in source and binary forms, with or without
60 * modification, are permitted provided that the following conditions
61 * are met:
62 *
63 * 1. Redistributions of source code must retain the above copyright
64 * notice, this list of conditions and the following disclaimer.
65 *
66 * 2. Redistributions in binary form must reproduce the above copyright
67 * notice, this list of conditions and the following disclaimer in
68 * the documentation and/or other materials provided with the
69 * distribution.
70 *
71 * 3. Neither the name of the author(s) nor the names of any contributors
72 * may be used to endorse or promote products derived from this software
73 * without specific prior written permission.
74 *
75 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
76 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
77 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
78 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
79 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
80 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
81 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
82 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
83 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
84 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
85 * SUCH DAMAGE.
86 *
87 * ====================================================================
88 *
89 */
static Mimes empty
BasicWsCookieContextFactory(const Data &infoCookieName="", const Data &extraCookieName="", const Data &macCookieName="")
std::shared_ptr< WsCookieContext > makeCookieContext(const CookieList &cookieList, const Uri &requestUri) override
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
WsCookieContextFactory & operator=(WsCookieContextFactory &&)=delete
virtual ~WsCookieContextFactory()=default
virtual std::shared_ptr< WsCookieContext > makeCookieContext(const CookieList &cookieList, const Uri &requestUri)=0
WsCookieContextFactory & operator=(const WsCookieContextFactory &)=delete
WsCookieContextFactory(WsCookieContextFactory &&)=delete
WsCookieContextFactory(const WsCookieContextFactory &)=delete
dcm! – add UnusedChecking(_enum) below;
std::vector< Cookie > CookieList
Definition Cookie.hxx:35