001/* 002 * The contents of this file are subject to the terms of the Common Development and 003 * Distribution License (the License). You may not use this file except in compliance with the 004 * License. 005 * 006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the 007 * specific language governing permission and limitations under the License. 008 * 009 * When distributing Covered Software, include this CDDL Header Notice in each file and include 010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL 011 * Header, with the fields enclosed by brackets [] replaced by your own identifying 012 * information: "Portions Copyright [year] [name of copyright owner]". 013 * 014 * Copyright 2006-2008 Sun Microsystems, Inc. 015 * Portions Copyright 2014-2016 ForgeRock AS. 016 */ 017package org.opends.server.util; 018 019import static org.forgerock.util.Reject.*; 020 021import org.forgerock.opendj.ldap.DN; 022 023 024 025/** 026 * This abstract class defines methods for a change record entry. It 027 * includes operations to get the DN, as well as methods to 028 * decode the entry. 029 */ 030@org.opends.server.types.PublicAPI( 031 stability=org.opends.server.types.StabilityLevel.VOLATILE, 032 mayInstantiate=false, 033 mayExtend=false, 034 mayInvoke=true) 035public abstract class ChangeRecordEntry 036{ 037 /** The DN for this entry. */ 038 private DN dn; 039 040 041 /** 042 * Creates a new change record entry with the provided information. 043 * 044 * @param dn The distinguished name for this change record entry. It must 045 * not be <CODE>null</CODE>. 046 */ 047 protected ChangeRecordEntry(DN dn) 048 { 049 ifNull(dn); 050 this.dn = dn; 051 } 052 053 054 /** 055 * Retrieves the distinguished name for this entry. 056 * 057 * @return The distinguished name for this entry. 058 */ 059 public final DN getDN() 060 { 061 return dn; 062 } 063 064 065 066 /** 067 * Retrieves the name of the change operation type. 068 * 069 * @return The name of the change operation type. 070 */ 071 public abstract ChangeOperationType getChangeOperationType(); 072 073 074 075 /** 076 * Retrieves a string representation of this change record entry. 077 * 078 * @return A string representation of this change record entry. 079 */ 080 public abstract String toString(); 081} 082