Wolframe, 0.0.3

authSlice.hpp
Go to the documentation of this file.
1 /************************************************************************
2 
3  Copyright (C) 2011 - 2014 Project Wolframe.
4  All rights reserved.
5 
6  This file is part of Project Wolframe.
7 
8  Commercial Usage
9  Licensees holding valid Project Wolframe Commercial licenses may
10  use this file in accordance with the Project Wolframe
11  Commercial License Agreement provided with the Software or,
12  alternatively, in accordance with the terms contained
13  in a written agreement between the licensee and Project Wolframe.
14 
15  GNU General Public License Usage
16  Alternatively, you can redistribute this file and/or modify it
17  under the terms of the GNU General Public License as published by
18  the Free Software Foundation, either version 3 of the License, or
19  (at your option) any later version.
20 
21  Wolframe is distributed in the hope that it will be useful,
22  but WITHOUT ANY WARRANTY; without even the implied warranty of
23  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  GNU General Public License for more details.
25 
26  You should have received a copy of the GNU General Public License
27  along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
28 
29  If you have questions regarding the use of this file, please contact
30  Project Wolframe.
31 
32 ************************************************************************/
37 
38 #ifndef _AUTHENTICATION_SLICE_HPP_INCLUDED
39 #define _AUTHENTICATION_SLICE_HPP_INCLUDED
40 
41 #include <string>
42 #include <vector>
43 
44 #include "AAAA/user.hpp"
45 
46 namespace _Wolframe {
47 namespace AAAA {
48 
56 {
57 public:
58  enum Status {
67  };
68 
69  static const char* statusName( Status i)
70  {
71  static const char* ar[] = { "MESSAGE_AVAILABLE",
72  "AWAITING_MESSAGE",
73  "USER_NOT_FOUND",
74  "AUTHENTICATED",
75  "INVALID_CREDENTIALS",
76  "SYSTEM_FAILURE"
77  };
78  return ar[i];
79  }
80 
82  virtual ~AuthenticatorSlice() {}
83 
90  virtual void dispose() = 0;
91 
94  virtual const char* className() const = 0;
95 
98  virtual const std::string& identifier() const = 0;
99 
102  virtual void messageIn( const std::string& message ) = 0;
103 
106  virtual std::string messageOut() = 0;
107 
109  virtual Status status() const = 0;
110 
115  virtual bool inputReusable() const { return false; }
116 
122  virtual void lastSlice() { }
123 
129  virtual User* user() = 0;
130 };
131 
132 }} // namespace _Wolframe::AAAA
133 
134 #endif // _AUTHENTICATION_SLICE_HPP_INCLUDED
Basic user login information.
virtual ~AuthenticatorSlice()
The virtual destructor.
Definition: authSlice.hpp:82
Status
Definition: authSlice.hpp:58
an output message is available
Definition: authSlice.hpp:59
virtual bool inputReusable() const
Definition: authSlice.hpp:115
a user has been authenticated
Definition: authSlice.hpp:63
This is the base class for authenticator slices implementations An authenticator has (usually) severa...
Definition: authSlice.hpp:55
virtual std::string messageOut()=0
virtual const char * className() const =0
static const char * statusName(Status i)
Definition: authSlice.hpp:69
some other error occurred
Definition: authSlice.hpp:66
virtual void lastSlice()
Definition: authSlice.hpp:122
Data structure containing all login data of a user.
Definition: user.hpp:47
virtual const std::string & identifier() const =0
waiting for an input message
Definition: authSlice.hpp:60
virtual Status status() const =0
The current status of the authenticator.
virtual void messageIn(const std::string &message)=0