public class CloudServiceConnectionFactory extends Object implements ServiceConnectionFactory
Constructor and Description |
---|
CloudServiceConnectionFactory(Cloud cloud) |
Modifier and Type | Method and Description |
---|---|
DataSource |
dataSource()
Get the
DataSource object associated with the only relational database service bound to the app. |
DataSource |
dataSource(DataSourceConfig dataSourceConfig)
Get the
DataSource object associated with the only relational database service bound to the app
configured as specified. |
DataSource |
dataSource(String serviceId)
Get the
DataSource object for the specified relational database service. |
DataSource |
dataSource(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(String serviceId)
Get the
MongoDbFactory object for the specified MongoDB service. |
org.springframework.data.mongodb.MongoDbFactory |
mongoDbFactory(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(String serviceId)
Get the
ConnectionFactory object for the specified RabbitMQ service. |
org.springframework.amqp.rabbit.connection.ConnectionFactory |
rabbitConnectionFactory(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(String serviceId)
Get the
RedisConnectionFactory object for the specified Redis service. |
org.springframework.data.redis.connection.RedisConnectionFactory |
redisConnectionFactory(String serviceId,
PooledServiceConnectorConfig redisConnectionFactoryConfig)
Get the
RedisConnectionFactory object for the specified Redis service configured as specified. |
Object |
service()
Get the service connector object associated with the only service bound to the app.
|
<T> T |
service(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. |
Object |
service(String serviceId)
Get the service connector object for the specified service.
|
<T> T |
service(String serviceId,
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(String serviceId,
Class<T> serviceConnectorType,
ServiceConnectorConfig serviceConnectorConfig) |
protected final Cloud cloud
public CloudServiceConnectionFactory(Cloud cloud)
public 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 ServiceConnectionFactory
CloudException
- if there are either 0 or more than 1 relational database services.public 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 ServiceConnectionFactory
dataSourceConfig
- configuration for the data source createdCloudException
- if there are either 0 or more than 1 relational database services.public DataSource dataSource(String serviceId)
DataSource
object for the specified relational database service.
This is equivalent to the <cloud:data-source service-id="serviceId"/>
dataSource
in interface ServiceConnectionFactory
serviceId
- the name of the serviceCloudException
- if the specified service doesn't existpublic DataSource dataSource(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 ServiceConnectionFactory
serviceId
- the name of the servicedataSourceConfig
- configuration for the data source createdCloudException
- 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 ServiceConnectionFactory
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 ServiceConnectionFactory
mongoDbFactoryConfig
- configuration for the mondo db factory createdCloudException
- if there are either 0 or more than 1 mongodb services.public org.springframework.data.mongodb.MongoDbFactory mongoDbFactory(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 ServiceConnectionFactory
serviceId
- the name of the serviceCloudException
- if the specified service doesn't existpublic org.springframework.data.mongodb.MongoDbFactory mongoDbFactory(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 ServiceConnectionFactory
serviceId
- the name of the servicemongoDbFactoryConfig
- configuration for the mongo db factory createdCloudException
- 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 ServiceConnectionFactory
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 ServiceConnectionFactory
rabbitConnectionFactoryConfig
- configuration for the rabbit connection factory createdCloudException
- if there are either 0 or more than 1 RabbitMQ services.public org.springframework.amqp.rabbit.connection.ConnectionFactory rabbitConnectionFactory(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 ServiceConnectionFactory
serviceId
- the name of the serviceCloudException
- if the specified service doesn't existpublic org.springframework.amqp.rabbit.connection.ConnectionFactory rabbitConnectionFactory(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 ServiceConnectionFactory
serviceId
- the name of the servicerabbitConnectionFactoryConfig
- configuration for the ConnectionFactory
createdCloudException
- 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 ServiceConnectionFactory
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 ServiceConnectionFactory
redisConnectionFactoryConfig
- configuration for the RedisConnectionFactory
createdCloudException
- if there are either 0 or more than 1 redis services.public org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory(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 ServiceConnectionFactory
serviceId
- the name of the serviceCloudException
- if the specified service doesn't existpublic org.springframework.data.redis.connection.RedisConnectionFactory redisConnectionFactory(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 ServiceConnectionFactory
serviceId
- the name of the serviceredisConnectionFactoryConfig
- configuration for the RedisConnectionFactory
createdCloudException
- if the specified service doesn't existpublic Object service()
<cloud:service/>
element.service
in interface ServiceConnectionFactory
CloudException
- if there are either 0 or more than 1 services.public <T> T service(Class<T> serviceConnectorType)
<cloud:service connector-type="T.class"/>
element.service
in interface ServiceConnectionFactory
T
- the type of the service connector to be returnedserviceConnectorType
- the class of the service connector to be returnedCloudException
- if there are either 0 or more than 1 candidate services.public Object service(String serviceId)
<cloud:service service-id="serviceId"/>
element.service
in interface ServiceConnectionFactory
serviceId
- the service ID of the service to be returnedCloudException
- if the specified service doesn't existpublic <T> T service(String serviceId, Class<T> serviceConnectorType)
<cloud:service service-id="serviceId" connector-type="T.class"/>
element.service
in interface ServiceConnectionFactory
T
- 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 returnedCloudException
- if the specified service doesn't existpublic <T> T service(String serviceId, Class<T> serviceConnectorType, ServiceConnectorConfig serviceConnectorConfig)
service
in interface ServiceConnectionFactory
Copyright © 2015 Pivotal Software, Inc.. All rights reserved.