Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
[metadata] added missing log statements
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
  • Loading branch information
Simon Kaufmann committed Mar 28, 2018
1 parent 07e4b69 commit 2b7738f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public void added(Provider<Item> provider, Item element) {
public void removed(Provider<Item> provider, Item element) {
if (managedProvider != null) {
// remove our metadata for that item
logger.debug("Item {} was removed, trying to clean up corresponding metadata", element.getUID());
((ManagedMetadataProvider) managedProvider).removeItemMetadata(element.getName());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ protected void unsetStorageService(StorageService storageService) {
/**
* Removes all metadata of a given item
*
* @param itemname the name of the item for which the meta data is to be removed.
* @param itemname the name of the item for which the metadata is to be removed.
*/
public void removeItemMetadata(@NonNull String name) {
logger.debug("Removing all metadata for item {}", name);
getAll().stream().filter(MetadataPredicates.ofItem(name)).map(Metadata::getUID).forEach(this::remove);
}

Expand Down

0 comments on commit 2b7738f

Please sign in to comment.