Package com.exedio.cope.vault
Class VaultReferenceService
java.lang.Object
com.exedio.cope.vault.VaultReferenceService
- All Implemented Interfaces:
VaultService
,AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Overrides method fromAutoCloseable
to add empty default implementation.byte[]
void
get
(String hash, OutputStream sink) long
void
purgeSchema
(JobContext ctx) Gives this service the chance to purge / cleanup whatever it needs to.boolean
put
(String hash, byte[] value, VaultPutInfo info) Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.boolean
put
(String hash, InputStream value, VaultPutInfo info) Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.boolean
put
(String hash, Path value, VaultPutInfo info) The caller must make sure, thatvalue
is not modified during the call.toString()
-
Method Details
-
purgeSchema
Description copied from interface:VaultService
Gives this service the chance to purge / cleanup whatever it needs to. Is called byModel.purgeSchema(JobContext)
. The default implementation does nothing.- Specified by:
purgeSchema
in interfaceVaultService
-
close
public void close()Description copied from interface:VaultService
Overrides method fromAutoCloseable
to add empty default implementation. Also requires implementations not to declare any checked exception to be thrown.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceVaultService
-
getMainService
-
getReferenceService
-
getLength
- Specified by:
getLength
in interfaceVaultService
- Throws:
VaultNotFoundException
-
get
- Specified by:
get
in interfaceVaultService
- Throws:
VaultNotFoundException
-
get
Description copied from interface:VaultService
Must notclose
orflush
sink
.If this method throws a
VaultNotFoundException
, it MUST not have modifiedsink
in any way. In particular it must not have written any byte tosink
.- Specified by:
get
in interfaceVaultService
- Throws:
VaultNotFoundException
IOException
-
put
Description copied from interface:VaultService
Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.- Specified by:
put
in interfaceVaultService
- Returns:
true
ifhash
has been initially stored in the vault by this call. The result is used for statistics only. If the implementation does not have this information available, simply returntrue
.
-
put
Description copied from interface:VaultService
Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.- Specified by:
put
in interfaceVaultService
- Returns:
true
ifhash
has been initially stored in the vault by this call. The result is used for statistics only. If the implementation does not have this information available, simply returntrue
.- Throws:
IOException
-
put
Description copied from interface:VaultService
The caller must make sure, thatvalue
is not modified during the call. Is not called, if service instance was created withVaultServiceParameters.isWritable()
==false.- Specified by:
put
in interfaceVaultService
- Returns:
true
ifhash
has been initially stored in the vault by this call. The result is used for statistics only. If the implementation does not have this information available, simply returntrue
.- Throws:
IOException
-
toString
-