use of org.graylog2.plugin.lookup.LookupCacheConfiguration in project graylog2-server by Graylog2.
the class LookupCacheFacade method decode.
private NativeEntity<CacheDto> decode(EntityV1 entity, Map<String, ValueReference> parameters) {
final LookupCacheEntity lookupCacheEntity = objectMapper.convertValue(entity.data(), LookupCacheEntity.class);
final LookupCacheConfiguration configuration = objectMapper.convertValue(toValueMap(lookupCacheEntity.configuration(), parameters), LookupCacheConfiguration.class);
final CacheDto cacheDto = CacheDto.builder().name(lookupCacheEntity.name().asString(parameters)).title(lookupCacheEntity.title().asString(parameters)).description(lookupCacheEntity.description().asString(parameters)).config(configuration).build();
final CacheDto savedCacheDto = cacheService.save(cacheDto);
return NativeEntity.create(entity.id(), savedCacheDto.id(), TYPE_V1, savedCacheDto.title(), savedCacheDto);
}
Aggregations