Upgrade Infinispan to 13.0.10.Final (#13910)

Closes #12306
This commit is contained in:
Michal Hajas 2022-08-25 13:09:34 +02:00 committed by GitHub
parent cecc5b9826
commit 05b9e6d59e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 365 additions and 1821 deletions

View file

@ -126,11 +126,6 @@
<artifactId>protostream-processor</artifactId>
<version>${infinispan.protostream.processor.version}</version>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-component-annotations</artifactId>
<version>${infinispan.version}</version>
</dependency>
</dependencies>
<build>
<plugins>

View file

@ -22,7 +22,6 @@ import org.infinispan.client.hotrod.RemoteCacheManagerAdmin;
import org.infinispan.client.hotrod.configuration.ClientIntelligence;
import org.infinispan.client.hotrod.configuration.ConfigurationBuilder;
import org.infinispan.client.hotrod.configuration.NearCacheMode;
import org.infinispan.client.hotrod.configuration.RemoteCacheConfigurationBuilder;
import org.infinispan.commons.marshall.ProtoStreamMarshaller;
import org.infinispan.protostream.GeneratedSchema;
import org.infinispan.query.remote.client.ProtobufMetadataManagerConstants;
@ -74,6 +73,7 @@ public class DefaultHotRodConnectionProviderFactory implements HotRodConnectionP
public void close() {
if (remoteCacheManager != null) {
remoteCacheManager.close();
remoteCacheManager = null;
}
}
@ -88,6 +88,7 @@ public class DefaultHotRodConnectionProviderFactory implements HotRodConnectionP
}
public void lazyInit() {
LOG.debugf("Initializing HotRod client connection to Infinispan server.");
ConfigurationBuilder remoteBuilder = new ConfigurationBuilder();
remoteBuilder.addServer()
.host(config.get("host", "localhost"))
@ -104,6 +105,7 @@ public class DefaultHotRodConnectionProviderFactory implements HotRodConnectionP
.realm(config.get("realm", "default"));
}
LOG.debugf("Configuring remote caches.");
configureRemoteCaches(remoteBuilder);
remoteBuilder.addContextInitializer(CommonPrimitivesProtoSchemaInitializer.INSTANCE);
@ -113,9 +115,7 @@ public class DefaultHotRodConnectionProviderFactory implements HotRodConnectionP
Set<String> remoteCaches = ENTITY_DESCRIPTOR_MAP.values().stream()
.map(HotRodEntityDescriptor::getCacheName).collect(Collectors.toSet());
// access the caches to force their creation
remoteCaches.forEach(remoteCacheManager::getCache);
LOG.debugf("Uploading proto schema to Infinispan server.");
registerSchemata();
@ -123,13 +123,16 @@ public class DefaultHotRodConnectionProviderFactory implements HotRodConnectionP
RemoteCacheManagerAdmin administration = remoteCacheManager.administration();
if (reindexCaches != null && reindexCaches.equals("all")) {
LOG.infof("Reindexing all caches. This can take a long time to complete. While the rebuild operation is in progress, queries might return fewer results.");
remoteCaches.forEach(administration::reindexCache);
remoteCaches.stream()
.peek(remoteCacheManager::getCache) // access the caches to force their creation, otherwise reindexing fails if cache doesn't exist
.forEach(administration::reindexCache);
} else if (reindexCaches != null && !reindexCaches.isEmpty()){
Arrays.stream(reindexCaches.split(","))
.map(String::trim)
.filter(e -> !e.isEmpty())
.filter(remoteCaches::contains)
.peek(cacheName -> LOG.infof("Reindexing %s cache. This can take a long time to complete. While the rebuild operation is in progress, queries might return fewer results.", cacheName))
.peek(remoteCacheManager::getCache) // access the caches to force their creation, otherwise reindexing fails if cache doesn't exist
.forEach(administration::reindexCache);
}
@ -197,31 +200,30 @@ public class DefaultHotRodConnectionProviderFactory implements HotRodConnectionP
}
private void configureRemoteCaches(ConfigurationBuilder builder) {
URI uri;
try {
uri = DefaultHotRodConnectionProviderFactory.class.getClassLoader().getResource("config/cacheConfig.xml").toURI();
} catch (URISyntaxException e) {
throw new RuntimeException("Cannot read the cache configuration!", e);
}
Consumer<String> configurator = configurationBuilderConsumer(builder, uri);
Consumer<String> configurator = configurationBuilderConsumer(builder);
ENTITY_DESCRIPTOR_MAP.values().stream()
.map(HotRodEntityDescriptor::getCacheName)
.distinct()
.forEach(configurator);
}
private Consumer<String> configurationBuilderConsumer(ConfigurationBuilder builder, URI uri) {
return cacheName -> {
RemoteCacheConfigurationBuilder rb = builder.remoteCache(cacheName);
boolean configureRemoteCaches = config.getBoolean("configureRemoteCaches", false);
if (configureRemoteCaches) {
rb.configurationURI(uri);
}
rb.nearCacheMode(config.scope(cacheName).getBoolean("nearCacheEnabled", config.getBoolean("nearCacheEnabled", true)) ? NearCacheMode.INVALIDATED : NearCacheMode.DISABLED)
.nearCacheMaxEntries(config.scope(cacheName).getInt("nearCacheMaxEntries", config.getInt("nearCacheMaxEntries", 10000)))
.nearCacheUseBloomFilter(config.scope(cacheName).getBoolean("nearCacheBloomFilter", config.getBoolean("nearCacheBloomFilter", false)));
private static URI getCacheConfigUri(String cacheName) {
try {
return DefaultHotRodConnectionProviderFactory.class.getClassLoader().getResource("config/" + cacheName + "-cache-config.xml").toURI();
} catch (URISyntaxException e) {
throw new RuntimeException("Cannot read the cache configuration for cache + " + cacheName, e);
}
}
private Consumer<String> configurationBuilderConsumer(ConfigurationBuilder builder) {
return cacheName -> {
LOG.debugf("Configuring cache %s", cacheName);
builder.remoteCache(cacheName)
.configurationURI(getCacheConfigUri(cacheName))
.nearCacheMode(config.scope(cacheName).getBoolean("nearCacheEnabled", config.getBoolean("nearCacheEnabled", true)) ? NearCacheMode.INVALIDATED : NearCacheMode.DISABLED)
.nearCacheMaxEntries(config.scope(cacheName).getInt("nearCacheMaxEntries", config.getInt("nearCacheMaxEntries", 10000)))
.nearCacheUseBloomFilter(config.scope(cacheName).getBoolean("nearCacheBloomFilter", config.getBoolean("nearCacheBloomFilter", false)));
};
}
}

View file

@ -0,0 +1,26 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="admin-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAdminEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>

View file

@ -0,0 +1,25 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="auth-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAuthEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>

View file

@ -0,0 +1,24 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="auth-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRootAuthenticationSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,30 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="authz" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodResourceServerEntity</indexed-entity>
<indexed-entity>kc.HotRodResourceEntity</indexed-entity>
<indexed-entity>kc.HotRodScopeEntity</indexed-entity>
<indexed-entity>kc.HotRodPolicyEntity</indexed-entity>
<indexed-entity>kc.HotRodPermissionTicketEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>

View file

@ -1,123 +0,0 @@
<!-- Used for configuration of remote caches on the Infinispan server if the configureRemoteCaches option is set to true
in DefaultHotRodConnectionProviderFactory configuration. -->
<infinispan>
<cache-container>
<!-- Specify all remote caches that should be created on the Infinispan server. -->
<distributed-cache name="auth-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRootAuthenticationSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="clients" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientEntity</indexed-entity>
<indexed-entity>kc.HotRodAttributeEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="client-scopes" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientScopeEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="groups" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodGroupEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="roles" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRoleEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="users" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserEntity</indexed-entity>
<indexed-entity>kc.HotRodAttributeEntity</indexed-entity>
<indexed-entity>kc.HotRodUserFederatedIdentityEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="user-login-failures" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserLoginFailureEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="realms" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRealmEntity</indexed-entity>
<indexed-entity>kc.HotRodComponentEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="user-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserSessionEntity</indexed-entity>
<indexed-entity>kc.HotRodAuthenticatedClientSessionEntityReference</indexed-entity>
<indexed-entity>kc.HotRodStringPair</indexed-entity>
<indexed-entity>kc.HotRodAuthenticatedClientSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="authz" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodResourceServerEntity</indexed-entity>
<indexed-entity>kc.HotRodResourceEntity</indexed-entity>
<indexed-entity>kc.HotRodScopeEntity</indexed-entity>
<indexed-entity>kc.HotRodPolicyEntity</indexed-entity>
<indexed-entity>kc.HotRodPermissionTicketEntity</indexed-entity>
<indexed-entity>kc.HotRodStringPair</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="auth-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAuthEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="admin-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAdminEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="single-use-objects" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodSingleUseObjectEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
</cache-container>
</infinispan>

View file

@ -0,0 +1,24 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="client-scopes" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientScopeEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,24 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="clients" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,24 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="groups" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodGroupEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -1,125 +0,0 @@
<!-- Configuration is used to start embedded Infinispan server in DefaultHotRodConnectionProviderFactory if
the embedded property is set tu true.-->
<infinispan>
<cache-container>
<transport stack="udp"/>
<!-- Specify all remote caches that should be created on the embedded Infinispan server. -->
<distributed-cache name="auth-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRootAuthenticationSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="clients" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientEntity</indexed-entity>
<indexed-entity>kc.HotRodAttributeEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="client-scopes" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientScopeEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="groups" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodGroupEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="roles" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRoleEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="users" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserEntity</indexed-entity>
<indexed-entity>kc.HotRodAttributeEntity</indexed-entity>
<indexed-entity>kc.HotRodUserFederatedIdentityEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="user-login-failures" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserLoginFailureEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="realms" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRealmEntity</indexed-entity>
<indexed-entity>kc.HotRodComponentEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="user-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserSessionEntity</indexed-entity>
<indexed-entity>kc.HotRodAuthenticatedClientSessionEntityReference</indexed-entity>
<indexed-entity>kc.HotRodStringPair</indexed-entity>
<indexed-entity>kc.HotRodAuthenticatedClientSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="authz" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodResourceServerEntity</indexed-entity>
<indexed-entity>kc.HotRodResourceEntity</indexed-entity>
<indexed-entity>kc.HotRodScopeEntity</indexed-entity>
<indexed-entity>kc.HotRodPolicyEntity</indexed-entity>
<indexed-entity>kc.HotRodPermissionTicketEntity</indexed-entity>
<indexed-entity>kc.HotRodStringPair</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="auth-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAuthEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="admin-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAdminEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="single-use-objects" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodSingleUseObjectEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
</cache-container>
</infinispan>

View file

@ -0,0 +1,26 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="realms" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRealmEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,25 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="roles" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRoleEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,26 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="single-use-objects" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodSingleUseObjectEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,25 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="user-login-failures" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserLoginFailureEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,26 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="user-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserSessionEntity</indexed-entity>
<indexed-entity>kc.HotRodAuthenticatedClientSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -0,0 +1,25 @@
<!--
~ Copyright 2022 Red Hat, Inc. and/or its affiliates
~ and other contributors as indicated by the @author tags.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<distributed-cache name="users" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>

View file

@ -92,7 +92,7 @@
<jakarta.persistence.version>2.2.3</jakarta.persistence.version>
<hibernate.core.version>5.3.24.Final</hibernate.core.version>
<hibernate.c3p0.version>5.3.24.Final</hibernate.c3p0.version>
<infinispan.version>12.1.7.Final</infinispan.version>
<infinispan.version>13.0.10.Final</infinispan.version>
<infinispan.protostream.processor.version>4.4.1.Final</infinispan.protostream.processor.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<jackson.version>2.13.2</jackson.version>

View file

@ -45,7 +45,6 @@
<postgresql.version>42.3.3</postgresql.version>
<microprofile-metrics-api.version>3.0.1</microprofile-metrics-api.version>
<wildfly.common.version>1.5.4.Final-format-001</wildfly.common.version>
<infinispan.version>13.0.9.Final</infinispan.version>
<wildfly-elytron.version>1.18.3.Final</wildfly-elytron.version>
<!--

View file

@ -125,6 +125,7 @@
<!--DB Container -->
<kc.db.postgresql.container.image>postgres:alpine</kc.db.postgresql.container.image>
<kc.db.mariadb.container.image>mariadb:10.5.9</kc.db.mariadb.container.image>
<kc.infinispan.container.image>quay.io/infinispan/server:${infinispan.version}</kc.infinispan.container.image>
</systemPropertyVariables>
</configuration>
</plugin>

View file

@ -97,6 +97,7 @@ public class DatabaseContainer {
String POSTGRES_IMAGE = System.getProperty("kc.db.postgresql.container.image", "postgres:alpine");
String MARIADB_IMAGE = System.getProperty("kc.db.mariadb.container.image", "mariadb:10.5.9");
String MYSQL_IMAGE = System.getProperty("kc.db.mysql.container.image", "mysql:latest");
String INFINISPAN_IMAGE = System.getProperty("kc.infinispan.container.image");
DockerImageName POSTGRES = DockerImageName.parse(POSTGRES_IMAGE).asCompatibleSubstituteFor("postgres");
DockerImageName MARIADB = DockerImageName.parse(MARIADB_IMAGE).asCompatibleSubstituteFor("mariadb");
@ -110,7 +111,7 @@ public class DatabaseContainer {
case "mysql":
return configureJdbcContainer(new MySQLContainer(MYSQL));
case "infinispan":
return configureInfinispanUser(new GenericContainer("quay.io/infinispan/server:12.1.7.Final"))
return configureInfinispanUser(new GenericContainer(INFINISPAN_IMAGE))
.withExposedPorts(11222);
default:
throw new RuntimeException("Unsupported database: " + alias);

View file

@ -31,7 +31,8 @@
<properties>
<cache.server>infinispan</cache.server>
<!-- CrossDC tests are failing with ISPN version 13.0.10, these tests will be updated in future therefore we leave this version on ISPN 12 -->
<infinispan.version>12.1.7.Final</infinispan.version>
<cache.server.infinispan.groupId>org.infinispan.server</cache.server.infinispan.groupId>
<cache.server.infinispan.artifactId>infinispan-server</cache.server.infinispan.artifactId>
<cache.server.infinispan.version>${infinispan.version}</cache.server.infinispan.version>

View file

@ -63,6 +63,10 @@ public class InfinispanContainer extends GenericContainer<InfinispanContainer> {
throw new IllegalStateException("Cannot find IP address of the Infinispan server. See test log for Infinispan container log.");
}
HOST = matcher.group(1);
if ("0.0.0.0".equals(HOST)) {
HOST = "127.0.0.1";
}
}
return HOST;

View file

@ -110,11 +110,6 @@
<groupId>org.infinispan</groupId>
<artifactId>infinispan-server-core</artifactId>
</dependency>
<dependency>
<groupId>org.infinispan</groupId>
<artifactId>infinispan-component-annotations</artifactId>
<version>${infinispan.version}</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>

View file

@ -1,121 +0,0 @@
<infinispan>
<cache-container>
<transport stack="udp"/>
<distributed-cache name="auth-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRootAuthenticationSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="clients" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientEntity</indexed-entity>
<indexed-entity>kc.HotRodAttributeEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="client-scopes" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodClientScopeEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="groups" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodGroupEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="roles" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRoleEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="users" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserEntity</indexed-entity>
<indexed-entity>kc.HotRodAttributeEntity</indexed-entity>
<indexed-entity>kc.HotRodUserFederatedIdentityEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="user-login-failures" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserLoginFailureEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="realms" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodRealmEntity</indexed-entity>
<indexed-entity>kc.HotRodComponentEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="user-sessions" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodUserSessionEntity</indexed-entity>
<indexed-entity>kc.HotRodAuthenticatedClientSessionEntityReference</indexed-entity>
<indexed-entity>kc.HotRodStringPair</indexed-entity>
<indexed-entity>kc.HotRodAuthenticatedClientSessionEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
<distributed-cache name="authz" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodResourceServerEntity</indexed-entity>
<indexed-entity>kc.HotRodResourceEntity</indexed-entity>
<indexed-entity>kc.HotRodScopeEntity</indexed-entity>
<indexed-entity>kc.HotRodPolicyEntity</indexed-entity>
<indexed-entity>kc.HotRodPermissionTicketEntity</indexed-entity>
<indexed-entity>kc.HotRodStringPair</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="auth-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAuthEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="admin-events" mode="SYNC">
<encoding media-type="application/x-protostream"/>
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodAdminEventEntity</indexed-entity>
</indexed-entities>
</indexing>
</distributed-cache>
<distributed-cache name="single-use-objects" mode="SYNC">
<indexing>
<indexed-entities>
<indexed-entity>kc.HotRodSingleUseObjectEntity</indexed-entity>
</indexed-entities>
</indexing>
<encoding media-type="application/x-protostream"/>
</distributed-cache>
</cache-container>
</infinispan>