1 /*
2  * Copyright (C) 2006-2021 Registro.br. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  * 1. Redistribution of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY REGISTRO.BR ``AS IS AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIE OF FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
16  * EVENT SHALL REGISTRO.BR BE LIABLE FOR ANY DIRECT, INDIRECT,
17  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
19  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
20  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
21  * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
23  * DAMAGE.
24  */
25 /* $Id$ */
26 /** @file  ClaimsNotice.H
27  *  @brief EPP Launch Phase
28  */
29 
30 #ifndef __CLAIMS_NOTICE_H__
31 #define __CLAIMS_NOTICE_H__
32 
33 LIBEPP_NICBR_NS_BEGIN
34 
35 /// EPP Notice Class
36 class ClaimsNotice
37 {
38 public:
39 	/// Default constructor
ClaimsNotice()40 	ClaimsNotice()
41 	{
42 		reset();
43 	}
44 
45 	/// Sets the unique notice identifier generated by the source of the
46 	/// Claims Notice information
47 	/**
48 	 * @param id unique notice identifier generated by the source of the
49 	 * Claims Notice information
50 	 */
set_id(const string & id)51 	void set_id(const string &id) { _id = id; }
52 
53 	/// Returns the unique notice identifier generated by the source of
54 	/// the Claims Notice information
55 	/**
56 	 * @return unique notice identifier generated by the source of the
57 	 * Claims Notice information
58 	 */
get_id()59 	string get_id() const { return _id; }
60 
61 	/// Sets the expiry of the claims notice
62 	/**
63 	 * @param notAfter expiry of the claims notice
64 	 */
set_notAfter(const string & notAfter)65 	void set_notAfter(const string &notAfter) { _notAfter = notAfter; }
66 
67 	/// Returns the expiry of the claims notice
68 	/**
69 	 * @return expiry of the claims notice
70 	 */
get_notAfter()71 	string get_notAfter() const { return _notAfter; }
72 
73 	/// Sets the date and time that the Claims Notice was accepted
74 	/**
75 	 * @param acceptedDate date and time that the Claims Notice was
76 	 * accepted
77 	 */
set_acceptedDate(const string & acceptedDate)78 	void set_acceptedDate(const string &acceptedDate) { _acceptedDate = acceptedDate; }
79 
80 	/// Returns the date and time that the Claims Notice was accepted
81 	/**
82 	 * @return date and time that the Claims Notice was accepted
83 	 */
get_acceptedDate()84 	string get_acceptedDate() const { return _acceptedDate; }
85 
86 	/// Returns if the Notice object is empty
87 	/**
88 	 * @return true for empty notice object or false otherwise
89 	 */
is_empty()90 	bool is_empty() const
91 	{
92 		return _id.empty() && _notAfter.empty() && _acceptedDate.empty();
93 	}
94 
95 	/// Reset object attributes
reset()96 	void reset()
97 	{
98 		_id.clear();
99 		_notAfter.clear();
100 		_acceptedDate.clear();
101 	}
102 
103 private:
104 	/// Unique notice identifier generated by the source of the Claims
105 	/// Notice information
106 	string _id;
107 
108 	/// Expiry of the claims notice
109 	string _notAfter;
110 
111 	/// Contains the date and time that the Claims Notice was accepted
112 	string _acceptedDate;
113 };
114 
115 LIBEPP_NICBR_NS_END
116 
117 #endif
118