Skip to content

Commit f407545

Browse files
committed
Remove long-deprecated API.
Remove Kotlin extensions accepting KClass and Java API that has been deprecated for removal since the last major revision. Closes #1594
1 parent 60e0c45 commit f407545

File tree

157 files changed

+174
-6123
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+174
-6123
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,14 @@
2121
* Spring data access exception for Cassandra when a keyspace being created already exists.
2222
*
2323
* @author Matthew T. Adams
24+
* @author Mark Paluch
2425
*/
2526
public class CassandraKeyspaceExistsException extends CassandraSchemaElementExistsException {
2627

2728
private static final @Serial long serialVersionUID = 6032967419751410352L;
2829

30+
private final String keyspaceName;
31+
2932
/**
3033
* Constructor for {@link CassandraKeyspaceExistsException}.
3134
*
@@ -34,11 +37,12 @@ public class CassandraKeyspaceExistsException extends CassandraSchemaElementExis
3437
* @param cause the root cause from the underlying data access API.
3538
*/
3639
public CassandraKeyspaceExistsException(String keyspaceName, String msg, Throwable cause) {
37-
super(keyspaceName, ElementType.KEYSPACE, msg, cause);
40+
super(msg, cause);
41+
this.keyspaceName = keyspaceName;
3842
}
3943

40-
@SuppressWarnings("NullAway")
4144
public String getKeyspaceName() {
42-
return getElementName();
45+
return keyspaceName;
4346
}
47+
4448
}

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ public CassandraReadTimeoutException(boolean wasDataPresent, String msg, Throwab
4343
this.wasDataPresent = wasDataPresent;
4444
}
4545

46-
/**
47-
* @return whether the actual data was amongst the received replica responses.
48-
* @deprecated since 3.0, use {@link #wasDataPresent()}.
49-
*/
50-
@Deprecated
51-
public boolean getWasDataReceived() {
52-
return wasDataPresent();
53-
}
54-
5546
/**
5647
* @return whether the actual data was amongst the received replica responses.
5748
* @since 3.0

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

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
import java.io.Serial;
1919

20-
import org.jspecify.annotations.Nullable;
2120
import org.springframework.dao.NonTransientDataAccessException;
2221

2322
/**
@@ -30,30 +29,6 @@ public class CassandraSchemaElementExistsException extends NonTransientDataAcces
3029

3130
private static final @Serial long serialVersionUID = 7798361273692300162L;
3231

33-
@Deprecated
34-
public enum ElementType {
35-
KEYSPACE, TABLE, COLUMN, INDEX
36-
}
37-
38-
private @Nullable String elementName;
39-
private @Nullable ElementType elementType;
40-
41-
/**
42-
* Constructor for {@link CassandraSchemaElementExistsException}.
43-
*
44-
* @param elementName the CQL element name.
45-
* @param elementType the CQL element type.
46-
* @param msg the detail message.
47-
* @param cause the root cause from the underlying data access API.
48-
*/
49-
@Deprecated
50-
public CassandraSchemaElementExistsException(String elementName, ElementType elementType, String msg,
51-
Throwable cause) {
52-
super(msg, cause);
53-
this.elementName = elementName;
54-
this.elementType = elementType;
55-
}
56-
5732
/**
5833
* Constructor for {@link CassandraSchemaElementExistsException}.
5934
*
@@ -64,14 +39,4 @@ public CassandraSchemaElementExistsException(String msg, Throwable cause) {
6439
super(msg, cause);
6540
}
6641

67-
@Deprecated
68-
public @Nullable String getElementName() {
69-
return elementName;
70-
}
71-
72-
@Deprecated
73-
public @Nullable ElementType getElementType() {
74-
return elementType;
75-
}
76-
7742
}

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
* Spring data access exception for when a Cassandra table being created already exists.
2222
*
2323
* @author Matthew T. Adams
24+
* @author Mark Paluch
2425
*/
2526
public class CassandraTableExistsException extends CassandraSchemaElementExistsException {
2627

2728
private static final @Serial long serialVersionUID = 6032967419751410352L;
29+
private final String tableName;
2830

2931
/**
3032
* Constructor for {@link CassandraTableExistsException}.
@@ -34,11 +36,12 @@ public class CassandraTableExistsException extends CassandraSchemaElementExistsE
3436
* @param cause the root cause from the underlying data access API.
3537
*/
3638
public CassandraTableExistsException(String tableName, String msg, Throwable cause) {
37-
super(tableName, ElementType.TABLE, msg, cause);
39+
super(tableName, cause);
40+
this.tableName = tableName;
3841
}
3942

40-
@SuppressWarnings("NullAway")
4143
public String getTableName() {
42-
return getElementName();
44+
return tableName;
4345
}
46+
4447
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/config/AbstractCassandraConfiguration.java

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.springframework.data.cassandra.core.convert.MappingCassandraConverter;
3434
import org.springframework.data.cassandra.core.cql.session.init.KeyspacePopulator;
3535
import org.springframework.data.cassandra.core.mapping.CassandraMappingContext;
36-
import org.springframework.data.cassandra.core.mapping.SimpleTupleTypeFactory;
3736
import org.springframework.data.cassandra.core.mapping.SimpleUserTypeResolver;
3837
import org.springframework.data.cassandra.core.mapping.Table;
3938
import org.springframework.data.cassandra.core.mapping.UserTypeResolver;
@@ -94,17 +93,6 @@ public CassandraManagedTypes cassandraManagedTypes() throws ClassNotFoundExcepti
9493
return CassandraManagedTypes.fromIterable(getInitialEntitySet());
9594
}
9695

