Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
5df80792
Commit
5df80792
authored
Nov 11, 2015
by
Phillip Webb
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4432 from cornelcreanga/master
* pr/4432: Add Cassandra username/password properties
parents
4254cc46
190b0d4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
0 deletions
+31
-0
CassandraAutoConfiguration.java
...t/autoconfigure/cassandra/CassandraAutoConfiguration.java
+3
-0
CassandraProperties.java
...ork/boot/autoconfigure/cassandra/CassandraProperties.java
+26
-0
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+2
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java
View file @
5df80792
...
@@ -55,6 +55,9 @@ public class CassandraAutoConfiguration {
...
@@ -55,6 +55,9 @@ public class CassandraAutoConfiguration {
Cluster
.
Builder
builder
=
Cluster
.
builder
()
Cluster
.
Builder
builder
=
Cluster
.
builder
()
.
withClusterName
(
properties
.
getClusterName
())
.
withClusterName
(
properties
.
getClusterName
())
.
withPort
(
properties
.
getPort
());
.
withPort
(
properties
.
getPort
());
if
(
properties
.
getUsername
()
!=
null
)
{
builder
.
withCredentials
(
properties
.
getUsername
(),
properties
.
getPassword
());
}
if
(
properties
.
getCompression
()
!=
null
)
{
if
(
properties
.
getCompression
()
!=
null
)
{
builder
.
withCompression
(
properties
.
getCompression
());
builder
.
withCompression
(
properties
.
getCompression
());
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraProperties.java
View file @
5df80792
...
@@ -57,6 +57,16 @@ public class CassandraProperties {
...
@@ -57,6 +57,16 @@ public class CassandraProperties {
*/
*/
private
int
port
=
ProtocolOptions
.
DEFAULT_PORT
;
private
int
port
=
ProtocolOptions
.
DEFAULT_PORT
;
/**
* Login user of the server.
*/
private
String
username
;
/**
* Login password of the server.
*/
private
String
password
;
/**
/**
* Compression supported by the Cassandra binary protocol.
* Compression supported by the Cassandra binary protocol.
*/
*/
...
@@ -139,6 +149,22 @@ public class CassandraProperties {
...
@@ -139,6 +149,22 @@ public class CassandraProperties {
this
.
port
=
port
;
this
.
port
=
port
;
}
}
public
String
getUsername
()
{
return
this
.
username
;
}
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getPassword
()
{
return
this
.
password
;
}
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
}
public
Compression
getCompression
()
{
public
Compression
getCompression
()
{
return
this
.
compression
;
return
this
.
compression
;
}
}
...
...
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
5df80792
...
@@ -476,11 +476,13 @@ content into your application; rather pick only the properties that you need.
...
@@ -476,11 +476,13 @@ content into your application; rather pick only the properties that you need.
spring.data.cassandra.keyspace-name= # Keyspace name to use.
spring.data.cassandra.keyspace-name= # Keyspace name to use.
spring.data.cassandra.load-balancing-policy= # Class name of the load balancing policy.
spring.data.cassandra.load-balancing-policy= # Class name of the load balancing policy.
spring.data.cassandra.port= # Port of the Cassandra server.
spring.data.cassandra.port= # Port of the Cassandra server.
spring.data.cassandra.password= # Login password of the server.
spring.data.cassandra.read-timeout-millis= # Socket option: read time out.
spring.data.cassandra.read-timeout-millis= # Socket option: read time out.
spring.data.cassandra.reconnection-policy= # Reconnection policy class.
spring.data.cassandra.reconnection-policy= # Reconnection policy class.
spring.data.cassandra.retry-policy= # Class name of the retry policy.
spring.data.cassandra.retry-policy= # Class name of the retry policy.
spring.data.cassandra.serial-consistency-level= # Queries serial consistency level.
spring.data.cassandra.serial-consistency-level= # Queries serial consistency level.
spring.data.cassandra.ssl=false # Enable SSL support.
spring.data.cassandra.ssl=false # Enable SSL support.
spring.data.cassandra.username= # Login user of the server.
# ELASTICSEARCH ({sc-spring-boot-autoconfigure}/elasticsearch/ElasticsearchProperties.{sc-ext}[ElasticsearchProperties])
# ELASTICSEARCH ({sc-spring-boot-autoconfigure}/elasticsearch/ElasticsearchProperties.{sc-ext}[ElasticsearchProperties])
spring.data.elasticsearch.cluster-name=elasticsearch # Elasticsearch cluster name.
spring.data.elasticsearch.cluster-name=elasticsearch # Elasticsearch cluster name.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment