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.ConstraintViolationException;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.objectmodel.VersionException;
import com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig;
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.ENCAPSULATED_ASSERTION)
@Administrative
public interface EncapsulatedAssertionAdmin {
   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITIES)
   @NotNull
   Collection<EncapsulatedAssertionConfig> findAllEncapsulatedAssertionConfigs() throws FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITY)
   @NotNull
   EncapsulatedAssertionConfig findByPrimaryKey(Goid var1) throws FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITY)
   @NotNull
   EncapsulatedAssertionConfig findByGuid(@NotNull String var1) throws FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITIES)
   @NotNull
   Collection<EncapsulatedAssertionConfig> findByPolicyGoid(Goid var1) throws FindException;

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

   @Secured(stereotype = MethodStereotype.SAVE_OR_UPDATE)
   Goid saveEncapsulatedAssertionConfig(@NotNull EncapsulatedAssertionConfig var1) throws SaveException, UpdateException, VersionException;

   @Secured(stereotype = MethodStereotype.DELETE_BY_ID)
   void deleteEncapsulatedAssertionConfig(Goid var1) throws FindException, DeleteException, ConstraintViolationException;
}