97-
/**
98-
* Return the {@link MappingContext} instance to map Entities to {@link Object Java Objects}.
99-
*
100-
* @see org.springframework.data.cassandra.core.mapping.CassandraMappingContext
101-
* @deprecated since 4.0, use {@link #cassandraMappingContext(CassandraManagedTypes)} instead.
102-
*/
103-
@Deprecated(since = "4.0", forRemoval = true)
104-
public CassandraMappingContext cassandraMapping() throws ClassNotFoundException {
105-
return cassandraMappingContext(cassandraManagedTypes());
106-
}
107-
10896
/**
10997
* Return the {@link MappingContext} instance to map Entities to {@link Object Java Objects}.
11098
*
@@ -115,15 +103,12 @@ public CassandraMappingContext cassandraMappingContext(CassandraManagedTypes cas
115103

116104
CqlSession cqlSession = getRequiredSession();
117105

118-
CassandraMappingContext mappingContext = new CassandraMappingContext(userTypeResolver(cqlSession),
119-
SimpleTupleTypeFactory.DEFAULT);
106+
CassandraMappingContext mappingContext = new CassandraMappingContext();
120107

121108
CustomConversions customConversions = requireBeanOfType(CassandraCustomConversions.class);
122109

123110
getBeanClassLoader().ifPresent(mappingContext::setBeanClassLoader);
124111

125-
mappingContext.setCodecRegistry(cqlSession.getContext().getCodecRegistry());
126-
mappingContext.setCustomConversions(customConversions);
127112
mappingContext.setManagedTypes(cassandraManagedTypes);
128113
mappingContext.setSimpleTypeHolder(customConversions.getSimpleTypeHolder());
129114

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/config/AbstractCqlTemplateConfiguration.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/config/AbstractSessionConfiguration.java

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,6 @@ protected <T> T requireBeanOfType(Class<T> beanType) {
103103
return getBeanFactory().getBean(beanType);
104104
}
105105

106-
/**
107-
* Returns the {@link String name} of the cluster.
108-
*
109-
* @return the {@link String cluster name}; may be {@literal null}.
110-
* @deprecated since 3.0, use {@link #getSessionName()} instead.
111-
* @since 1.5
112-
*/
113-
@Deprecated
114-
protected @Nullable String getClusterName() {
115-
return null;
116-
}
117-
118106
/**
119107
* Return the name of the keyspace to connect to.
120108
*
@@ -249,42 +237,11 @@ protected SessionBuilderConfigurer getSessionBuilderConfigurer() {
249237
return null;
250238
}
251239

252-
/**
253-
* Returns the list of CQL scripts to be run on startup after {@link #getKeyspaceCreations() Keyspace creations} and
254-
* after initialization of the {@literal System} Keyspace. return super.getSessionBuilderConfigurer();
255-
*
256-
* @return the list of CQL scripts to be run on startup; may be {@link Collections#emptyList() empty} but never
257-
* {@literal null}.
258-
* @deprecated since 3.0; Declare a
259-
* {@link org.springframework.data.cassandra.core.cql.session.init.SessionFactoryInitializer} bean
260-
* instead.
261-
*/
262-
@Deprecated
263-
protected List<String> getStartupScripts() {
264-
return Collections.emptyList();
265-
}
266-
267-
/**
268-
* Returns the list of CQL scripts to be run on shutdown after {@link #getKeyspaceDrops() Keyspace drops}
269-
* and right before shutdown of the {@code System} Keyspace.
270-
*
271-
* @return the list of CQL scripts to be run on shutdown; may be {@link Collections#emptyList() empty}
272-
* but never {@literal null}.
273-
* @deprecated since 3.0; Declare a
274-
* {@link org.springframework.data.cassandra.core.cql.session.init.SessionFactoryInitializer} bean instead.
275-
*/
276-
@Deprecated
277-
protected List<String> getShutdownScripts() {
278-
return Collections.emptyList();
279-
}
280-
281240
/**
282241
* Creates a {@link CqlSessionFactoryBean} that provides a Cassandra {@link CqlSession}.
283242
*
284243
* @return the {@link CqlSessionFactoryBean}.
285244
* @see #getKeyspaceName()
286-
* @see #getStartupScripts()
287-
* @see #getShutdownScripts()
288245
*/
289246
@Bean
290247
public CqlSessionFactoryBean cassandraSession() {
@@ -295,8 +252,6 @@ public CqlSessionFactoryBean cassandraSession() {
295252
bean.setKeyspaceCreations(getKeyspaceCreations());
296253
bean.setKeyspaceDrops(getKeyspaceDrops());
297254
bean.setKeyspaceName(getKeyspaceName());
298-
bean.setKeyspaceStartupScripts(getStartupScripts());
299-
bean.setKeyspaceShutdownScripts(getShutdownScripts());
300255
bean.setLocalDatacenter(getLocalDataCenter());
301256
bean.setPort(getPort());
302257
bean.setSessionBuilderConfigurer(getSessionBuilderConfigurerWrapper());
@@ -318,8 +273,6 @@ private SessionBuilderConfigurer getSessionBuilderConfigurerWrapper() {
318273

319274
if (StringUtils.hasText(getSessionName())) {
320275
options.add(DefaultDriverOption.SESSION_NAME, getSessionName());
321-
} else if (StringUtils.hasText(getClusterName())) {
322-
options.add(DefaultDriverOption.SESSION_NAME, getClusterName());
323276
}
324277

325278
CompressionType compressionType = getCompressionType();

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/config/CassandraCqlSessionFactoryBean.java

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)