lintel 0.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
lintel::FilePropertyRepository Class Reference

#include <FilePropertyRepository.h>

Inheritance diagram for lintel::FilePropertyRepository:
lintel::PropertyRepository

Public Member Functions

 FilePropertyRepository (std::shared_ptr< Configuration > configuration, const std::shared_ptr< ProcessName > &processName)
 
DataStorage getDataStorage () override
 
void save (std::shared_ptr< PropertyBase > property) override
 
void save (const std::vector< std::shared_ptr< PropertyBase > > &saveProperties) override
 
std::vector< std::shared_ptr< PropertyBase > > awake () override
 
- Public Member Functions inherited from lintel::PropertyRepository
 PropertyRepository (PropertyRepositoryType type, const std::shared_ptr< Configuration > &configuration)
 
virtual ~PropertyRepository ()=default
 
PropertyRepositoryType getType () const
 
bool isShadow () const
 
bool isEnabled () const
 
bool isMutable () const
 
virtual void deleteOf (const std::vector< std::shared_ptr< PropertyBase > > &properties)
 
virtual std::vector< std::shared_ptr< PropertyBase > > allOf (const std::string &processName=".*", const std::string &className=".*", const std::string &instanceName=".*", const std::string &name=".*")
 

Detailed Description

implementation of file repository for properties This implementation works only for one process, bc. we have to make sure that only one thread access to the file to prevent race conditions. Otherwise we would have to use semaphores to protect the access. we

Constructor & Destructor Documentation

◆ FilePropertyRepository()

lintel::FilePropertyRepository::FilePropertyRepository ( std::shared_ptr< Configuration >  configuration,
const std::shared_ptr< ProcessName > &  processName 
)
explicit

Member Function Documentation

◆ awake()

std::vector< std::shared_ptr< PropertyBase > > lintel::FilePropertyRepository::awake ( )
overridevirtual

load all properties from repository and return result

Implements lintel::PropertyRepository.

◆ getDataStorage()

DataStorage lintel::FilePropertyRepository::getDataStorage ( )
overridevirtual

returns basic data storage information of repository

Implements lintel::PropertyRepository.

◆ save() [1/2]

void lintel::FilePropertyRepository::save ( const std::vector< std::shared_ptr< PropertyBase > > &  saveProperties)
overridevirtual

save saveProperties to repository

Parameters
saveProperties

Implements lintel::PropertyRepository.

◆ save() [2/2]

void lintel::FilePropertyRepository::save ( std::shared_ptr< PropertyBase >  property)
overridevirtual

save property to repository

  • saves property in file
  • waits until awake was called
  • after awake PropertyService will check which properties doesn't have a configuration and inform the PoropertyRepository
  • alternative is that the Property is changed via REST Controller In this case fswatch will notify that the file was changed and the PropertyService will be infomred about the changed data
  • in case new property is inserted. The new property will added to the end of the file.

Implements lintel::PropertyRepository.


The documentation for this class was generated from the following file: