Package net.shibboleth.sp.storage.impl
Class FilesystemStorageService
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
org.opensaml.storage.AbstractStorageService
net.shibboleth.sp.storage.impl.FilesystemStorageService
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,StorageCapabilities,StorageService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanTracks use of a shared file system for capability method.private booleanWhether service is read only.private StringBase location of storage tree in filesystem. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanvoiddeleteContext(String context) booleandeleteWithVersion(long version, String context, String key) protected voidbooleanboolean<T> StorageRecord<T><T> Pair<Long,StorageRecord<T>> voidvoidsetClustered(boolean flag) Sets whether the file system is clustered.voidsetReadOnly(boolean flag) Sets whether the service should operate read-only.voidsetStorageBase(String base) Sets the base/root directory under which objects will be created and deleted.booleanvoidupdateContextExpiration(String context, Long expiration) booleanupdateExpiration(String context, String key, Long expiration) updateWithVersion(long version, String context, String key, String value, Long expiration) Methods inherited from class org.opensaml.storage.AbstractStorageService
create, create, delete, deleteWithVersion, doDestroy, getCapabilities, getCleanupInterval, getCleanupTask, getCleanupTaskTimer, getContextSize, getKeySize, getValueSize, read, setCleanupInterval, setCleanupTaskTimer, setContextSize, setKeySize, setValueSize, update, update, updateExpiration, updateWithVersion, updateWithVersionMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
clustered
private boolean clusteredTracks use of a shared file system for capability method. -
readOnly
private boolean readOnlyWhether service is read only. -
storageBase
Base location of storage tree in filesystem.
-
-
Constructor Details
-
FilesystemStorageService
public FilesystemStorageService()
-
-
Method Details
-
setClustered
public void setClustered(boolean flag) Sets whether the file system is clustered.Defaults to false.
- Parameters:
flag- flag to set
-
setReadOnly
public void setReadOnly(boolean flag) Sets whether the service should operate read-only.Defaults to false.
- Parameters:
flag- flag to set
-
setStorageBase
Sets the base/root directory under which objects will be created and deleted.Must be an absolute path.
- Parameters:
base- storage root location
-
doInitialize
- Overrides:
doInitializein classAbstractStorageService- Throws:
ComponentInitializationException
-
create
public boolean create(@Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable @Positive Long expiration) throws IOException - Throws:
IOException
-
read
@Nullable public <T> StorageRecord<T> read(@Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key) throws IOException - Throws:
IOException
-
read
@Nonnull public <T> Pair<Long,StorageRecord<T>> read(@Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, long version) throws IOException - Throws:
IOException
-
update
public boolean update(@Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable @Positive Long expiration) throws IOException - Throws:
IOException
-
updateWithVersion
public Long updateWithVersion(long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable @Positive Long expiration) throws IOException, VersionMismatchException - Throws:
IOExceptionVersionMismatchException
-
updateExpiration
public boolean updateExpiration(@Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nullable @Positive Long expiration) throws IOException - Throws:
IOException
-
delete
public boolean delete(@Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key) throws IOException - Throws:
IOException
-
deleteWithVersion
public boolean deleteWithVersion(long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key) throws IOException, VersionMismatchException - Throws:
IOExceptionVersionMismatchException
-
reap
- Throws:
IOException
-
updateContextExpiration
public void updateContextExpiration(@Nonnull @NotEmpty String context, @Nullable @Positive Long expiration) throws IOException - Throws:
IOException
-
deleteContext
- Throws:
IOException
-
isServerSide
public boolean isServerSide() -
isClustered
public boolean isClustered()
-