/** * Gets the property. * * @param prop * the prop * @return the property */ public String getProperty(String prop) { // assuming Properties are initialized with this call return prop != null ? getProperties().getProperty(prop) : null; }
public static boolean isShowQueryEnabled(final Map<String, Object> properties, final String persistenceUnit, final KunderaMetadata kunderaMetadata) { boolean showQuery = false; showQuery = properties != null ? Boolean.parseBoolean((String) properties .get(PersistenceProperties.KUNDERA_SHOW_QUERY)) : false; if (!showQuery) { showQuery = persistenceUnit != null ? Boolean.parseBoolean(kunderaMetadata.getApplicationMetadata() .getPersistenceUnitMetadata(persistenceUnit).getProperties() .getProperty(PersistenceProperties.KUNDERA_SHOW_QUERY)) : false; } return showQuery; }
public static String getKeyspace(final KunderaMetadata kunderaMetadata, String persistenceUnit) { PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata() .getPersistenceUnitMetadata(persistenceUnit); Properties props = persistenceUnitMetadata.getProperties(); String keyspace = (String) props.get(PersistenceProperties.KUNDERA_KEYSPACE); return keyspace; }
protected void buildHosts(String hosts, String portAsString, List<Host> hostsList) { String[] hostVals = hosts.split(","); List<CassandraHost> cassandraHosts = new CopyOnWriteArrayList<CassandraHost>(); for (int x = 0; x < hostVals.length; x++) { String host = hostVals[x].trim(); portAsString = portAsString.trim(); onValidation(host, portAsString); int port = Integer.parseInt(portAsString); CassandraHost cassandraHost = port == CassandraHost.DEFAULT_PORT ? new CassandraHost(host) : new CassandraHost(host, port); setConfig(cassandraHost, persistenceUnitMetadata.getProperties(), externalProperties); cassandraHosts.add(cassandraHost); hostsList.add(cassandraHost); } }
protected void buildHosts(String hosts, String portAsString, List<Host> hostsList) { String[] hostVals = hosts.split(","); List<OracleNoSQLHost> oracleNoSqlHosts = new CopyOnWriteArrayList<OracleNoSQLHost>(); for (int x = 0; x < hostVals.length; x++) { String host = hostVals[x].trim(); portAsString = portAsString.trim(); onValidation(host, portAsString); int port = Integer.parseInt(portAsString); OracleNoSQLHost oracleNoSQLHost = port == OracleNoSQLHost.DEFAULT_PORT ? new OracleNoSQLHost(host) : new OracleNoSQLHost(host, port); setConfig(oracleNoSQLHost, persistenceUnitMetadata.getProperties(), externalProperties); oracleNoSqlHosts.add(oracleNoSQLHost); hostsList.add(oracleNoSQLHost); } }
/** * Gets the properties. * * @param persistenceUnit * the persistence unit * @return the properties */ static final Properties getProperties(final KunderaMetadata kunderaMetadata, final String persistenceUnit) { PersistenceUnitMetadata persistenceUnitMetadatata = kunderaMetadata.getApplicationMetadata() .getPersistenceUnitMetadata(persistenceUnit); Properties props = persistenceUnitMetadatata.getProperties(); return props; }
List<MongoCredential> credentials = MongoDBUtils.fetchCredentials(puMetadata.getProperties(), externalProperties); ServerAddress addr;
/** * Reads property file which is given in persistence unit * * @param pu */ public void read(String pu) { String propertyFileName = null; if (puMetadata.getProperties() != null && puMetadata.getProperties().containsKey(PersistenceProperties.KUNDERA_CLIENT_PROPERTY)) { propertyFileName = (String) puMetadata.getProperties().get(PersistenceProperties.KUNDERA_CLIENT_PROPERTY); } if (externalProperties != null && externalProperties.containsKey(PersistenceProperties.KUNDERA_CLIENT_PROPERTY)) { propertyFileName = (String) externalProperties.get(PersistenceProperties.KUNDERA_CLIENT_PROPERTY); } if (propertyFileName == null) { propertyFileName = puMetadata != null ? puMetadata .getProperty(PersistenceProperties.KUNDERA_CLIENT_PROPERTY) : null; } if (propertyFileName != null && PropertyType.value(propertyFileName) != null && PropertyType.value(propertyFileName).equals(PropertyType.xml)) { onXml(onParseXML(propertyFileName, puMetadata)); } }
Properties props = persistenceUnitMetadata.getProperties(); this.externalProperties = externalProperties; String hosts = null;
/** * Export schema handles the handleOperation method. * * @param hbase */ protected void exportSchema(final String persistenceUnit, List<TableInfo> tables) { // Get persistence unit metadata this.puMetadata = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit); String paramString = externalProperties != null ? (String) externalProperties .get(PersistenceProperties.KUNDERA_CLIENT_FACTORY) : null; if (clientFactory != null && ((clientFactory.equalsIgnoreCase(puMetadata.getProperties().getProperty( PersistenceProperties.KUNDERA_CLIENT_FACTORY))) || (paramString != null && clientFactory .equalsIgnoreCase(paramString)))) { readConfigProperties(puMetadata); // invoke handle operation. if (operation != null && initiateClient()) { tableInfos = tables; handleOperations(tables); } } }
@Override protected Client instantiateClient(String persistenceUnit) { String indexerClass = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(getPersistenceUnit()) .getProperties().getProperty(PersistenceProperties.KUNDERA_INDEXER_CLASS); Client client = new OracleNoSQLClient(this, reader, indexManager, kvStore, externalProperties, getPersistenceUnit(), kunderaMetadata); populateIndexer(indexerClass, client); return client; }
.getPersistenceUnitMetadata(getPersistenceUnit()); Properties props = persistenceUnitMetadata.getProperties();
@Override public void initialize(Map<String, Object> puProperties) { reader = new KuduDBEntityReader(kunderaMetadata); setExternalProperties(puProperties); initializePropertyReader(); PersistenceUnitMetadata pum = kunderaMetadata.getApplicationMetadata() .getPersistenceUnitMetadata(getPersistenceUnit()); Properties pumProps = pum.getProperties(); if (puProperties != null) { pumProps.putAll(puProperties); } String kuduMasterHost = (String) pumProps.getProperty("kundera.nodes"); String kuduMasterPort = (String) pumProps.getProperty("kundera.port"); if (kuduMasterHost == null || kuduMasterPort == null) { throw new KunderaException("Hostname/IP or Port is null."); } kuduClient = new KuduClient.KuduClientBuilder(kuduMasterHost + ":" + kuduMasterPort).build(); }
@Override public void initialize(Map<String, Object> puProperties) { reader = new RethinkDBEntityReader(kunderaMetadata); setExternalProperties(puProperties); initializePropertyReader(); PersistenceUnitMetadata pum = kunderaMetadata.getApplicationMetadata() .getPersistenceUnitMetadata(getPersistenceUnit()); Properties pumProps = pum.getProperties(); if (puProperties != null) { pumProps.putAll(puProperties); } String host = pumProps.getProperty("kundera.nodes"); String port = pumProps.getProperty("kundera.port"); if (host == null || port == null) { throw new KunderaException("Hostname/IP or Port is null."); } connection = r.connection().hostname(host).port(Integer.parseInt(port)).connect(); }
.getProperties().getProperty(PersistenceProperties.KUNDERA_KEYSPACE); PoolConfiguration prop = new PoolProperties(); prop.setHost(cassandraHost.getHost());
@Override public void initialize(Map<String, Object> puProperties) { reader = new CouchbaseEntityReader(kunderaMetadata); setExternalProperties(puProperties); initializePropertyReader(); PersistenceUnitMetadata pum = kunderaMetadata.getApplicationMetadata() .getPersistenceUnitMetadata(getPersistenceUnit()); Properties pumProps = pum.getProperties(); if (puProperties != null) { pumProps.putAll(puProperties); } String host = pumProps.getProperty("kundera.nodes"); String keyspace = pumProps.getProperty("kundera.keyspace"); if (host == null) { throw new KunderaException("Hostname/IP is null."); } if (keyspace == null) { throw new KunderaException("kundera.keyspace is null."); } cluster = CouchbaseCluster.create(splitHostNames(host)); String password = ((CouchbasePropertyReader) propertyReader).csmd.getBucketProperty("bucket.password"); bucket = CouchbaseBucketUtils.openBucket(cluster, keyspace, password); }
Assert.assertNull(puMetadata.getNewTempClassLoader()); Assert.assertNotNull(puMetadata.getMappedUrl()); Assert.assertNotNull(puMetadata.getProperties()); Assert.assertTrue(puMetadata.getExcludeUnlistedClasses()); Assert.assertTrue(puMetadata.excludeUnlistedClasses());
metadata.getProperties().putAll(puInfo.getProperties());
/** * Instantiates a new ES client. * * @param factory * the factory * @param client * the client * @param externalProperties * the external properties * @param kunderaMetadata * the kundera metadata * @param persistenceUnit * the persistence unit */ ESClient(final ESClientFactory factory, final TransportClient client, final Map<String, Object> externalProperties, final KunderaMetadata kunderaMetadata, final String persistenceUnit) { super(kunderaMetadata, externalProperties, persistenceUnit); this.factory = factory; this.clientMetadata = factory.getClientMetadata(); this.txClient = client; this.reader = new ESEntityReader(kunderaMetadata); setBatchSize(getPersistenceUnit(), externalProperties); setRefreshIndexes( kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit).getProperties(), externalProperties); }
.getProperties(); String keyspace = null; if (externalProperties != null)