001package io.ebean.plugin; 002 003import io.ebean.EbeanServer; 004import io.ebean.config.ServerConfig; 005import io.ebean.config.dbplatform.DatabasePlatform; 006 007import javax.sql.DataSource; 008import java.util.List; 009 010/** 011 * Extensions to EbeanServer API made available to plugins. 012 */ 013public interface SpiServer extends EbeanServer { 014 015 /** 016 * Return the serverConfig. 017 */ 018 ServerConfig getServerConfig(); 019 020 /** 021 * Return the DatabasePlatform for this server. 022 */ 023 DatabasePlatform getDatabasePlatform(); 024 025 /** 026 * Return all the bean types registered on this server instance. 027 */ 028 List<? extends BeanType<?>> getBeanTypes(); 029 030 /** 031 * Return the bean type for a given entity bean class. 032 */ 033 <T> BeanType<T> getBeanType(Class<T> beanClass); 034 035 /** 036 * Return the bean types mapped to the given base table. 037 */ 038 List<? extends BeanType<?>> getBeanTypes(String baseTableName); 039 040 /** 041 * Return the bean type for a given doc store queueId. 042 */ 043 BeanType<?> getBeanTypeForQueueId(String queueId); 044 045 /** 046 * Return the associated DataSource for this EbeanServer instance. 047 */ 048 DataSource getDataSource(); 049 050 /** 051 * Return the associated read only DataSource for this EbeanServer instance (can be null). 052 */ 053 DataSource getReadOnlyDataSource(); 054 055}