001 /* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at 010 * docs/licenses/cddl.txt 011 * or http://www.opensource.org/licenses/cddl1.php. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * docs/licenses/cddl.txt. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2010-2014 UnboundID Corp. 026 */ 027 package com.unboundid.directory.sdk.ds.types; 028 029 030 031 import java.io.Serializable; 032 033 import com.unboundid.util.NotMutable; 034 import com.unboundid.util.ThreadSafety; 035 import com.unboundid.util.ThreadSafetyLevel; 036 037 038 039 /** 040 * This class defines a structure which may be used to provide information about 041 * the result of the processing performed by a subordinate modify DN plugin. 042 */ 043 @NotMutable() 044 @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 045 public final class SubordinateModifyDNPluginResult 046 implements Serializable 047 { 048 /** 049 * A predefined result instance that indicates all processing completed 050 * successfully. 051 */ 052 public static final SubordinateModifyDNPluginResult SUCCESS = 053 new SubordinateModifyDNPluginResult(false, true, false); 054 055 056 057 /** 058 * The serial version UID for this serializable class. 059 */ 060 private static final long serialVersionUID = 2615120577332760939L; 061 062 063 064 // Indicates whether to abort the modify DN operation and revert any changes 065 // that may have already been applied for it. 066 private final boolean abortModifyDNOperation; 067 068 // Indicates whether the client connection was terminated by the plugin. 069 private final boolean connectionTerminated; 070 071 // Indicates whether the server should continue processing other subordinate 072 // modify DN plugins for the associated entry. 073 private final boolean continuePluginProcessing; 074 075 076 077 /** 078 * Creates a new subordinate modify DN plugin result with the provided 079 * information. 080 * 081 * @param connectionTerminated Indicates whether the client connection 082 * was terminated by the plugin. 083 * @param continuePluginProcessing Indicates whether to continue processing 084 * other subordinate modify DN plugins for 085 * the associated entry. 086 * @param abortModifyDNOperation Indicates whether to abort all processing 087 * for the modify DN operation and revert 088 * any changes that may have already been 089 * applied for it. 090 */ 091 public SubordinateModifyDNPluginResult(final boolean connectionTerminated, 092 final boolean continuePluginProcessing, 093 final boolean abortModifyDNOperation) 094 { 095 this.connectionTerminated = connectionTerminated; 096 this.continuePluginProcessing = continuePluginProcessing; 097 this.abortModifyDNOperation = abortModifyDNOperation; 098 } 099 100 101 102 /** 103 * Indicates whether the client connection was terminated by the plugin. 104 * 105 * @return {@code true} if the client connection was terminated by the 106 * plugin, or {@code false} if not. 107 */ 108 public boolean connectionTerminated() 109 { 110 return connectionTerminated; 111 } 112 113 114 115 /** 116 * Indicates whether to continue processing other subordinate modify DN 117 * plugins for the associated entry. 118 * 119 * @return {@code true} if the server should continue processing other 120 * subordinate modify DN plugins for the associated entry, or 121 * {@code false} if not. 122 */ 123 public boolean continuePluginProcessing() 124 { 125 return continuePluginProcessing; 126 } 127 128 129 130 /** 131 * Indicates whether to abort the modify DN operation and revert any changes 132 * that may have already been applied for it. 133 * 134 * @return {@code true} if the server should abort the modify DN operation, 135 * or {@code false} if not. 136 */ 137 public boolean abortModifyDNOperation() 138 { 139 return abortModifyDNOperation; 140 } 141 142 143 144 /** 145 * Retrieves a string representation of this search entry plugin result. 146 * 147 * @return A string representation of this search entry plugin result. 148 */ 149 @Override() 150 public String toString() 151 { 152 final StringBuilder buffer = new StringBuilder(); 153 154 buffer.append("SubordinateModifyDNPluginResult(connectionTerminated="); 155 buffer.append(connectionTerminated); 156 buffer.append(", continuePluginProcessing="); 157 buffer.append(continuePluginProcessing); 158 buffer.append(", abortModifyDNOperation="); 159 buffer.append(abortModifyDNOperation); 160 buffer.append(')'); 161 162 return buffer.toString(); 163 } 164 }