| | |
| | | import static org.opends.server.loggers.AccessLogger.logCompareResponse; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import static org.opends.messages.CoreMessages.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.Iterator; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.plugin.PluginResult; |
| | |
| | | // The assertion value for the compare operation. |
| | | private ByteString assertionValue; |
| | | |
| | | // The set of attribute options |
| | | private Set<String> attributeOptions; |
| | | |
| | | // The raw, unprocessed entry DN as included in the client request. |
| | | private ByteString rawEntryDN; |
| | | |
| | |
| | | responseControls = new ArrayList<Control>(); |
| | | entryDN = null; |
| | | attributeType = null; |
| | | attributeOptions = null; |
| | | cancelRequest = null; |
| | | proxiedAuthorizationDN = null; |
| | | } |
| | |
| | | rawAttributeType = attributeType.getNameOrOID(); |
| | | cancelRequest = null; |
| | | proxiedAuthorizationDN = null; |
| | | attributeOptions = new HashSet<String>(); |
| | | } |
| | | |
| | | |
| | |
| | | this.rawAttributeType = rawAttributeType; |
| | | |
| | | attributeType = null; |
| | | attributeOptions = null; |
| | | } |
| | | |
| | | |
| | | |
| | | private void getAttributeTypeAndOptions() { |
| | | String baseName; |
| | | int semicolonPos = rawAttributeType.indexOf(';'); |
| | | if (semicolonPos > 0) { |
| | | baseName = toLowerCase(rawAttributeType.substring(0, semicolonPos)); |
| | | |
| | | attributeOptions = new HashSet<String>(); |
| | | int nextPos = rawAttributeType.indexOf(';', semicolonPos+1); |
| | | while (nextPos > 0) |
| | | { |
| | | attributeOptions.add( |
| | | rawAttributeType.substring(semicolonPos+1, nextPos)); |
| | | semicolonPos = nextPos; |
| | | nextPos = rawAttributeType.indexOf(';', semicolonPos+1); |
| | | } |
| | | |
| | | attributeOptions.add(rawAttributeType.substring(semicolonPos+1)); |
| | | } |
| | | else |
| | | { |
| | | baseName = toLowerCase(rawAttributeType); |
| | | attributeOptions = null; |
| | | } |
| | | attributeType = DirectoryServer.getAttributeType(baseName, true); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final AttributeType getAttributeType() |
| | | { |
| | | if (attributeType == null) { |
| | | getAttributeTypeAndOptions(); |
| | | } |
| | | return attributeType; |
| | | } |
| | | |
| | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public Set<String> getAttributeOptions() |
| | | { |
| | | if (attributeOptions == null) { |
| | | getAttributeTypeAndOptions(); |
| | | } |
| | | return attributeOptions; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public void setAttributeOptions(Set<String> attributeOptions) |
| | | { |
| | | this.attributeOptions = attributeOptions; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | public final ByteString getAssertionValue() |
| | | { |
| | | return assertionValue; |