Java Code Examples for io.pivotal.cfenv.core.CfService#existsByCredentialsContainsUriField()

The following examples show how to use io.pivotal.cfenv.core.CfService#existsByCredentialsContainsUriField() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OracleJdbcUrlCreator.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isDatabaseService(CfService cfService) {
	// Match tags
	if (jdbcUrlMatchesScheme(cfService, ORACLE_SCHEME)
			|| cfService.existsByLabelStartsWith(ORACLE_LABEL)
			|| cfService.existsByUriSchemeStartsWith(ORACLE_SCHEME)
			|| cfService.existsByCredentialsContainsUriField(ORACLE_SCHEME)) {
		return true;
	}
	return false;
}
 
Example 2
Source File: DB2JdbcUrlCreator.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isDatabaseService(CfService cfService) {
	if (jdbcUrlMatchesScheme(cfService, DB2_SCHEME)
			|| cfService.existsByTagIgnoreCase(DB2_TAGS)
			|| cfService.existsByLabelStartsWith(DB2_LABEL)
			|| cfService.existsByUriSchemeStartsWith(DB2_SCHEME)
			|| cfService.existsByCredentialsContainsUriField(DB2_SCHEME)) {
		return true;
	}
	return false;
}
 
Example 3
Source File: PostgresqlJdbcUrlCreator.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isDatabaseService(CfService cfService) {
	if (jdbcUrlMatchesScheme(cfService, POSTGRESQL_SCHEME, POSTGRES_JDBC_SCHEME)
			|| cfService.existsByTagIgnoreCase(POSTGRESQL_TAG)
			|| cfService.existsByLabelStartsWith(POSTGRESQL_LABEL)
			|| cfService.existsByUriSchemeStartsWith(POSTGRESQL_SCHEME)
			|| cfService.existsByCredentialsContainsUriField(POSTGRESQL_SCHEME)) {
		return true;
	}
	return false;
}
 
Example 4
Source File: SqlServerJdbcUrlCreator.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isDatabaseService(CfService cfService) {
	// Match tags
	return jdbcUrlMatchesScheme(cfService, SQLSERVER_SCHEME)
			|| cfService.existsByLabelStartsWith(SQLSERVER_LABEL)
			|| cfService.existsByUriSchemeStartsWith(SQLSERVER_SCHEME)
			|| cfService.existsByCredentialsContainsUriField(SQLSERVER_SCHEME);
}
 
Example 5
Source File: MySqlJdbcUrlCreator.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean isDatabaseService(CfService cfService) {
	if (jdbcUrlMatchesScheme(cfService, MYSQL_SCHEME)
			|| cfService.existsByTagIgnoreCase(MYSQL_TAG)
			|| cfService.existsByLabelStartsWith(MYSQL_LABEL)
			|| cfService.existsByUriSchemeStartsWith(MYSQL_SCHEME)
			|| cfService.existsByCredentialsContainsUriField(MYSQL_SCHEME)) {
		return true;
	}
	return false;
}
 
Example 6
Source File: RedisCfEnvProcessor.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean accept(CfService service) {
	boolean serviceIsBound = service.existsByTagIgnoreCase("redis") ||
			service.existsByLabelStartsWith("rediscloud") ||
			service.existsByUriSchemeStartsWith(redisSchemes) ||
			service.existsByCredentialsContainsUriField(redisSchemes);
	if (serviceIsBound) {
		ConnectorLibraryDetector.assertNoConnectorLibrary();
	}
	return serviceIsBound;
}
 
Example 7
Source File: MongoCfEnvProcessor.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean accept(CfService service) {
	boolean serviceIsBound = service.existsByTagIgnoreCase("mongodb") ||
			service.existsByLabelStartsWith("mongolab") ||
			service.existsByUriSchemeStartsWith(mongoScheme) ||
			service.existsByCredentialsContainsUriField(mongoScheme);
	if (serviceIsBound) {
		ConnectorLibraryDetector.assertNoConnectorLibrary();
	}
	return serviceIsBound;
}
 
Example 8
Source File: AmqpCfEnvProcessor.java    From java-cfenv with Apache License 2.0 5 votes vote down vote up
@Override
public boolean accept(CfService service) {
	boolean serviceIsBound = service.existsByTagIgnoreCase("rabbitmq", "amqp") ||
			service.existsByLabelStartsWith("rabbitmq") ||
			service.existsByLabelStartsWith("cloudamqp") ||
			service.existsByUriSchemeStartsWith(amqpSchemes) ||
			service.existsByCredentialsContainsUriField(amqpSchemes);
	if (serviceIsBound) {
		ConnectorLibraryDetector.assertNoConnectorLibrary();
	}
	return serviceIsBound;
}