| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ByteSequence; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ConditionResult; |
| | | import org.opends.server.admin.std.server.VirtualAttributeCfg; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.types.AttributeValue; |
| | | import org.opends.server.types.Entry; |
| | |
| | | VirtualAttributeCfg configuration, |
| | | List<LocalizableMessage> unacceptableReasons) |
| | | { |
| | | // This default implementation does not perform any special |
| | | // validation. It should be overridden by virtual attribute |
| | | // provider implementations that wish to perform more detailed |
| | | // validation. |
| | | // This default implementation does not perform any special validation. |
| | | // It should be overridden by virtual attribute provider implementations |
| | | // that wish to perform more detailed validation. |
| | | return true; |
| | | } |
| | | |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // The substring couldn't be normalized. We have to return |
| | | // "undefined". |
| | | // The substring couldn't be normalized => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // The substring couldn't be normalized. We have to return |
| | | // "undefined". |
| | | // The substring couldn't be normalized => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // The substring couldn't be normalized. We have to return |
| | | // "undefined". |
| | | // The substring couldn't be normalized => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = matchingRule.normalizeAttributeValue(value.getValue()); |
| | | if (matchingRule.valueMatchesSubstring( |
| | | value.getNormalizedValue(), |
| | | nv, |
| | | normalizedSubInitial, |
| | | normalizedSubAny, |
| | | normalizedSubFinal)) |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // The value couldn't be normalized. If we can't find a |
| | | // definite match, then we should return "undefined". |
| | | // We couldn't normalize one of the attribute values. |
| | | // We will return "undefined" if we can't find a definite match |
| | | result = ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | ByteString normalizedValue; |
| | | try |
| | | { |
| | | normalizedValue = value.getNormalizedValue(); |
| | | normalizedValue = matchingRule.normalizeAttributeValue(value.getValue()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize the provided value. We should return |
| | | // "undefined". |
| | | // We couldn't normalize the provided value => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = v.getNormalizedValue(); |
| | | int comparisonResult = |
| | | matchingRule.compareValues(nv, normalizedValue); |
| | | if (comparisonResult >= 0) |
| | | ByteString nv = matchingRule.normalizeAttributeValue(v.getValue()); |
| | | if (matchingRule.compareValues(nv, normalizedValue) >= 0) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize one of the attribute values. If we |
| | | // can't find a definite match, then we should return |
| | | // "undefined". |
| | | // We couldn't normalize one of the attribute values. |
| | | // We will return "undefined" if we can't find a definite match |
| | | result = ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | ByteString normalizedValue; |
| | | try |
| | | { |
| | | normalizedValue = value.getNormalizedValue(); |
| | | normalizedValue = matchingRule.normalizeAttributeValue(value.getValue()); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize the provided value. We should return |
| | | // "undefined". |
| | | // We couldn't normalize the provided value => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | |
| | | { |
| | | try |
| | | { |
| | | ByteString nv = v.getNormalizedValue(); |
| | | int comparisonResult = |
| | | matchingRule.compareValues(nv, normalizedValue); |
| | | if (comparisonResult <= 0) |
| | | ByteString nv = matchingRule.normalizeAttributeValue(v.getValue()); |
| | | if (matchingRule.compareValues(nv, normalizedValue) <= 0) |
| | | { |
| | | return ConditionResult.TRUE; |
| | | } |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize one of the attribute values. If we |
| | | // can't find a definite match, then we should return |
| | | // "undefined". |
| | | // We couldn't normalize one of the attribute values. |
| | | // We will return "undefined" if we can't find a definite match |
| | | result = ConditionResult.UNDEFINED; |
| | | } |
| | | } |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize the provided value. We should return |
| | | // "undefined". |
| | | // We couldn't normalize the provided value => return "undefined". |
| | | return ConditionResult.UNDEFINED; |
| | | } |
| | | |
| | |
| | | { |
| | | logger.traceException(e); |
| | | |
| | | // We couldn't normalize one of the attribute values. If we |
| | | // can't find a definite match, then we should return |
| | | // "undefined". |
| | | // We couldn't normalize one of the attribute values. |
| | | // We will return "undefined" if we can't find a definite match |
| | | result = ConditionResult.UNDEFINED; |
| | | } |
| | | } |