Class DbFileStorePlugin
- java.lang.Object
-
- io.vertigo.datastore.plugins.filestore.db.DbFileStorePlugin
-
- All Implemented Interfaces:
io.vertigo.core.node.component.Activeable,io.vertigo.core.node.component.CoreComponent,io.vertigo.core.node.component.Plugin,FileStorePlugin
public final class DbFileStorePlugin extends Object implements FileStorePlugin, io.vertigo.core.node.component.Activeable
Permet de gérer les accès atomiques à n'importe quel type de stockage SQL/ non SQL pour les traitements de FileInfo.- Author:
- pchretien, npiedeloup
-
-
Constructor Summary
Constructors Constructor Description DbFileStorePlugin(Optional<String> name, String storeDtDefinitionName, String fileInfoClassName)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckDefinitionStoreBinding(FileInfoDefinition fileInfoDefinition)Check this store is the good one for this definition.protected voidcheckReadonly()Check readonly.FileInfocreate(FileInfo fileInfo)Save a file.voiddelete(FileInfoURI uri)Delete a file.protected static EntityStoreManagergetEntityStoreManager()Class<? extends FileInfo>getFileInfoClass()Get's the FileInfo Class that are handled by the particular pluginStringgetFileInfoClassName()StringgetName()protected static <V> VgetValue(DtObject dto, DtFieldName fieldName, Class<V> valueClass)Retourne une valeur d'un champ à partir du DtObject.FileInforead(FileInfoURI uri)Load a file by its URI.protected static voidsetIdValue(DtObject dto, FileInfoURI uri)protected static voidsetValue(DtObject dto, DtFieldName fieldName, Object value)Fixe une valeur d'un champ d'un DtObject.voidstart()voidstop()voidupdate(FileInfo fileInfo)Save a file.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.vertigo.datastore.impl.filestore.FileStorePlugin
getName
-
-
-
-
Method Detail
-
start
public void start()
- Specified by:
startin interfaceio.vertigo.core.node.component.Activeable
-
stop
public void stop()
- Specified by:
stopin interfaceio.vertigo.core.node.component.Activeable
-
read
public FileInfo read(FileInfoURI uri)
Load a file by its URI.- Specified by:
readin interfaceFileStorePlugin- Parameters:
uri- FileURI requested- Returns:
- FileInfo for this uri (null if not found).
-
create
public FileInfo create(FileInfo fileInfo)
Save a file. Input FileInfo must have an empty URI : insert mode- Specified by:
createin interfaceFileStorePlugin- Parameters:
fileInfo- File to save (creation)- Returns:
- the created FileInfo
-
update
public void update(FileInfo fileInfo)
Save a file. Input FileInfo must have an URI : update mode- Specified by:
updatein interfaceFileStorePlugin- Parameters:
fileInfo- File to save (modification)
-
delete
public void delete(FileInfoURI uri)
Delete a file.- Specified by:
deletein interfaceFileStorePlugin- Parameters:
uri- File's URI to remove
-
getFileInfoClass
public Class<? extends FileInfo> getFileInfoClass()
Description copied from interface:FileStorePluginGet's the FileInfo Class that are handled by the particular plugin- Specified by:
getFileInfoClassin interfaceFileStorePlugin- Returns:
-
getName
public String getName()
- Returns:
- This store name
-
getFileInfoClassName
public String getFileInfoClassName()
- Returns:
- the fileInfo className
-
checkReadonly
protected void checkReadonly()
Check readonly.
-
checkDefinitionStoreBinding
protected void checkDefinitionStoreBinding(FileInfoDefinition fileInfoDefinition)
Check this store is the good one for this definition.- Parameters:
fileInfoDefinition- Definition du FileInfo
-
getValue
protected static <V> V getValue(DtObject dto, DtFieldName fieldName, Class<V> valueClass)
Retourne une valeur d'un champ à partir du DtObject.- Type Parameters:
V- Type de la valeur *- Parameters:
dto- DtObjectfieldName- Nom du champvalueClass- Type du champ- Returns:
- Valeur typé du champ
-
setValue
protected static void setValue(DtObject dto, DtFieldName fieldName, Object value)
Fixe une valeur d'un champ d'un DtObject.- Parameters:
dto- DtObjectfieldName- Nom du champsvalue- Valeur
-
setIdValue
protected static void setIdValue(DtObject dto, FileInfoURI uri)
- Parameters:
dto- DtObjectvalue- Pk value
-
getEntityStoreManager
protected static EntityStoreManager getEntityStoreManager()
- Returns:
- StoreManager
-
-