/** * Returns the explicit connection URL to use for this {@code Dbms} if the * user has specified one, or an empty {@code Optional} if one should be * generated automatically by the {@code DbmsType}. * * @return the explicit connection URL to use for this {@code Dbms} */ default Optional<String> getConnectionUrl() { return getAsString(CONNECTION_URL); }
/** * Returns the database username to use when connecting to the dbms. If no * username is specified, {@code empty} is returned. * * @return the database username or {@code empty} */ default Optional<String> getUsername() { return getAsString(USERNAME); }
/** * Returns the address of the database host if it is specified. The address * could be an ip-address or a hostname. If no address is specified, * {@code empty} will be returned. * * @return the address of the host or {@code empty} */ default Optional<String> getIpAddress() { return getAsString(IP_ADDRESS); }
/** * Returns the local path to the file where the data of this Dbms is stored. * The file name should be parsable using {@link Paths#get}. This property * is optional and not even supported in most database systems. * * @return the local path to the data file */ default Optional<String> getLocalPath() { return getAsString(LOCAL_PATH); }
/** * Returns the type name of the {@code DbmsType} of this {@code Dbms}. This * will be the fully qualified class name of the {@code DbmsType} * implementing class. * * @return the type name */ default String getTypeName() { return getAsString(TYPE_NAME).orElseThrow(() -> new SpeedmentConfigException( "Every " + Dbms.class.getSimpleName() + " document is required to have the '" + TYPE_NAME + "' attribute." )); }