com.bagri.server.hazelcast.task.library.LibraryRemover Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bagri-server-hazelcast Show documentation
Show all versions of bagri-server-hazelcast Show documentation
Bagri DB Cache: Hazelcast implementation
The newest version!
package com.bagri.server.hazelcast.task.library;
import static com.bagri.server.hazelcast.serialize.TaskSerializationFactory.cli_DeleteLibraryTask;
import java.util.Map.Entry;
import com.bagri.core.system.Library;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
public class LibraryRemover extends LibraryProcessor implements IdentifiedDataSerializable {
public LibraryRemover() {
//
}
public LibraryRemover(int version, String admin) {
super(version, admin);
}
@Override
public Object process(Entry entry) {
logger.debug("process.enter; entry: {}", entry);
if (entry.getValue() != null) {
Library library = entry.getValue();
if (library.getVersion() == getVersion()) {
entry.setValue(null);
auditEntity(AuditType.delete, library);
return library;
} else {
// throw ex ?
logger.warn("process; outdated library version: {}; entry version: {}; process terminated",
getVersion(), entry.getValue().getVersion());
}
}
return null;
}
@Override
public int getId() {
return cli_DeleteLibraryTask;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy