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 * trunk/opends/resource/legal-notices/OpenDS.LICENSE 011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE. 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 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2006-2008 Sun Microsystems, Inc. 026 */ 027 package org.opends.server.types; 028 import org.opends.messages.Message; 029 030 031 /** 032 * This class defines an exception that may be thrown if a problem 033 * occurs while attempting to iterate across the members of a group. 034 */ 035 @org.opends.server.types.PublicAPI( 036 stability=org.opends.server.types.StabilityLevel.UNCOMMITTED, 037 mayInstantiate=true, 038 mayExtend=false, 039 mayInvoke=true) 040 public final class MembershipException 041 extends IdentifiedException 042 { 043 /** 044 * The serial version identifier required to satisfy the compiler 045 * because this class extends <CODE>java.lang.Exception</CODE>, 046 * which implements the <CODE>java.io.Serializable</CODE> interface. 047 * This value was generated using the <CODE>serialver</CODE> 048 * command-line utility included with the Java SDK. 049 */ 050 private static final long serialVersionUID = -7312072056288770065L; 051 052 053 054 /** 055 * Indicates whether it is possible to continue iterating through 056 * the list of group members. 057 */ 058 private final boolean continueIterating; 059 060 061 062 063 064 /** 065 * Creates a new membership exception with the provided information. 066 * 067 * @param errorMessage The error message for this membership 068 * exception. 069 * @param continueIterating Indicates whether it is possible to 070 * continue iterating through the list of 071 * group members. 072 */ 073 public MembershipException(Message errorMessage, 074 boolean continueIterating) 075 { 076 super(errorMessage); 077 078 this.continueIterating = continueIterating; 079 } 080 081 082 083 /** 084 * Creates a new membership exception with the provided information. 085 * 086 * @param errorMessage The error message for this membership 087 * exception. 088 * @param continueIterating Indicates whether it is possible to 089 * continue iterating through the list of 090 * group members. 091 * @param cause The underlying cause for this 092 * membership exception. 093 */ 094 public MembershipException(Message errorMessage, 095 boolean continueIterating, 096 Throwable cause) 097 { 098 super(errorMessage, cause); 099 100 101 this.continueIterating = continueIterating; 102 } 103 104 105 106 /** 107 * Retrieves the error message for this membership exception. 108 * 109 * @return The error message for this membership exception. 110 */ 111 public Message getErrorMessage() 112 { 113 return getMessageObject(); 114 } 115 116 117 118 /** 119 * Indicates whether it is possible to continue iterating through 120 * the list of group members. 121 * 122 * @return {@code true} if it is possible to continue iterating 123 * through the list of group members, or {@code false} if 124 * not. 125 */ 126 public boolean continueIterating() 127 { 128 return continueIterating; 129 } 130 } 131