Package org.ldaptive.control
Class AbstractResponseControl
java.lang.Object
org.ldaptive.control.AbstractControl
org.ldaptive.control.AbstractResponseControl
- All Implemented Interfaces:
Control,ResponseControl,Freezable
- Direct Known Subclasses:
AuthorizationIdentityResponseControl,DirSyncControl,EntryChangeNotificationControl,GenericControl,GetStatsControl,PagedResultsControl,PasswordExpiredControl,PasswordExpiringControl,PasswordPolicyControl,SessionTrackingControl,SortResponseControl,SyncDoneControl,SyncStateControl,VirtualListViewResponseControl
public abstract class AbstractResponseControl
extends AbstractControl
implements ResponseControl, Freezable
Base class for response controls.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AtomicBooleanWhether this object has been marked immutable.Fields inherited from class org.ldaptive.control.AbstractControl
logger -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new abstract response control.AbstractResponseControl(String id, boolean b) Creates a new abstract response control. -
Method Summary
Modifier and TypeMethodDescriptionvoidAsserts that this object is in a state to permit mutations.voidfreeze()Freezes this object, making it immutable.protected voidSets this control as immutable, throws if the control has already been frozen.booleanisFrozen()Determines whether this object is frozen, i.e. immutable.Methods inherited from class org.ldaptive.control.AbstractControl
equals, getCriticality, getOID, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.ldaptive.control.Control
getCriticality, getOIDMethods inherited from interface org.ldaptive.control.ResponseControl
decode
-
Field Details
-
immutable
Whether this object has been marked immutable.
-
-
Constructor Details
-
AbstractResponseControl
Creates a new abstract response control.- Parameters:
id- OID of this control
-
AbstractResponseControl
Creates a new abstract response control.- Parameters:
id- OID of this controlb- whether this control is critical
-
-
Method Details
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable. -
isFrozen
public boolean isFrozen()Description copied from interface:FreezableDetermines whether this object is frozen, i.e. immutable.- Specified by:
isFrozenin interfaceFreezable- Returns:
- True if
Freezable.freeze()has been invoked, false otherwise.
-
assertMutable
public void assertMutable()Description copied from interface:FreezableAsserts that this object is in a state to permit mutations. Classes that implement this interface should invoke this method prior to performing any mutation of internal state as a means of implementing the "frozen" usage contract.- Specified by:
assertMutablein interfaceFreezable
-
freezeAndAssertMutable
protected void freezeAndAssertMutable()Sets this control as immutable, throws if the control has already been frozen.- Throws:
IllegalStateException- if the control has already been frozen
-