public DocumentStoreConfiguration(ConfigurationPropertyReader propertyReader, int defaultPort) { String host = propertyReader.property( OgmProperties.HOST, String.class ) .withDefault( DEFAULT_HOST ) .getValue(); Integer port = propertyReader.property( OgmProperties.PORT, Integer.class ) .withValidator( Validators.PORT ) .withDefault( null ) .getValue(); hosts = HostParser.parse( host, port, defaultPort ); this.nativeClientResource = propertyReader.property( OgmProperties.NATIVE_CLIENT_RESOURCE, String.class ) .withDefault( null ) .getValue(); PropertyReaderContext<String> databaseNamePropertyReader = propertyReader.property( OgmProperties.DATABASE, String.class ); if ( nativeClientResource == null ) { // Require databaseName property, if nativeClientResource is not defined databaseNamePropertyReader.required(); } this.databaseName = databaseNamePropertyReader.getValue(); this.username = propertyReader.property( OgmProperties.USERNAME, String.class ).getValue(); this.password = propertyReader.property( OgmProperties.PASSWORD, String.class ).getValue(); this.createDatabase = propertyReader.property( OgmProperties.CREATE_DATABASE, boolean.class ) .withDefault( false ) .getValue(); }
public RemoteNeo4jConfiguration(ConfigurationPropertyReader propertyReader, int defaultPort) { String host = propertyReader.property( OgmProperties.HOST, String.class ) .withDefault( DEFAULT_HOST ) .getValue(); Integer port = propertyReader.property( OgmProperties.PORT, Integer.class ) .withValidator( Validators.PORT ) .withDefault( null ) .getValue(); this.hosts = HostParser.parse( host, port, defaultPort ); this.databaseName = propertyReader.property( OgmProperties.DATABASE, String.class ) .withDefault( DEFAULT_DB ) .getValue(); this.username = propertyReader.property( OgmProperties.USERNAME, String.class ).getValue(); this.password = propertyReader.property( OgmProperties.PASSWORD, String.class ).getValue(); this.socketTimeout = propertyReader.property( Neo4jProperties.SOCKET_TIMEOUT, Long.class ).getValue(); this.establishConnectionTimeout = propertyReader.property( Neo4jProperties.ESTABLISH_CONNECTION_TIMEOUT, Long.class ).getValue(); this.connectionCheckoutTimeout = propertyReader.property( Neo4jProperties.CONNECTION_CHECKOUT_TIMEOUT, Long.class ).getValue(); this.connectionTTL = propertyReader.property( Neo4jProperties.CONNECTION_TTL, Long.class ).getValue(); this.createDatabase = propertyReader.property( OgmProperties.CREATE_DATABASE, boolean.class ) .withDefault( false ) .getValue(); this.authenticationRequired = this.username != null; this.clientPoolSize = propertyReader.property( Neo4jProperties.CONNECTION_POOL_SIZE, Integer.class ) .withDefault( DEFAULT_CONNECTION_POOL_SIZE ).getValue(); this.nativeClientResource = propertyReader.property( OgmProperties.NATIVE_CLIENT_RESOURCE, String.class ) .withDefault( null ) .getValue(); }
.property( InfinispanRemoteProperties.SCHEMA_FILE_NAME, String.class ) .withDefault( InfinispanRemoteProperties.DEFAULT_SCHEMA_FILE_NAME ) .withValidator( InfinispanRemoteValidators.SCHEMA_FILE_NAME ) .getValue();