package com.l7tech.gateway.common.transport;

import com.l7tech.common.io.PortRanges;
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.gateway.common.transport.firewall.SsgFirewallRule;
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.net.InetAddress;
import java.util.Collection;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
@Secured(types = EntityType.SSG_CONNECTOR)
@Administrative
public interface TransportAdmin {
   @Transactional(readOnly = true)
   @Secured(types = EntityType.SSG_CONNECTOR, stereotype = MethodStereotype.FIND_ENTITIES)
   Collection<SsgConnector> findAllSsgConnectors() throws FindException;

   @Transactional(readOnly = true)
   @Secured(types = EntityType.SSG_CONNECTOR, stereotype = MethodStereotype.FIND_ENTITY)
   SsgConnector findSsgConnectorByPrimaryKey(Goid var1) throws FindException;

   @Secured(stereotype = MethodStereotype.SAVE_OR_UPDATE)
   Goid saveSsgConnector(SsgConnector var1) throws SaveException, UpdateException, TransportAdmin.CurrentAdminConnectionException;

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

   @Secured(stereotype = MethodStereotype.FIND_ENTITY, types = EntityType.SSG_ACTIVE_CONNECTOR)
   @Transactional(readOnly = true)
   SsgActiveConnector findSsgActiveConnectorByPrimaryKey(Goid var1) throws FindException;

   @Secured(stereotype = MethodStereotype.FIND_ENTITY, types = EntityType.SSG_ACTIVE_CONNECTOR)
   @Transactional(readOnly = true)
   SsgActiveConnector findSsgActiveConnectorByTypeAndName(String var1, String var2) throws FindException;

   @Secured(stereotype = MethodStereotype.FIND_HEADERS, types = EntityType.SSG_ACTIVE_CONNECTOR)
   @Transactional(readOnly = true)
   Collection<SsgActiveConnector> findSsgActiveConnectorsByType(String var1) throws FindException;

   @Secured(stereotype = MethodStereotype.SAVE_OR_UPDATE, types = EntityType.SSG_ACTIVE_CONNECTOR)
   Goid saveSsgActiveConnector(SsgActiveConnector var1) throws SaveException, UpdateException;

   @Secured(stereotype = MethodStereotype.DELETE_BY_ID, types = EntityType.SSG_ACTIVE_CONNECTOR)
   void deleteSsgActiveConnector(Goid var1) throws DeleteException, FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   String[] getAllProtocolVersions(boolean var1);

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   String[] getAllCipherSuiteNames();

   @Deprecated
   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   String[] getDefaultCipherSuiteNames();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   String[] getDefaultInboundCipherSuiteNames();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   String[] getDefaultOutboundCipherSuiteNames();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   String[] getVisibleCipherSuiteNames();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   InetAddress[] getAvailableBindAddresses();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   TransportDescriptor[] getModularConnectorInfo();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   PortRanges getReservedPorts();

   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   boolean isUseIpv6();

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.FIND_ENTITY, types = EntityType.RESOLUTION_CONFIGURATION)
   ResolutionConfiguration getResolutionConfigurationByName(String var1) throws FindException;

   @Secured(stereotype = MethodStereotype.SAVE_OR_UPDATE, types = EntityType.RESOLUTION_CONFIGURATION)
   Goid saveResolutionConfiguration(ResolutionConfiguration var1) throws SaveException;

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

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   boolean isSnmpQueryEnabled();

   @Transactional(readOnly = true)
   @Secured(types = EntityType.FIREWALL_RULE, stereotype = MethodStereotype.FIND_ENTITIES)
   Collection<SsgFirewallRule> findAllFirewallRules() throws FindException;

   @Secured(types = EntityType.FIREWALL_RULE, stereotype = MethodStereotype.DELETE_BY_ID)
   void deleteFirewallRule(Goid var1) throws DeleteException, FindException, TransportAdmin.CurrentAdminConnectionException;

   @Secured(types = EntityType.FIREWALL_RULE, stereotype = MethodStereotype.SAVE_OR_UPDATE)
   Goid saveFirewallRule(SsgFirewallRule var1) throws SaveException, UpdateException, TransportAdmin.CurrentAdminConnectionException;

   class CurrentAdminConnectionException extends Exception {
      static final long serialVersionUID = 130330416835510263L;

      public CurrentAdminConnectionException(String var1) {
         super(var1);
      }
   }
}
