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.ObjectNotFoundException;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.objectmodel.encass.EncapsulatedAssertionConfig;
import com.l7tech.objectmodel.polback.PolicyBackedService;
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.POLICY_BACKED_SERVICE)
@Administrative
public interface PolicyBackedServiceAdmin {
   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITIES)
   @NotNull
   Collection<PolicyBackedService> findAll() throws FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITIES)
   @NotNull
   Collection<PolicyBackedService> findAllForInterface(@NotNull String var1) throws FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   @NotNull
   Collection<String> findAllTemplateInterfaceNames();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   @NotNull
   Collection<EncapsulatedAssertionConfig> getInterfaceDescription(String var1) throws ObjectNotFoundException;

   @Secured(stereotype = MethodStereotype.FIND_ENTITY)
   @Nullable
   PolicyBackedService findByPrimaryKey(Goid var1) throws FindException;

   @Secured(stereotype = MethodStereotype.SAVE_OR_UPDATE)
   Goid save(PolicyBackedService var1) throws SaveException, UpdateException;

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