Class JDBCJNDIDataStoreFactory

    • Constructor Detail

    • Method Detail

      • getDriverClassName

        protected String getDriverClassName()
        Override which explicitly returns null because with a JNDI connection the driver is not known ahead of time.
        Specified by:
        getDriverClassName in class JDBCDataStoreFactory
      • getValidationQuery

        protected String getValidationQuery()
        Override which explicitly returns null, validation queries are not supported, my be part of the external data source configuration
        Specified by:
        getValidationQuery in class JDBCDataStoreFactory
      • getJDBCUrl

        protected String getJDBCUrl​(Map<String,​?> params)
                             throws IOException
        Override which explicitly returns null since there is no jdbc url, the connection is identified by the JNDI name.
        Overrides:
        getJDBCUrl in class JDBCDataStoreFactory
        Throws:
        IOException
      • createDataSource

        protected DataSource createDataSource​(Map<String,​?> params,
                                              SQLDialect dialect)
                                       throws IOException
        Override to create the datasource from the external JNDI conection.
        Overrides:
        createDataSource in class JDBCDataStoreFactory
        Throws:
        IOException
      • isAvailable

        public boolean isAvailable()
        Determines if the datastore is available.

        Check in an Initial Context is available, that is all what can be done Checking for the right jdbc jars in the classpath is not possible here

        Specified by:
        isAvailable in interface DataAccessFactory
        Overrides:
        isAvailable in class JDBCDataStoreFactory
        Returns:
        true if and only if this factory has all the appropriate jars on the classpath to create DataStores.
      • setupParameters

        protected void setupParameters​(Map<String,​Object> parameters)
        Override to omit all those parameters which define the creation of the connection.
        Overrides:
        setupParameters in class JDBCDataStoreFactory
        Parameters:
        parameters - Map of DataAccessFactory.Param objects.
      • getDescription

        public String getDescription()
        Description copied from interface: DataAccessFactory
        Describe the nature of the datasource constructed by this factory.

        A non localized description of this data store type.

        Returns:
        A human readable description that is suitable for inclusion in a list of available datasources.
      • createDataStoreInternal

        protected JDBCDataStore createDataStoreInternal​(JDBCDataStore dataStore,
                                                        Map<String,​?> params)
                                                 throws IOException
        Description copied from class: JDBCDataStoreFactory
        Subclass hook to do additional initialization of a newly created datastore.

        Typically subclasses will want to override this method in the case where they provide additional datastore parameters, those should be processed here.

        This method is provided with an instance of the datastore. In some cases subclasses may wish to create a new instance of the datastore, for instance in order to wrap the original instance. This is supported but the new datastore must be returned from this method. If not is such the case this method should still return the original passed in.

        Overrides:
        createDataStoreInternal in class JDBCDataStoreFactory
        Parameters:
        dataStore - The newly created datastore.
        params - THe datastore parameters.
        Throws:
        IOException
      • getImplementationHints

        public Map<RenderingHints.Key,​?> getImplementationHints()
        Description copied from class: JDBCDataStoreFactory
        Returns the implementation hints for the datastore.

        Subclasses may override, this implementation returns null.

        Specified by:
        getImplementationHints in interface Factory
        Overrides:
        getImplementationHints in class JDBCDataStoreFactory
        Returns:
        The map of hints, or an {@linkplain java.util.Collections.emptyMap() empty map} if none.