Class FileReloaderUtils
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.core.util.filereloader.FileReloaderUtils
-
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Serviceable
public class FileReloaderUtils extends AbstractLogEnabled implements Component, Serviceable, Initializable
a helper to track modification of a configuration file
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classFileReloaderUtils.FileMetadatas
-
Field Summary
Fields Modifier and Type Field Description private Map<String,FileReloaderUtils.FileMetadatas>_filesprotected SourceResolver_resolverThe source resolverstatic StringROLEThe avalon role
-
Constructor Summary
Constructors Constructor Description FileReloaderUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinitialize()voidservice(ServiceManager manager)voidupdateFile(String sourceUrl, boolean forceRead, FileReloader fileReloader)Request to read/update the filevoidupdateFile(String sourceUrl, Map parameters, boolean forceRead, FileReloader fileReloader)Request to read/update the filevoidupdateFile(String sourceUrl, Map parameters, FileReloader fileReloader)Request to read/update the filevoidupdateFile(String sourceUrl, FileReloader fileReloader)Request to read/update the file-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
_resolver
protected SourceResolver _resolver
The source resolver
-
_files
private Map<String,FileReloaderUtils.FileMetadatas> _files
-
-
Constructor Detail
-
FileReloaderUtils
public FileReloaderUtils()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
updateFile
public void updateFile(String sourceUrl, FileReloader fileReloader) throws Exception
Request to read/update the file- Parameters:
sourceUrl- url of the file to readfileReloader- FileReloader that will be called to get an ID and read the file- Throws:
Exception- the source can not be read
-
updateFile
public void updateFile(String sourceUrl, boolean forceRead, FileReloader fileReloader) throws Exception
Request to read/update the file- Parameters:
sourceUrl- url of the file to readforceRead- true to force reload even if the file was not modifiedfileReloader- FileReloader that will be called to get an ID and read the file- Throws:
Exception- the source can not be read
-
updateFile
public void updateFile(String sourceUrl, Map parameters, FileReloader fileReloader) throws Exception
Request to read/update the file- Parameters:
sourceUrl- url of the file to readparameters- parameters passed to the resolver to get the file via it's url (can be null)fileReloader- FileReloader that will be called to get an ID and read the file- Throws:
Exception- the source can not be read
-
updateFile
public void updateFile(String sourceUrl, Map parameters, boolean forceRead, FileReloader fileReloader) throws Exception
Request to read/update the file- Parameters:
sourceUrl- url of the file to readparameters- parameters passed to the resolver to get the file via it's url (can be null)forceRead- true to force reload even if the file was not modifiedfileReloader- FileReloader that will be called to get an ID and read the file- Throws:
Exception- the source can not be read
-
-