Class ConnectionConfiguration

    • Field Detail

      • REASONING_SCHEMA

        public static final Option<java.lang.String> REASONING_SCHEMA
      • DATABASE

        public static final Option<java.lang.String> DATABASE
      • TX

        public static final Option<java.util.UUID> TX
      • CLIENT_BUFFER_SIZE

        public static final Option<java.lang.Integer> CLIENT_BUFFER_SIZE
      • OPTIMIZE_MIXED_UPDATES

        public static final Option<java.lang.Boolean> OPTIMIZE_MIXED_UPDATES
      • EXACT_SIZE

        public static final Option<java.lang.Boolean> EXACT_SIZE
    • Constructor Detail

      • ConnectionConfiguration

        protected ConnectionConfiguration()
      • ConnectionConfiguration

        protected ConnectionConfiguration​(Options theOptions)
    • Method Detail

      • reasoning

        public ConnectionConfiguration reasoning​(boolean theReasoningFlag)
        Specify whether you would like the connection to utilize reasoning. If the reasoning schema was explicitly set via the schema(String) function beforehand then calling reasoning(true) will have no effect. If schema is not set then calling reasoning(true) is equivalent to setting the schema to the default schema. Calling reasoning(false) is always equivalent to setting the schema to the null schema.
        Parameters:
        theReasoningFlag - the reasoning flag
        Returns:
        this configuration
      • schema

        public ConnectionConfiguration schema​(java.lang.String theSchema)
        Specify the reasoning schema that will be used by connection. If the schema is specified with this function then you do not need to call reasoning(boolean).
        Parameters:
        theSchema - the name of the schema
        Returns:
        this query
      • exactSize

        public ConnectionConfiguration exactSize​(boolean theExactSize)
        Specify whether size() calls on the connection must return accurate values.
        Parameters:
        theExactSize - the exact size flag
        Returns:
        this configuration
      • database

        public ConnectionConfiguration database​(java.lang.String theDB)
        Specify the name of the db you want to connect to
        Parameters:
        theDB - the name of the database
        Returns:
        this configuration
      • with

        public ConnectionConfiguration with​(Options theOptions)
        Use the given options as parameters to the connection
        Parameters:
        theOptions - the connection options
        Returns:
        this object
      • get

        public <V> V get​(Option<V> theOption)
        Return the value of the provide connection configuration option
        Type Parameters:
        V - the option type
        Parameters:
        theOption - the value
        Returns:
        the option value, or null if it is not set
      • connect

        public Connection connect()
                           throws StardogException
        Create a connection object to the database as described by this configuration. This function does not necessarily open a network connection to the server which may happen later when the Connection is used.
        Specified by:
        connect in interface LoginConnectionConfiguration<Connection>
        Returns:
        the connection
        Throws:
        StardogException - if there was an error while opening the connection
      • at

        public static Connection at​(java.lang.String theConnectionString)
                             throws StardogException
        Open a connection to the database specified directly by the connection string which may contain connection options
        Parameters:
        theConnectionString - the connection string
        Returns:
        the connection
        Throws:
        StardogException - if there is an error connecting to the specified repository
      • from

        public static ConnectionConfiguration from​(java.lang.String theConnectionString)
        Create a SNARLConnectionConfiguration based on the full connection string. A ConnectionConfiguration is returned to give users the ability to change properties of the connection string before connecting, or to use to establish a connection pool.
        Parameters:
        theConnectionString - the connection string
        Returns:
        the configuration representing the connection string.
      • to

        public static ConnectionConfiguration to​(java.lang.String theDBName)
        Create a new configuration object for connecting to the Stardog database with the provided name
        Parameters:
        theDBName - the name
        Returns:
        a new connection configuration