Package one.microstream.storage.types
Class StorageLockedFile.Default
- java.lang.Object
-
- one.microstream.storage.types.StorageLockedFile.Default
-
- All Implemented Interfaces:
StorageFile
,StorageLockedFile
- Direct Known Subclasses:
StorageInventoryFile.Default
- Enclosing interface:
- StorageLockedFile
public static class StorageLockedFile.Default extends Object implements StorageLockedFile
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface one.microstream.storage.types.StorageLockedFile
StorageLockedFile.Default
-
-
Constructor Summary
Constructors Constructor Description Default()
-
Method Summary
Modifier and Type Method Description boolean
clearUsages(StorageFileUser fileUser)
void
close()
boolean
delete()
boolean
executeIfUnsued(Consumer<? super StorageLockedFile> action)
boolean
exists()
Path
file()
FileChannel
fileChannel()
boolean
hasUsers()
String
identifier()
Returns a string uniquely identifying the file represented by this instance.String
name()
Return a compact string containing a specific, but not necessarily unique name of the file represented by this instance.String
qualifier()
Returns a string that givesStorageFile.name()
a unique identity.boolean
registerUsage(StorageFileUser fileUser)
String
toString()
boolean
tryClose()
boolean
unregisterUsage(StorageFileUser fileUser)
boolean
unregisterUsageClosing(StorageFileUser fileUser, Consumer<? super StorageLockedFile> closingAction)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface one.microstream.storage.types.StorageFile
flush, isEmpty, isOpen
-
Methods inherited from interface one.microstream.storage.types.StorageLockedFile
length
-
-
-
-
Method Detail
-
file
public final Path file()
-
fileChannel
public final FileChannel fileChannel()
- Specified by:
fileChannel
in interfaceStorageFile
-
qualifier
public String qualifier()
Description copied from interface:StorageFile
Returns a string that givesStorageFile.name()
a unique identity. Example: The parent directory path of a file.- Specified by:
qualifier
in interfaceStorageFile
-
identifier
public String identifier()
Description copied from interface:StorageFile
Returns a string uniquely identifying the file represented by this instance.- Specified by:
identifier
in interfaceStorageFile
- Returns:
- this file's unique identifier.
- See Also:
StorageFile.name()
-
name
public String name()
Description copied from interface:StorageFile
Return a compact string containing a specific, but not necessarily unique name of the file represented by this instance. Might be the same string returned byStorageFile.identifier()
.- Specified by:
name
in interfaceStorageFile
- Returns:
- this file's name.
- See Also:
StorageFile.identifier()
-
delete
public boolean delete()
- Specified by:
delete
in interfaceStorageFile
-
exists
public boolean exists()
- Specified by:
exists
in interfaceStorageFile
-
close
public final void close()
- Specified by:
close
in interfaceStorageFile
- Specified by:
close
in interfaceStorageLockedFile
-
tryClose
public final boolean tryClose()
- Specified by:
tryClose
in interfaceStorageLockedFile
-
hasUsers
public final boolean hasUsers()
- Specified by:
hasUsers
in interfaceStorageLockedFile
-
executeIfUnsued
public final boolean executeIfUnsued(Consumer<? super StorageLockedFile> action)
- Specified by:
executeIfUnsued
in interfaceStorageLockedFile
-
registerUsage
public final boolean registerUsage(StorageFileUser fileUser)
- Specified by:
registerUsage
in interfaceStorageLockedFile
-
clearUsages
public final boolean clearUsages(StorageFileUser fileUser)
- Specified by:
clearUsages
in interfaceStorageLockedFile
-
unregisterUsage
public final boolean unregisterUsage(StorageFileUser fileUser)
- Specified by:
unregisterUsage
in interfaceStorageLockedFile
-
unregisterUsageClosing
public boolean unregisterUsageClosing(StorageFileUser fileUser, Consumer<? super StorageLockedFile> closingAction)
- Specified by:
unregisterUsageClosing
in interfaceStorageLockedFile
-
-