title: Understanding DataSource concept
body: <p>I'm designing an interface that's going to represent a collection of identifiers of some entities. Going through two similat interfaces jdk provides us with (javadoc ommited):</p>
  
  <p><code>javax.sql.DataSource</code>:</p>
  
  <pre><code>public interface DataSource  extends CommonDataSource,Wrapper {
  
    Connection getConnection() throws SQLException;
  
  
    Connection getConnection(String username, String password)
      throws SQLException;
  
  }
  </code></pre>
  
  <p>and <code>javax.activation.DataSource</code>:</p>
  
  <pre><code>public interface DataSource {
  
      public InputStream getInputStream() throws IOException;
  
      public OutputStream getOutputStream() throws IOException;
  
      public String getContentType();
  
      public String getName();
  }
  </code></pre>
  
  <p>I decided to write something like that:</p>
  
  <pre><code>public interface FilterDataSource{
  
      public List&lt;Integer&gt; getIdentifiers();
  
  }
  </code></pre>
  
  <p>The interface (I called it <code>FilterDataSource</code>, where <code>Filter</code> is an entity) may have at least two different implementation <code>SqlFilterDataSource</code> and <code>WebApplicationGlobalCacheFilterDataSource</code> (they will be created within an <code>IoC</code> container).</p>
  
  <p>My question is about the interface. Is that correct to use <code>DataSource</code> concept in such a case and if so, how should I redesign it (If it needed).</p>