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 post-operation plugin. 042 */ 043 @NotMutable() 044 @ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE) 045 public final class PostOperationPluginResult 046 implements Serializable 047 { 048 /** 049 * A predefined result instance that indicates all processing completed 050 * successfully. 051 */ 052 public static final PostOperationPluginResult SUCCESS = 053 new PostOperationPluginResult(false, true); 054 055 056 057 /** 058 * The serial version UID for this serializable class. 059 */ 060 private static final long serialVersionUID = -255249379093850659L; 061 062 063 064 // Indicates whether the client connection was terminated by the plugin. 065 private final boolean connectionTerminated; 066 067 // Indicates whether the server should continue processing other 068 // post-operation plugins. 069 private final boolean continuePluginProcessing; 070 071 072 073 /** 074 * Creates a new post-operation plugin result with the provided information. 075 * 076 * @param connectionTerminated Indicates whether the client connection 077 * was terminated by the plugin. 078 * @param continuePluginProcessing Indicates whether to continue processing 079 * other post-operation plugins for the 080 * operation. 081 */ 082 public PostOperationPluginResult(final boolean connectionTerminated, 083 final boolean continuePluginProcessing) 084 { 085 this.connectionTerminated = connectionTerminated; 086 this.continuePluginProcessing = continuePluginProcessing; 087 } 088 089 090 091 /** 092 * Indicates whether the client connection was terminated by the plugin. 093 * 094 * @return {@code true} if the client connection was terminated by the 095 * plugin, or {@code false} if not. 096 */ 097 public boolean connectionTerminated() 098 { 099 return connectionTerminated; 100 } 101 102 103 104 /** 105 * Indicates whether to continue processing other post-operation plugins for 106 * the operation. 107 * 108 * @return {@code true} if the server should continue processing other 109 * post-operation plugins for the operation, or {@code false} if 110 * not. 111 */ 112 public boolean continuePluginProcessing() 113 { 114 return continuePluginProcessing; 115 } 116 117 118 119 /** 120 * Retrieves a string representation of this post-operation plugin result. 121 * 122 * @return A string representation of this post-operation plugin result. 123 */ 124 @Override() 125 public String toString() 126 { 127 final StringBuilder buffer = new StringBuilder(); 128 129 buffer.append("PostOperationPluginResult(connectionTerminated="); 130 buffer.append(connectionTerminated); 131 buffer.append(", continuePluginProcessing="); 132 buffer.append(continuePluginProcessing); 133 buffer.append(')'); 134 135 return buffer.toString(); 136 } 137 }