Class NFEAbstractDataSource

  • All Implemented Interfaces:
    NFEDataSource
    Direct Known Subclasses:
    JdbcDataSource

    public abstract class NFEAbstractDataSource
    extends java.lang.Object
    implements NFEDataSource
    This class provides an implementation of the NFEDataSource interface that will return a connection already bind to the workspace specified by the method setActiveWorkspace. The method getConnectionWihoutWorkspaceHandling has to return a simple connection that will be used by the implementation of getConnection. LIVE is used as default workspace.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getActiveWorkspace()
      Returns the active workspace.
      java.sql.Connection getConnection()
      Returns a Connection and throws the appropriate exception if it can not do so.
      abstract java.sql.Connection getConnectionWihoutWorkspaceHandling()
      Returns a database connection and throws the appropriate exception if it can not do so.
      void setActiveWorkspace​(java.lang.String workspaceName)
      Sets the active workspace that will be used by the connection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NFEAbstractDataSource

        public NFEAbstractDataSource()
    • Method Detail

      • setActiveWorkspace

        public void setActiveWorkspace​(java.lang.String workspaceName)
        Description copied from interface: NFEDataSource
        Sets the active workspace that will be used by the connection. Reload the model after to change the active workspace.
        Specified by:
        setActiveWorkspace in interface NFEDataSource
        Parameters:
        workspaceName - name of the workspace that will be used by the connection
      • getActiveWorkspace

        public java.lang.String getActiveWorkspace()
        Description copied from interface: NFEDataSource
        Returns the active workspace. The method should not return null. If the model is not version enabled then LIVE should be returned.
        Specified by:
        getActiveWorkspace in interface NFEDataSource
        Returns:
        active workspace
      • getConnectionWihoutWorkspaceHandling

        public abstract java.sql.Connection getConnectionWihoutWorkspaceHandling()
                                                                          throws InvalidDBConnectionException
        Returns a database connection and throws the appropriate exception if it can not do so.
        Returns:
        connection
        Throws:
        InvalidDBConnectionException - if the connection is not valid.