Leosac  0.8.0
Open Source Access Control
AuditFactory.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014-2016 Leosac
3 
4  This file is part of Leosac.
5 
6  Leosac is free software: you can redistribute it and/or modify
7  it under the terms of the GNU Affero General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Leosac is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU Affero General Public License for more details.
15 
16  You should have received a copy of the GNU Affero General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #pragma once
21 
22 #include "core/audit/AuditFwd.hpp"
23 #include "core/auth/AuthFwd.hpp"
25 #include "tools/ToolsFwd.hpp"
26 #include "tools/db/db_fwd.hpp"
28 
29 namespace Leosac
30 {
31 namespace Audit
32 {
46 class Factory
47 {
48  public:
49  static IUserEventPtr UserEvent(const DBPtr &database, Auth::UserPtr target_user,
50  IAuditEntryPtr parent);
51 
52  static IGroupEventPtr GroupEvent(const DBPtr &database,
53  Auth::GroupPtr target_group,
54  IAuditEntryPtr parent);
55 
56  static IWSAPICallPtr WSAPICall(const DBPtr &database);
57 
58 
60  UserGroupMembershipEvent(const DBPtr &database, Auth::GroupPtr target_group,
61  Auth::UserPtr target_user, IAuditEntryPtr parent);
62 
63  static ICredentialEventPtr CredentialEventPtr(const DBPtr &database,
64  Cred::ICredentialPtr target_cred,
65  IAuditEntryPtr parent);
66 
67  static IScheduleEventPtr ScheduleEvent(const DBPtr &database,
68  Tools::ISchedulePtr target_sched,
69  IAuditEntryPtr parent);
70 
71  static IDoorEventPtr DoorEvent(const DBPtr &database, Auth::IDoorPtr target_door,
72  IAuditEntryPtr parent);
73 
74  static IAccessPointEventPtr AccessPointEvent(const DBPtr &database,
75  Auth::IAccessPointPtr target_ap,
76  IAuditEntryPtr parent);
77 
78  static IUpdateEventPtr UpdateEvent(const DBPtr &database,
79  update::IUpdatePtr target_update,
80  IAuditEntryPtr parent);
81 
82  static IZoneEventPtr ZoneEvent(const DBPtr &database, Auth::IZonePtr target_zone,
83  IAuditEntryPtr parent);
84 };
85 }
86 }
Leosac::Tools::ISchedulePtr
std::shared_ptr< ISchedule > ISchedulePtr
Definition: ToolsFwd.hpp:37
Leosac::Audit::Factory::AccessPointEvent
static IAccessPointEventPtr AccessPointEvent(const DBPtr &database, Auth::IAccessPointPtr target_ap, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:139
AuthFwd.hpp
Leosac::Audit::IAccessPointEventPtr
std::shared_ptr< IAccessPointEvent > IAccessPointEventPtr
Definition: AuditFwd.hpp:67
Leosac::Auth::UserPtr
std::shared_ptr< User > UserPtr
Definition: AuthFwd.hpp:31
Leosac::update::IUpdatePtr
std::shared_ptr< IUpdate > IUpdatePtr
Definition: UpdateFwd.hpp:42
Leosac::Audit::Factory::DoorEvent
static IDoorEventPtr DoorEvent(const DBPtr &database, Auth::IDoorPtr target_door, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:124
Leosac::DBPtr
std::shared_ptr< odb::database > DBPtr
Definition: db_fwd.hpp:31
Leosac::Audit::IZoneEventPtr
std::shared_ptr< IZoneEvent > IZoneEventPtr
Definition: AuditFwd.hpp:73
Leosac::Audit::IAuditEntryPtr
std::shared_ptr< IAuditEntry > IAuditEntryPtr
Definition: AuditFwd.hpp:40
Leosac::Auth::IAccessPointPtr
std::shared_ptr< IAccessPoint > IAccessPointPtr
Definition: AuthFwd.hpp:127
Leosac::Audit::Factory::ZoneEvent
static IZoneEventPtr ZoneEvent(const DBPtr &database, Auth::IZonePtr target_zone, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:171
ToolsFwd.hpp
Leosac
This is the header file for a generated source file, GitSHA1.cpp.
Definition: APIStatusCode.hpp:22
Leosac::Audit::IUserEventPtr
std::shared_ptr< IUserEvent > IUserEventPtr
Definition: AuditFwd.hpp:46
Leosac::Audit::Factory
Provide static methods to instanciate various Audit objects.
Definition: AuditFactory.hpp:46
Leosac::Auth::IDoorPtr
std::shared_ptr< IDoor > IDoorPtr
Definition: AuthFwd.hpp:104
Leosac::Auth::GroupPtr
std::shared_ptr< Group > GroupPtr
Definition: AuthFwd.hpp:37
Leosac::Audit::IDoorEventPtr
std::shared_ptr< IDoorEvent > IDoorEventPtr
Definition: AuditFwd.hpp:64
Leosac::Audit::IWSAPICallPtr
std::shared_ptr< IWSAPICall > IWSAPICallPtr
Definition: AuditFwd.hpp:52
Leosac::Audit::IScheduleEventPtr
std::shared_ptr< IScheduleEvent > IScheduleEventPtr
Definition: AuditFwd.hpp:61
Leosac::Audit::Factory::UserEvent
static IUserEventPtr UserEvent(const DBPtr &database, Auth::UserPtr target_user, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:43
Leosac::Audit::Factory::GroupEvent
static IGroupEventPtr GroupEvent(const DBPtr &database, Auth::GroupPtr target_group, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:58
Leosac::Audit::ICredentialEventPtr
std::shared_ptr< ICredentialEvent > ICredentialEventPtr
Definition: AuditFwd.hpp:58
Leosac::Cred::ICredentialPtr
std::shared_ptr< ICredential > ICredentialPtr
Definition: CredentialFwd.hpp:32
db_fwd.hpp
Leosac::Auth::IZonePtr
std::shared_ptr< IZone > IZonePtr
Definition: AuthFwd.hpp:116
CredentialFwd.hpp
Leosac::Audit::Factory::ScheduleEvent
static IScheduleEventPtr ScheduleEvent(const DBPtr &database, Tools::ISchedulePtr target_sched, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:112
Leosac::Audit::IUserGroupMembershipEventPtr
std::shared_ptr< IUserGroupMembershipEvent > IUserGroupMembershipEventPtr
Definition: AuditFwd.hpp:55
Leosac::Audit::Factory::WSAPICall
static IWSAPICallPtr WSAPICall(const DBPtr &database)
Definition: AuditFactory.cpp:74
UpdateFwd.hpp
AuditFwd.hpp
Leosac::Audit::IGroupEventPtr
std::shared_ptr< IGroupEvent > IGroupEventPtr
Definition: AuditFwd.hpp:49
Leosac::Audit::Factory::UpdateEvent
static IUpdateEventPtr UpdateEvent(const DBPtr &database, update::IUpdatePtr target_update, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:155
Leosac::Audit::IUpdateEventPtr
std::shared_ptr< IUpdateEvent > IUpdateEventPtr
Definition: AuditFwd.hpp:70
Leosac::Audit::Factory::UserGroupMembershipEvent
static IUserGroupMembershipEventPtr UserGroupMembershipEvent(const DBPtr &database, Auth::GroupPtr target_group, Auth::UserPtr target_user, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:82
Leosac::Audit::Factory::CredentialEventPtr
static ICredentialEventPtr CredentialEventPtr(const DBPtr &database, Cred::ICredentialPtr target_cred, IAuditEntryPtr parent)
Definition: AuditFactory.cpp:98