1
# Copyright (c) 2010 Reza Lotun http://reza.lotun.name
3
# Permission is hereby granted, free of charge, to any person obtaining a
4
# copy of this software and associated documentation files (the
5
# "Software"), to deal in the Software without restriction, including
6
# without limitation the rights to use, copy, modify, merge, publish, dis-
7
# tribute, sublicense, and/or sell copies of the Software, and to permit
8
# persons to whom the Software is furnished to do so, subject to the fol-
11
# The above copyright notice and this permission notice shall be included
12
# in all copies or substantial portions of the Software.
14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
17
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
18
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22
from boto.resultset import ResultSet
25
class AppCookieStickinessPolicy(object):
26
def __init__(self, connection=None):
27
self.cookie_name = None
28
self.policy_name = None
31
return 'AppCookieStickiness(%s, %s)' % (self.policy_name,
34
def startElement(self, name, attrs, connection):
37
def endElement(self, name, value, connection):
38
if name == 'CookieName':
39
self.cookie_name = value
40
elif name == 'PolicyName':
41
self.policy_name = value
44
class LBCookieStickinessPolicy(object):
45
def __init__(self, connection=None):
46
self.policy_name = None
47
self.cookie_expiration_period = None
50
return 'LBCookieStickiness(%s, %s)' % (self.policy_name,
51
self.cookie_expiration_period)
53
def startElement(self, name, attrs, connection):
56
def endElement(self, name, value, connection):
57
if name == 'CookieExpirationPeriod':
58
self.cookie_expiration_period = value
59
elif name == 'PolicyName':
60
self.policy_name = value
63
class Policies(object):
67
def __init__(self, connection=None):
68
self.connection = connection
69
self.app_cookie_stickiness_policies = None
70
self.lb_cookie_stickiness_policies = None
73
app = 'AppCookieStickiness%s' % self.app_cookie_stickiness_policies
74
lb = 'LBCookieStickiness%s' % self.lb_cookie_stickiness_policies
75
return 'Policies(%s,%s)' % (app, lb)
77
def startElement(self, name, attrs, connection):
78
if name == 'AppCookieStickinessPolicies':
79
rs = ResultSet([('member', AppCookieStickinessPolicy)])
80
self.app_cookie_stickiness_policies = rs
81
elif name == 'LBCookieStickinessPolicies':
82
rs = ResultSet([('member', LBCookieStickinessPolicy)])
83
self.lb_cookie_stickiness_policies = rs
85
def endElement(self, name, value, connection):