Skip to content

Commit 7aa6507

Browse files
committed
Polishing.
Add Javadoc to exceptions. Align lettercasing of CassandraDriverTimeoutException. Closes #1399
1 parent 47d80a8 commit 7aa6507

21 files changed

+189
-79
lines changed

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraAuthenticationException.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,15 @@ public class CassandraAuthenticationException extends PermissionDeniedDataAccess
2828

2929
private static final long serialVersionUID = 8556304586797273927L;
3030

31-
private EndPoint host;
31+
private final EndPoint host;
3232

33+
/**
34+
* Constructor for {@link CassandraAuthenticationException}.
35+
*
36+
* @param host the affected endpoint.
37+
* @param msg the detail message.
38+
* @param cause the root cause from the underlying data access API.
39+
*/
3340
public CassandraAuthenticationException(EndPoint host, String msg, Throwable cause) {
3441
super(msg, cause);
3542
this.host = host;

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraConnectionFailureException.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ public class CassandraConnectionFailureException extends DataAccessResourceFailu
3232

3333
private static final long serialVersionUID = 6299912054261646552L;
3434

35-
private final Map<Node, Throwable> messagesByHost = new HashMap<>();
36-
35+
private final Map<Node, Throwable> messagesByHost;
36+
37+
/**
38+
* Constructor for {@link CassandraConnectionFailureException}.
39+
*
40+
* @param map the detail failures for each node.
41+
* @param msg the detail message.
42+
* @param cause the root cause from the underlying data access API.
43+
*/
3744
public CassandraConnectionFailureException(Map<Node, Throwable> map, String msg, Throwable cause) {
3845
super(msg, cause);
39-
this.messagesByHost.putAll(map);
46+
this.messagesByHost = new HashMap<>(map);
4047
}
4148

4249
public Map<Node, Throwable> getMessagesByHost() {

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraDriverTimeOutException.java

Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package org.springframework.data.cassandra;
2+
3+
import org.springframework.dao.QueryTimeoutException;
4+
5+
/**
6+
* This exception is thrown when driver has timed out during any interaction with the Cassandra coordinator node.
7+
*
8+
* @author Mikhail Polivakha
9+
* @since 4.2
10+
*/
11+
public class CassandraDriverTimeoutException extends QueryTimeoutException {
12+
13+
/**
14+
* Constructor for {@link CassandraDriverTimeoutException}.
15+
*
16+
* @param message the detail message.
17+
* @param cause the root cause from the underlying data access API.
18+
*/
19+
public CassandraDriverTimeoutException(String message, Throwable cause) {
20+
super(message, cause);
21+
}
22+
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraInsufficientReplicasAvailableException.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,22 @@ public class CassandraInsufficientReplicasAvailableException extends TransientDa
2929
private int numberRequired;
3030
private int numberAlive;
3131

32+
/**
33+
* Constructor for {@link CassandraInsufficientReplicasAvailableException}.
34+
*
35+
* @param msg the detail message.
36+
*/
3237
public CassandraInsufficientReplicasAvailableException(String msg) {
3338
super(msg);
3439
}
3540

41+
/**
42+
* Constructor for {@link CassandraInsufficientReplicasAvailableException}.
43+
*
44+
* @param numberRequired the required number of replicas.
45+
* @param msg the detail message.
46+
* @param cause the root cause from the underlying data access API.
47+
*/
3648
public CassandraInsufficientReplicasAvailableException(int numberRequired, int numberAlive, String msg,
3749
Throwable cause) {
3850
super(msg, cause);

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraInternalException.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,21 @@ public class CassandraInternalException extends DataAccessException {
2626

2727
private static final long serialVersionUID = 433061676465346338L;
2828

29+
/**
30+
* Constructor for {@link CassandraInternalException}.
31+
*
32+
* @param msg the detail message.
33+
*/
2934
public CassandraInternalException(String msg) {
3035
super(msg);
3136
}
3237

38+
/**
39+
* Constructor for {@link CassandraInternalException}.
40+
*
41+
* @param msg the detail message.
42+
* @param cause the root cause from the underlying data access API.
43+
*/
3344
public CassandraInternalException(String msg, Throwable cause) {
3445
super(msg, cause);
3546
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraInvalidConfigurationInQueryException.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,21 @@ public class CassandraInvalidConfigurationInQueryException extends InvalidDataAc
2727

2828
private static final long serialVersionUID = 4594321191806182918L;
2929

30+
/**
31+
* Constructor for {@link CassandraInvalidConfigurationInQueryException}.
32+
*
33+
* @param msg the detail message.
34+
*/
3035
public CassandraInvalidConfigurationInQueryException(String msg) {
3136
super(msg);
3237
}
3338

39+
/**
40+
* Constructor for {@link CassandraInvalidConfigurationInQueryException}.
41+
*
42+
* @param msg the detail message.
43+
* @param cause the root cause from the underlying data access API.
44+
*/
3445
public CassandraInvalidConfigurationInQueryException(String msg, Throwable cause) {
3546
super(msg, cause);
3647
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraInvalidQueryException.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,21 @@ public class CassandraInvalidQueryException extends InvalidDataAccessApiUsageExc
2626

2727
private static final long serialVersionUID = 4594321191806182918L;
2828

29+
/**
30+
* Constructor for {@link CassandraInvalidQueryException}.
31+
*
32+
* @param msg the detail message.
33+
*/
2934
public CassandraInvalidQueryException(String msg) {
3035
super(msg);
3136
}
3237

38+
/**
39+
* Constructor for {@link CassandraInvalidQueryException}.
40+
*
41+
* @param msg the detail message.
42+
* @param cause the root cause from the underlying data access API.
43+
*/
3344
public CassandraInvalidQueryException(String msg, Throwable cause) {
3445
super(msg, cause);
3546
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraKeyspaceExistsException.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ public class CassandraKeyspaceExistsException extends CassandraSchemaElementExis
2424

2525
private static final long serialVersionUID = 6032967419751410352L;
2626

27+
/**
28+
* Constructor for {@link CassandraKeyspaceExistsException}.
29+
*
30+
* @param keyspaceName the keyspace name.
31+
* @param msg the detail message.
32+
* @param cause the root cause from the underlying data access API.
33+
*/
2734
public CassandraKeyspaceExistsException(String keyspaceName, String msg, Throwable cause) {
2835
super(keyspaceName, ElementType.KEYSPACE, msg, cause);
2936
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/CassandraQuerySyntaxException.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,21 @@ public class CassandraQuerySyntaxException extends InvalidDataAccessApiUsageExce
2626

2727
private static final long serialVersionUID = 4398474399882434154L;
2828

29+
/**
30+
* Constructor for {@link CassandraQuerySyntaxException}.
31+
*
32+
* @param msg the detail message.
33+
*/
2934
public CassandraQuerySyntaxException(String msg) {
3035
super(msg);
3136
}
3237

38+
/**
39+
* Constructor for {@link CassandraQuerySyntaxException}.
40+
*
41+
* @param msg the detail message.
42+
* @param cause the root cause from the underlying data access API.
43+
*/
3344
public CassandraQuerySyntaxException(String msg, Throwable cause) {
3445
super(msg, cause);
3546
}

0 commit comments

Comments
 (0)