Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* The contents of this file are subject to the terms of the Common Development and
* Distribution License (the License). You may not use this file except in compliance with the
* License.
*
* You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
* specific language governing permission and limitations under the License.
*
* When distributing Covered Software, include this CDDL Header Notice in each file and include
* the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions copyright [year] [name of copyright owner]".
*
* Copyright 2023-2026 3A Systems, LLC.
*/
package org.opends.server.backends.cassandra;

import org.forgerock.opendj.config.server.ConfigException;
Expand All @@ -8,9 +23,9 @@
public class Backend extends BackendImpl<CASBackendCfg>{

@Override
protected Storage configureStorage(CASBackendCfg cfg, ServerContext serverContext) throws ConfigException
protected CASStorage configureStorage(CASBackendCfg cfg, ServerContext serverContext) throws ConfigException
{
return new Storage(cfg, serverContext);
return new CASStorage(cfg, serverContext);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@
import com.github.benmanes.caffeine.cache.Caffeine;
import com.github.benmanes.caffeine.cache.LoadingCache;

public class Storage implements org.opends.server.backends.pluggable.spi.Storage, ConfigurationChangeListener<CASBackendCfg>{
public class CASStorage implements org.opends.server.backends.pluggable.spi.Storage, ConfigurationChangeListener<CASBackendCfg>{

private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();

private CASBackendCfg config;

public Storage(CASBackendCfg cfg, ServerContext serverContext) {
public CASStorage(CASBackendCfg cfg, ServerContext serverContext) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'serverContext' is never used.
Comment thread
vharseko marked this conversation as resolved.
Dismissed
this.config = cfg;
cfg.addCASChangeListener(this);
}
Expand Down Expand Up @@ -123,7 +123,7 @@
this.accessMode=accessMode;
session=CqlSession.builder()
.withApplicationName("OpenDJ "+getKeyspaceName()+"."+config.getBackendId())
.withConfigLoader(DriverConfigLoader.fromDefaults(Storage.class.getClassLoader()))
.withConfigLoader(DriverConfigLoader.fromDefaults(CASStorage.class.getClassLoader()))
.build();
if (AccessMode.READ_WRITE.equals(accessMode)) {
execute(prepared.get("CREATE KEYSPACE IF NOT EXISTS "+getKeyspaceName()+" WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};").bind().setExecutionProfileName(profile));
Expand Down Expand Up @@ -450,7 +450,7 @@
@Override
public void close() {
if (!isOpen) {
Storage.this.close();
CASStorage.this.close();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2024 3A Systems, LLC.
* Copyright 2024-2026 3A Systems, LLC.
*/
package org.opends.server.backends.jdbc;

Expand All @@ -23,9 +23,9 @@
public class Backend extends BackendImpl<JDBCBackendCfg>{

@Override
protected Storage configureStorage(JDBCBackendCfg cfg, ServerContext serverContext) throws ConfigException
protected JDBCStorage configureStorage(JDBCBackendCfg cfg, ServerContext serverContext) throws ConfigException
{
return new Storage(cfg, serverContext);
return new JDBCStorage(cfg, serverContext);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
import static org.opends.server.backends.pluggable.spi.StorageUtils.addErrorMessage;
import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;

public class Storage implements org.opends.server.backends.pluggable.spi.Storage, ConfigurationChangeListener<JDBCBackendCfg>{
public class JDBCStorage implements org.opends.server.backends.pluggable.spi.Storage, ConfigurationChangeListener<JDBCBackendCfg>{

private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();

private JDBCBackendCfg config;

public Storage(JDBCBackendCfg cfg, ServerContext serverContext) {
public JDBCStorage(JDBCBackendCfg cfg, ServerContext serverContext) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'serverContext' is never used.
Comment thread
vharseko marked this conversation as resolved.
Dismissed
this.config = cfg;
cfg.addJDBCChangeListener(this);
}
Expand Down Expand Up @@ -649,7 +649,7 @@
throw new StorageRuntimeException(e);
}
if (!isOpen) {
Storage.this.close();
JDBCStorage.this.close();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*
* Copyright 2009-2010 Sun Microsystems, Inc.
* Portions Copyright 2011-2016 ForgeRock AS.
* Portions Copyright 2026 3A Systems, LLC.
*/
package org.opends.server.core;

Expand Down Expand Up @@ -218,9 +219,9 @@ private void removeSubentry(Entry entry)
lock.writeLock().lock();
try
{
if (!removeSubEntry(dn2SubEntry, entry))
if (!removeSubentryFrom(dn2SubEntry, entry))
{
removeSubEntry(dn2CollectiveSubEntry, entry);
removeSubentryFrom(dn2CollectiveSubEntry, entry);
}
}
finally
Expand All @@ -229,7 +230,7 @@ private void removeSubentry(Entry entry)
}
}

private boolean removeSubEntry(Map<DN, List<SubEntry>> subEntryMap, Entry entry)
private boolean removeSubentryFrom(Map<DN, List<SubEntry>> subEntryMap, Entry entry)
{
Iterator<List<SubEntry>> subEntryListsIt = subEntryMap.values().iterator();
while (subEntryListsIt.hasNext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2023 3A Systems, LLC.
* Copyright 2023-2026 3A Systems, LLC.
*/
package org.opends.server.backends.cassandra;

Expand Down Expand Up @@ -51,7 +51,7 @@ protected Backend createBackend() {

//test allow cassandra
try(CqlSession session=CqlSession.builder()
.withConfigLoader(DriverConfigLoader.fromDefaults(Storage.class.getClassLoader()))
.withConfigLoader(DriverConfigLoader.fromDefaults(CASStorage.class.getClassLoader()))
.build()){
session.close();
}catch (AllNodesFailedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Header, with the fields enclosed by brackets [] replaced by your own identifying
* information: "Portions Copyright [year] [name of copyright owner]".
*
* Copyright 2023 3A Systems, LLC.
* Copyright 2023-2026 3A Systems, LLC.
*/
package org.opends.server.backends.cassandra;

Expand Down Expand Up @@ -51,7 +51,7 @@ protected Backend createBackend() {

//test allow cassandra
try(CqlSession session=CqlSession.builder()
.withConfigLoader(DriverConfigLoader.fromDefaults(Storage.class.getClassLoader()))
.withConfigLoader(DriverConfigLoader.fromDefaults(CASStorage.class.getClassLoader()))
.build()){
session.close();
}catch (AllNodesFailedException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private static ByteString value(int i) {
@Test
public void testCursorCrossesFetchSizeBatches() throws Exception {
System.setProperty("org.openidentityplatform.opendj.jdbc.fetchsize", "2");
final Storage storage = new Storage(createBackendCfg(), null);
final JDBCStorage storage = new JDBCStorage(createBackendCfg(), null);
final TreeName tree = new TreeName("testCursorBatch", "tree");
try {
storage.open(AccessMode.READ_WRITE);
Expand Down
Loading