Interface TemplateStorageProvider
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the names of all template storages which are currently registered on the associated node.Get the names of all template storages which are currently registered on the associated node.Returns the local template storage of the current node.templateStorage(@NonNull String storage) Get the template storage with the given name, this method returns null if no storage with that name is registered.
-
Method Details
-
localTemplateStorage
Returns the local template storage of the current node. This template storage is special as it is always present by default and writes all the data of a template to the local file system. This method does only throw an exception when accessing the storage if a module forcefully removed the local template storage from the node.Because this method is supposed to return a wrapper object on remote api components there is no need for an async variant of this method.
- Returns:
- the local template storage.
- Throws:
UnsupportedOperationException- if the local template storage was unregistered.
-
templateStorage
Get the template storage with the given name, this method returns null if no storage with that name is registered. Remote api components (like the wrapper) might always return a non-null value from this method, failing if methods are invoked remotely (on the associated node) on the returned storage object.The returned storage object is not stateless meaning that the storage might get closed and unregistered. Keeping an instance of a template storage object on non-remote api components is therefore not safe and should be avoided.
Because this method is supposed to return a wrapper object on remote api components there is no need for an async variant of this method.
- Parameters:
storage- the name of the storage to get.- Returns:
- the template storage with the given name, null if the storage is unknown.
- Throws:
NullPointerException- if the given storage name is null.
-
availableTemplateStorages
Get the names of all template storages which are currently registered on the associated node. This collection is not safe to cache as it contents might change without a reflection into the returned collection.Obtaining a template storage object based on the names of the template storages which are returned by this method can still evaluate in an unknown template storage.
- Returns:
- the names of all template storages which are currently registered.
-
availableTemplateStoragesAsync
Get the names of all template storages which are currently registered on the associated node. This collection is not safe to cache as it contents might change without a reflection into the returned collection.Obtaining a template storage object based on the names of the template storages which are returned by this method can still evaluate in an unknown template storage.
- Returns:
- a task completed with the names of all template storages which are currently registered.
-