package com.l7tech.gateway.common.log;

import com.l7tech.gateway.common.admin.Administrative;
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.Goid;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import java.util.Collection;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class, noRollbackFor = FindException.class)
@Administrative
@Secured(types = EntityType.LOG_SINK)
public interface LogSinkAdmin extends LogAccessAdmin {
   String ROLE_NAME_TYPE_SUFFIX = "Log Sink";

   @Transactional(readOnly = true)
   @Administrative(background = true)
   @Secured(types = EntityType.LOG_SINK, stereotype = MethodStereotype.FIND_ENTITIES)
   Collection<SinkConfiguration> findAllSinkConfigurations() throws FindException;

   @Transactional(readOnly = true)
   @Secured(types = EntityType.LOG_SINK, stereotype = MethodStereotype.FIND_ENTITIES)
   SinkConfiguration getSinkConfigurationByPrimaryKey(Goid var1) throws FindException;

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

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

   @Secured(stereotype = MethodStereotype.TEST_CONFIGURATION)
   boolean sendTestSyslogMessage(SinkConfiguration var1, String var2);

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   long getReservedFileSize();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   long getMaximumFileSize();

   @Transactional(readOnly = true)
   @Secured(types = EntityType.LOG_SINK, stereotype = MethodStereotype.ENTITY_OPERATION, relevantArg = 1, otherOperation = "log-viewer")
   @Override
   Collection<LogFileInfo> findAllFilesForSinkByNode(String var1, Goid var2) throws FindException;

   @Administrative(background = true)
   @Transactional(readOnly = true)
   @Secured(types = EntityType.LOG_SINK, stereotype = MethodStereotype.ENTITY_OPERATION, relevantArg = 1, otherOperation = "log-viewer")
   @Override
   LogSinkData getSinkLogs(String var1, Goid var2, String var3, LogSinkQuery var4) throws FindException;
}
