mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
01.31.2015 f1d83efcb7972349a3b7fffa7b812fb15d538ddf
OPENDJ-2480 Upgrade fails while migrating JE backend

This time the problem is due to an incorrect deserialization of VLVKeyComparator class

Fixed by resurrecting OrderingMatchingRule interface + making all *OrderingMatchingRule classes implement it
and adding a serialVersionUID to VLVKeyComparator class.
2 files added
9 files modified
105 ■■■■■ changed files
opendj-legacy/src/main/java/org/opends/server/api/OrderingMatchingRule.java 35 ●●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/api/package-info.java 44 ●●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java 2 ●●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/CaseExactOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/CaseIgnoreOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/IntegerOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/NumericStringOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/OctetStringOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/UUIDOrderingMatchingRule.java 3 ●●●● patch | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/api/OrderingMatchingRule.java
New file
@@ -0,0 +1,35 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at legal-notices/CDDLv1_0.txt.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *      Copyright 2015 ForgeRock AS
 */
package org.opends.server.api;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
 *
 * @deprecated since OPENDJ-1591 Migrate matching rules
 * @deprecated since OPENDJ-2337 Remove old JE local-db backend code and JE changelog
 */
@Deprecated
public interface OrderingMatchingRule {
}
opendj-legacy/src/main/java/org/opends/server/api/package-info.java
New file
@@ -0,0 +1,44 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at legal-notices/CDDLv1_0.txt.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2015 ForgeRock AS
 */
/**
 * Contains a number of API declarations for use throughout the
 * Directory Server.  Whenever possible, these APIs should be declared
 * using abstract classes rather than interfaces so that they can be
 * altered in future versions without impacting backward
 * compatibility.
 * <BR><BR>
 * Note that the mere existence of a class or interface in this
 * package does not in itself imply that it is intended for use by
 * third party code.  Please refer to the official product
 * documentation to indicate which APIs may be safely used by anyone
 * other than the core Directory Server developers.  Failure to heed
 * this warning may result in code that could have unintended side
 * effects or that does not work properly across different Directory
 * Server versions.
 */
package org.opends.server.api;
opendj-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java
@@ -35,6 +35,8 @@
 */
@Deprecated
public class VLVKeyComparator extends DummyByteArrayComparator {
    private static final long serialVersionUID = 1585167927344130604L;
    @Override
    public int compare(byte[] b1, byte[] b2) {
        return 0;
opendj-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.replication.plugin;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class HistoricalCsnOrderingMatchingRule extends DummyByteArrayComparator {
public class HistoricalCsnOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = -3424403930225609943L;
}
opendj-legacy/src/main/java/org/opends/server/schema/CaseExactOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.schema;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class CaseExactOrderingMatchingRule extends DummyByteArrayComparator {
public class CaseExactOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = -5904188628828913709L;
}
opendj-legacy/src/main/java/org/opends/server/schema/CaseIgnoreOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.schema;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class CaseIgnoreOrderingMatchingRule extends DummyByteArrayComparator {
public class CaseIgnoreOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = -8992263058903266096L;
}
opendj-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.schema;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class GeneralizedTimeOrderingMatchingRule extends DummyByteArrayComparator {
public class GeneralizedTimeOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = -6343622924726948145L;
}
opendj-legacy/src/main/java/org/opends/server/schema/IntegerOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.schema;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class IntegerOrderingMatchingRule extends DummyByteArrayComparator {
public class IntegerOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = 6654300545706161754L;
}
opendj-legacy/src/main/java/org/opends/server/schema/NumericStringOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.schema;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class NumericStringOrderingMatchingRule extends DummyByteArrayComparator {
public class NumericStringOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = 388436004219363604L;
}
opendj-legacy/src/main/java/org/opends/server/schema/OctetStringOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.schema;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class OctetStringOrderingMatchingRule extends DummyByteArrayComparator {
public class OctetStringOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = 3832343819704649155L;
}
opendj-legacy/src/main/java/org/opends/server/schema/UUIDOrderingMatchingRule.java
@@ -25,6 +25,7 @@
package org.opends.server.schema;
import org.opends.legacy.DummyByteArrayComparator;
import org.opends.server.api.OrderingMatchingRule;
/**
 * Required by rebuild-index process when upgrading to OpenDJ3.
@@ -32,6 +33,6 @@
 * @deprecated since OPENDJ-1591 Migrate matching rules
 */
@Deprecated
public class UUIDOrderingMatchingRule extends DummyByteArrayComparator {
public class UUIDOrderingMatchingRule extends DummyByteArrayComparator implements OrderingMatchingRule {
    private static final long serialVersionUID = -3877941142853469687L;
}