package com.l7tech.gateway.common.admin;

import com.l7tech.gateway.common.security.rbac.MethodStereotype;
import com.l7tech.gateway.common.security.rbac.Secured;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.policy.CustomKeyValueStore;
import java.util.Collection;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
@Secured(types = EntityType.CUSTOM_KEY_VALUE_STORE)
@Administrative
public interface CustomKeyValueStoreAdmin {
   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITIES)
   @NotNull
   Collection<CustomKeyValueStore> findByKeyPrefix(@NotNull String var1) throws FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITY)
   @Nullable
   CustomKeyValueStore findByUniqueKey(@NotNull String var1) throws FindException;

   @Secured(stereotype = MethodStereotype.SAVE)
   void saveCustomKeyValue(@NotNull CustomKeyValueStore var1) throws SaveException;

   @Secured(stereotype = MethodStereotype.UPDATE)
   void updateCustomKeyValue(@NotNull CustomKeyValueStore var1) throws UpdateException;

   @Secured(stereotype = MethodStereotype.DELETE_BY_UNIQUE_ATTRIBUTE)
   void deleteCustomKeyValue(@NotNull String var1) throws DeleteException;
}
