package com.l7tech.gateway.common.cassandra;

import com.l7tech.gateway.common.AsyncAdminMethods;
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 com.l7tech.util.ConfigFactory;
import java.util.List;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
@Secured(types = EntityType.CASSANDRA_CONFIGURATION)
@Administrative
public interface CassandraConnectionManagerAdmin extends AsyncAdminMethods {
   int MAX_QUERY_LENGTH = ConfigFactory.getIntProperty("com.l7tech.cassandraquery.maxquerylength", 4096);
   int UPPER_BOUND_MAX_RECORDS = ConfigFactory.getIntProperty("com.l7tech.cassandraquery.maxrecords.upperbound", 10000);

   @Transactional(readOnly = true)
   @Secured(types = EntityType.CASSANDRA_CONFIGURATION, stereotype = MethodStereotype.FIND_ENTITY)
   CassandraConnection getCassandraConnection(String var1) throws FindException;

   @Transactional(readOnly = true)
   @Secured(types = EntityType.CASSANDRA_CONFIGURATION, stereotype = MethodStereotype.FIND_ENTITIES)
   List<CassandraConnection> getAllCassandraConnections() throws FindException;

   @Transactional(readOnly = true)
   @Secured(stereotype = MethodStereotype.UNCHECKED_WIDE_OPEN)
   List<String> getAllCassandraConnectionNames() throws FindException;

   @Secured(types = EntityType.CASSANDRA_CONFIGURATION, stereotype = MethodStereotype.SAVE_OR_UPDATE)
   Goid saveCassandraConnection(CassandraConnection var1) throws UpdateException, SaveException;

   @Secured(types = EntityType.CASSANDRA_CONFIGURATION, stereotype = MethodStereotype.DELETE_ENTITY)
   void deleteCassandraConnection(CassandraConnection var1) throws DeleteException;

   @Transactional(readOnly = true)
   @Secured(types = EntityType.CASSANDRA_CONFIGURATION, stereotype = MethodStereotype.TEST_CONFIGURATION)
   AsyncAdminMethods.JobId<String> testCassandraConnection(CassandraConnection var1);

   @Transactional(readOnly = true)
   @Secured(types = EntityType.CASSANDRA_CONFIGURATION, stereotype = MethodStereotype.TEST_CONFIGURATION)
   AsyncAdminMethods.JobId<String> testCassandraQuery(String var1, String var2, long var3);

   @Transactional(readOnly = true)
   @Secured(types = EntityType.CASSANDRA_CONFIGURATION, stereotype = MethodStereotype.TEST_CONFIGURATION)
   String testQuery(String var1, String var2, long var3);
}
