![]() |
Leosac
0.8.0
Open Source Access Control
|
Provides an implementation of IDoorEvent. More...
#include <DoorEvent.hpp>
Inheritance diagram for Leosac::Audit::DoorEvent:
Collaboration diagram for Leosac::Audit::DoorEvent:Public Member Functions | |
| virtual | ~DoorEvent ()=default |
| virtual void | target (Auth::IDoorPtr door) override |
| Set the door that is targeted by the event. More... | |
| virtual Auth::DoorId | target_id () const override |
| virtual void | before (const std::string &repr) override |
| An optional JSON representation of the object before the event took place. More... | |
| virtual void | after (const std::string &repr) override |
| An optional JSON representation of the object after the event took place. More... | |
| virtual const std::string & | before () const override |
| virtual const std::string & | after () const override |
| virtual Auth::AccessPointId | access_point_id_before () const override |
| Return the id of the associated access_point before the event took place. More... | |
| virtual void | access_point_id_before (Auth::AccessPointId id) override |
| virtual Auth::AccessPointId | access_point_id_after () const override |
| Return the id of the associated access_point after the event took place. More... | |
| virtual void | access_point_id_after (Auth::AccessPointId id) override |
| virtual std::string | generate_description () const override |
| Generate a description for this event. More... | |
| std::string | generate_target_description () const |
| Generate a short description for the targeted door. More... | |
Public Member Functions inherited from Leosac::Audit::IDoorEvent | |
| MAKE_VISITABLE () | |
Public Member Functions inherited from Leosac::Audit::IAuditEntry | |
| MAKE_VISITABLE () | |
Public Member Functions inherited from Leosac::Tools::IVisitable | |
| virtual void | accept (::Leosac::Tools::BaseVisitor &)=0 |
Accept a visitor that may mutate this. More... | |
| virtual void | accept (::Leosac::Tools::BaseVisitor &) const =0 |
Accept a visitor that will not mutate this. More... | |
Public Member Functions inherited from Leosac::Audit::AuditEntry | |
| AuditEntry (const AuditEntry &)=delete | |
| virtual | ~AuditEntry ()=default |
| virtual AuditEntryId | id () const override |
| Retrieve the identifier of the entry. More... | |
| virtual void | finalize () override |
| Mark the entry as finalized, and update it wrt the database. More... | |
| virtual bool | finalized () const override |
| Is this entry finalized. More... | |
| virtual void | event_mask (const EventMask &mask) override |
| Set the event mask for the entry. More... | |
| virtual const EventMask & | event_mask () const override |
| Retrieve the current event mask. More... | |
| virtual void | author (Auth::UserPtr user) override |
| Set the author of the entry. More... | |
| virtual Auth::UserId | author_id () const override |
| Retrieve the user id of the author of this entry. More... | |
| virtual void | set_parent (IAuditEntryPtr parent) override |
Set parent as the parent audit entry for this entry. More... | |
| virtual IAuditEntryPtr | parent () const override |
| Retrieve the parent of this entry. More... | |
| virtual void | remove_parent () override |
| Remove the parent-child relationship between this entry and its parent. More... | |
| virtual size_t | children_count () const override |
| Returns the number of children that this entry has. More... | |
| virtual size_t | version () const override |
| Returns the ODB version of the object. More... | |
| virtual void | reload () override |
| Reload the object from the database. More... | |
| virtual boost::posix_time::ptime | timestamp () const override |
| Retrieve unix timestamp. More... | |
| void | database (DBPtr db) |
| Set the database pointer. More... | |
Static Public Member Functions | |
| static std::shared_ptr< DoorEvent > | create_empty () |
Static Public Member Functions inherited from Leosac::Audit::AuditEntry | |
| static AuditEntryPtr | get_last_audit (DBPtr db) |
| Retrieve the last (finalized) audit entry. More... | |
Public Attributes | |
| Auth::DoorLWPtr | target_ |
| Auth::DoorId | target_door_id_ |
| std::string | before_ |
| Optional JSON dump of the object before the event took place. More... | |
| std::string | after_ |
| Optional JSON dump of the object after the event took place. More... | |
| Auth::AccessPointId | access_point_id_before_ |
| The id of the associated AP before the event. More... | |
| Auth::AccessPointId | access_point_id_after_ |
| The id of associated AP after the event. More... | |
Private Member Functions | |
| DoorEvent () | |
Static Private Member Functions | |
| static std::shared_ptr< DoorEvent > | create (const DBPtr &database, Auth::IDoorPtr target_door, AuditEntryPtr parent) |
Friends | |
| class | Factory |
| class | odb::access |
Additional Inherited Members | |
Protected Member Functions inherited from Leosac::Audit::AuditEntry | |
| AuditEntry () | |
Static Protected Member Functions inherited from Leosac::Tools::IVisitable | |
| template<class T > | |
| static bool | visitor_dispatch (T &visited, BaseVisitor &visitor, bool abort_on_failure) |
Protected Attributes inherited from Leosac::Audit::AuditEntry | |
| AuditEntryWPtr | parent_ |
| std::string | msg_ |
| Auth::UserLPtr | author_ |
| The user at the source of the entry. More... | |
| EventMask | event_mask_ |
| size_t | duration_ |
| How long did it take for the Audit object to be finalized. More... | |
| bool | finalized_ |
| Audit entry are sometime persisted multiple time before reaching their final state. More... | |
| DBPtr | database_ |
| Pointer to the database. More... | |
| Tools::ElapsedTimeCounter | etc_ |
| Keep track of how long the object has been alive. More... | |
Provides an implementation of IDoorEvent.
Definition at line 33 of file DoorEvent.hpp.
|
private |
Definition at line 31 of file DoorEvent.cpp.
|
virtualdefault |
|
overridevirtual |
Return the id of the associated access_point after the event took place.
Implements Leosac::Audit::IDoorEvent.
Definition at line 145 of file DoorEvent.cpp.
|
overridevirtual |
Implements Leosac::Audit::IDoorEvent.
Definition at line 150 of file DoorEvent.cpp.
|
overridevirtual |
Return the id of the associated access_point before the event took place.
Implements Leosac::Audit::IDoorEvent.
Definition at line 135 of file DoorEvent.cpp.
|
overridevirtual |
Implements Leosac::Audit::IDoorEvent.
Definition at line 140 of file DoorEvent.cpp.
|
overridevirtual |
Implements Leosac::Audit::IDoorEvent.
Definition at line 99 of file DoorEvent.cpp.
|
overridevirtual |
An optional JSON representation of the object after the event took place.
Implements Leosac::Audit::IDoorEvent.
Definition at line 81 of file DoorEvent.cpp.
|
overridevirtual |
Implements Leosac::Audit::IDoorEvent.
Definition at line 94 of file DoorEvent.cpp.
|
overridevirtual |
An optional JSON representation of the object before the event took place.
Implements Leosac::Audit::IDoorEvent.
Definition at line 75 of file DoorEvent.cpp.
|
staticprivate |
Definition at line 38 of file DoorEvent.cpp.
|
static |
Definition at line 130 of file DoorEvent.cpp.
|
overridevirtual |
Generate a description for this event.
todo: should be pure virtual
Reimplemented from Leosac::Audit::IAuditEntry.
Definition at line 104 of file DoorEvent.cpp.
| std::string DoorEvent::generate_target_description | ( | ) | const |
Generate a short description for the targeted door.
Definition at line 118 of file DoorEvent.cpp.
|
overridevirtual |
Set the door that is targeted by the event.
Implements Leosac::Audit::IDoorEvent.
Definition at line 63 of file DoorEvent.cpp.
|
overridevirtual |
Implements Leosac::Audit::IDoorEvent.
Definition at line 87 of file DoorEvent.cpp.
|
friend |
Definition at line 38 of file DoorEvent.hpp.
|
friend |
Definition at line 107 of file DoorEvent.hpp.
| Auth::AccessPointId Leosac::Audit::DoorEvent::access_point_id_after_ |
The id of associated AP after the event.
Definition at line 105 of file DoorEvent.hpp.
| Auth::AccessPointId Leosac::Audit::DoorEvent::access_point_id_before_ |
The id of the associated AP before the event.
Definition at line 98 of file DoorEvent.hpp.
| std::string Leosac::Audit::DoorEvent::after_ |
Optional JSON dump of the object after the event took place.
Definition at line 89 of file DoorEvent.hpp.
| std::string Leosac::Audit::DoorEvent::before_ |
Optional JSON dump of the object before the event took place.
Definition at line 84 of file DoorEvent.hpp.
| Auth::DoorLWPtr Leosac::Audit::DoorEvent::target_ |
Definition at line 77 of file DoorEvent.hpp.
| Auth::DoorId Leosac::Audit::DoorEvent::target_door_id_ |
Definition at line 79 of file DoorEvent.hpp.