public class CloudServiceConnectionFactory extends java.lang.Object implements ServiceConnectionFactory
| Modifier and Type | Field and Description |
|---|---|
protected org.springframework.cloud.Cloud |
cloud |
| Constructor and Description |
|---|
CloudServiceConnectionFactory(org.springframework.cloud.Cloud cloud) |
| Modifier and Type | Method and Description |
|---|---|
javax.sql.DataSource |
dataSource()
Get the
DataSource object associated with the only relational database service bound to the app. |
javax.sql.DataSource |
dataSource(DataSourceConfig dataSourceConfig)
Get the
DataSource object associated with the only relational database service bound to the app
configured as specified. |
javax.sql.DataSource |
dataSource(java.lang.String serviceId)
Get the
DataSource object for the specified relational database service. |
javax.sql.DataSource |
dataSource(java.lang.String serviceId,
DataSourceConfig dataSourceConfig)
Get the
DataSource object for the specified relational database service configured as specified. |
org.springframework.data.mongodb.MongoDbFactory |
mongoDbFactory()
Get the
MongoDbFactory object associated with the only MongoDB service bound to the app. |
org.springframework.data.mongodb.MongoDbFactory |
mongoDbFactory(MongoDbFactoryConfig mongoDbFactoryConfig)
Get the
MongoDbFactory object associated with the only MongoDB service bound to the app
configured as specified. |
org.springframework.data.mongodb.MongoDbFactory |
mongoDbFactory(java.lang.String serviceId)
Get the
MongoDbFactory object for the specified MongoDB service. |
org.springframework.data.mongodb.MongoDbFactory |
mongoDbFactory(java.lang.String serviceId,
MongoDbFactoryConfig mongoDbFactoryConfig)
Get the
MongoDbFactory object for the specified MongoDB service configured as specified. |
org.springframework.amqp.rabbit.connection.ConnectionFactory |
rabbitConnectionFactory()
Get the
ConnectionFactory object associated with the only RabbitMQ service bound to the app. |
org.springframework.amqp.rabbit.connection.ConnectionFactory |
rabbitConnectionFactory(RabbitConnectionFactoryConfig rabbitConnectionFactoryConfig)
Get the
ConnectionFactory object associated with the only RabbitMQ service bound to the app
configured as specified. |
org.springframework.amqp.rabbit.connection.ConnectionFactory |
rabbitConnectionFactory(java.lang.String serviceId)
Get the
ConnectionFactory object for the specified RabbitMQ service. |
org.springframework.amqp.rabbit.connection.ConnectionFactory |
rabbitConnectionFactory(java.lang.String serviceId,
RabbitConnectionFactoryConfig rabbitConnectionFactoryConfig)
Get the
ConnectionFactory object for the specified RabbitMQ service configured as specified. |
org.springframework.data.redis.connection.RedisConnectionFactory |
redisConnectionFactory()
Get the
RedisConnectionFactory object associated with the only Redis service bound to the app. |
org.springframework.data.redis.connection.RedisConnectionFactory |
redisConnectionFactory(PooledServiceConnectorConfig redisConnectionFactoryConfig)
Get the
RedisConnectionFactory object associated with the only Redis service bound to the app
configured as specified. |
org.springframework.data.redis.connection.RedisConnectionFactory |
redisConnectionFactory(java.lang.String serviceId)
Get the
RedisConnectionFactory object for the specified Redis service. |
org.springframework.data.redis.connection.RedisConnectionFactory |
redisConnectionFactory(java.lang.String serviceId,
PooledServiceConnectorConfig redisConnectionFactoryConfig)
Get the
RedisConnectionFactory object for the specified Redis service configured as specified. |
java.lang.Object |
service()
Get the service connector object associated with the only service bound to the app.
|
<T> T |
service(java.lang.Class<T> serviceConnectorType)
Get the service connector object of the specified type if there is only one such candidate service
This is equivalent to the
<cloud:service connector-type="T.class"/> element. |
java.lang.Object |
service(java.lang.String serviceId)
Get the service connector object for the specified service.
|
<T> T |
service(java.lang.String serviceId,
java.lang.Class<T> serviceConnectorType)
Get the service connector object of the specified type and service ID
This is equivalent to the
<cloud:service service-id="serviceId" connector-type="T.class"/> element. |
<T> T |
service(java.lang.String serviceId,
java.lang.Class<T> serviceConnectorType,
org.springframework.cloud.service.ServiceConnectorConfig serviceConnectorConfig) |
public CloudServiceConnectionFactory(org.springframework.cloud.Cloud cloud)
public javax.sql.DataSource dataSource()
DataSource object associated with the only relational database service bound to the app.
This is equivalent to the <cloud:data-source/> element.dataSource in interface ServiceConnectionFactoryorg.springframework.cloud.CloudException - if there are either 0 or more than 1 relational database services.public javax.sql.DataSource dataSource(DataSourceConfig dataSourceConfig)
DataSource object associated with the only relational database service bound to the app
configured as specified.
This is equivalent to the <cloud:data-source> element with nested <cloud:connection> and/or
<cloud:pool> elements.dataSource in interface ServiceConnectionFactorydataSourceConfig - configuration for the data source createdorg.springframework.cloud.CloudException - if there are either 0 or more than 1 relational database services.public javax.sql.DataSource dataSource(java.lang.String serviceId)
DataSource object for the specified relational database service.
This is equivalent to the <cloud:data-source service-id="serviceId"/>dataSource in interface ServiceConnectionFactoryserviceId - the name of the serviceorg.springframework.cloud.CloudException - if the specified service doesn't existpublic javax.sql.DataSource dataSource(java.lang.String serviceId,
DataSourceConfig dataSourceConfig)
DataSource object for the specified relational database service configured as specified.
This is equivalent to the <cloud:data-source service-id="serviceId"/> element with
nested <cloud:connection> and/or <cloud:pool> elements.dataSource in interface ServiceConnectionFactoryserviceId - the name of the servicedataSourceConfig - configuration for the data source createdorg.springframework.cloud.CloudException - if the specified service doesn't existpublic org.springframework.data.mongodb.MongoDbFactory mongoDbFactory()
MongoDbFactory object associated with the only MongoDB service bound to the app.
This is equivalent to the <cloud:mongo-db-factory/> element.mongoDbFactory in interface ServiceConnectionFactoryorg.springframework.cloud.CloudException - if there are either 0 or more than 1 mongodb services.public org.springframework.data.mongodb.MongoDbFactory mongoDbFactory(MongoDbFactoryConfig mongoDbFactoryConfig)
MongoDbFactory object associated with the only MongoDB service bound to the app
configured as specified.
This is equivalent to the <cloud:mongo-db-factory> element with a nested <cloud:mongo-options> element.mongoDbFactory in interface ServiceConnectionFactorymongoDbFactoryConfig - configuration for the mondo db factory createdorg.springframework.cloud.CloudException - if there are either 0 or more than 1 mongodb services.public org.springframework.data.mongodb.MongoDbFactory mongoDbFactory(java.lang.String serviceId)
MongoDbFactory object for the specified MongoDB service.
This is equivalent to the <cloud:mongo-db-factory service-id="serviceId"> element.mongoDbFactory in interface ServiceConnectionFactoryserviceId - the name of the serviceorg.springframework.cloud.CloudException - if the specified service doesn't existpublic org.springframework.data.mongodb.MongoDbFactory mongoDbFactory(java.lang.String serviceId,
MongoDbFactoryConfig mongoDbFactoryConfig)
MongoDbFactory object for the specified MongoDB service configured as specified.
This is equivalent to the <cloud:mongo-db-factory service-id="serviceId"> element
with a nested <cloud:mongo-options> element.mongoDbFactory in interface ServiceConnectionFactoryserviceId - the name of the servicemongoDbFactoryConfig - configuration for the mongo db factory createdorg.springframework.cloud.CloudException - if the specified service doesn't existpublic org.springframework.amqp.rabbit.connection.ConnectionFactory rabbitConnectionFactory()
ConnectionFactory object associated with the only RabbitMQ service bound to the app.
This is equivalent to the <cloud:rabbit-connection-factory> element.rabbitConnectionFactory in interface ServiceConnectionFactoryorg.springframework.cloud.CloudException - if there are either 0 or more than 1 RabbitMQ services.public org.springframework.amqp.rabbit.connection.ConnectionFactory rabbitConnectionFactory(RabbitConnectionFactoryConfig rabbitConnectionFactoryConfig)
ConnectionFactory object associated with the only RabbitMQ service bound to the app
configured as specified.
This is equivalent to the <cloud:rabbit-connection-factory> element
with a nested <cloud:rabbit-options> element.rabbitConnectionFactory in interface ServiceConnectionFactoryrabbitConnectionFactoryConfig - configuration for the rabbit connection factory createdorg.springframework.cloud.CloudException - if there are either 0 or more than 1 RabbitMQ services.public org.springframework.amqp.rabbit.connection.ConnectionFactory rabbitConnectionFactory(java.lang.String serviceId)
ConnectionFactory object for the specified RabbitMQ service.
This is equivalent to the <cloud:rabbit-connection-factory service-id="serviceId"> element.rabbitConnectionFactory in interface ServiceConnectionFactoryserviceId - the name of the serviceorg.springframework.cloud.CloudException - if the specified service doesn't existpublic org.springframework.amqp.rabbit.connection.ConnectionFactory rabbitConnectionFactory(java.lang.String serviceId,
RabbitConnectionFactoryConfig rabbitConnectionFactoryConfig)
ConnectionFactory object for the specified RabbitMQ service configured as specified.
This is equivalent to the <cloud:rabbit-connection-factory service-id="serviceId"> element
with a nested <cloud:rabbit-options> element.rabbitConnectionFactory in interface ServiceConnectionFactoryserviceId - the name of the servicerabbitConnectionFactoryConfig - configuration for the ConnectionFactory createdorg.springframework.cloud.CloudException - if the specified service doesn't existpublic org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory()
RedisConnectionFactory object associated with the only Redis service bound to the app.
This is equivalent to the <cloud:redis-connection-factory/> elementredisConnectionFactory in interface ServiceConnectionFactoryorg.springframework.cloud.CloudException - if there are either 0 or more than 1 redis services.public org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory(PooledServiceConnectorConfig redisConnectionFactoryConfig)
RedisConnectionFactory object associated with the only Redis service bound to the app
configured as specified.
This is equivalent to the <cloud:redis-connection-factory service-id="serviceId"> element
with a nested <cloud:pool> element.redisConnectionFactory in interface ServiceConnectionFactoryredisConnectionFactoryConfig - configuration for the RedisConnectionFactory createdorg.springframework.cloud.CloudException - if there are either 0 or more than 1 redis services.public org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory(java.lang.String serviceId)
RedisConnectionFactory object for the specified Redis service.
This is equivalent to the <cloud:redis-connection-factory service-id="serviceId"> element.redisConnectionFactory in interface ServiceConnectionFactoryserviceId - the name of the serviceorg.springframework.cloud.CloudException - if the specified service doesn't existpublic org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory(java.lang.String serviceId,
PooledServiceConnectorConfig redisConnectionFactoryConfig)
RedisConnectionFactory object for the specified Redis service configured as specified.
This is equivalent to the <cloud:redis-connection-factory service-id="serviceId"> element
with a nested <cloud:pool> element.redisConnectionFactory in interface ServiceConnectionFactoryserviceId - the name of the serviceredisConnectionFactoryConfig - configuration for the RedisConnectionFactory createdorg.springframework.cloud.CloudException - if the specified service doesn't existpublic java.lang.Object service()
<cloud:service/> element.service in interface ServiceConnectionFactoryorg.springframework.cloud.CloudException - if there are either 0 or more than 1 services.public <T> T service(java.lang.Class<T> serviceConnectorType)
<cloud:service connector-type="T.class"/> element.service in interface ServiceConnectionFactoryT - the type of the service connector to be returnedserviceConnectorType - the class of the service connector to be returnedorg.springframework.cloud.CloudException - if there are either 0 or more than 1 candidate services.public java.lang.Object service(java.lang.String serviceId)
<cloud:service service-id="serviceId"/> element.service in interface ServiceConnectionFactoryserviceId - the service ID of the service to be returnedorg.springframework.cloud.CloudException - if the specified service doesn't existpublic <T> T service(java.lang.String serviceId,
java.lang.Class<T> serviceConnectorType)
<cloud:service service-id="serviceId" connector-type="T.class"/> element.service in interface ServiceConnectionFactoryT - the type of the service connector to be returnedserviceId - the service ID of the service to be returnedserviceConnectorType - the class of the service connector to be returnedorg.springframework.cloud.CloudException - if the specified service doesn't existpublic <T> T service(java.lang.String serviceId,
java.lang.Class<T> serviceConnectorType,
org.springframework.cloud.service.ServiceConnectorConfig serviceConnectorConfig)
service in interface ServiceConnectionFactory