Fix OPENDJ-508 - Searches that rely on searchable virtual attribute may be slow.
For those searchable virtual attributes that can be faster than indexing (like when always matching a single entry), we process them before indexes. For the others, we fall back to them when indexes are not enough.
Changes include a little bit of tidy up of comments and IDE warnings.
1 files added
34 files modified
| | |
| | | properly configured for these types of searches |
| | | MILD_ERR_FCM_SEARCH_FAILED_624=An internal failure occurred while \ |
| | | attempting to map the certificate with fingerprint %s to a user entry: %s |
| | | MILD_ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE_625=The %s attribute is not \ |
| | | searchable and should not be included in otherwise unindexed search filters |
| | | MILD_ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE_626=The %s attribute is not \ |
| | | searchable and should not be included in otherwise unindexed search filters |
| | | MILD_ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE_627=The %s attribute is not \ |
| | | searchable and should not be included in otherwise unindexed search filters |
| | | MILD_ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE_628=The %s attribute is not \ |
| | | searchable and should not be included in otherwise unindexed search filters |
| | | |
| | |
| | | INFO_GSSAPI_STOPPED_575=Der GSSAPI SASL-Mechanismus-Handler wurde angehalten |
| | | MILD_ERR_COLLECTIVEATTRIBUTESUBENTRIES_VATTR_NOT_SEARCHABLE_576=Das Attribut %s kann nicht durchsucht werden und darf nicht in ansonsten nicht indizierten Suchfiltern enthalten sein |
| | | MILD_ERR_PASSWORDPOLICYSUBENTRY_VATTR_NOT_SEARCHABLE_577=Das Attribut %s kann nicht durchsucht werden und darf nicht in ansonsten nicht indizierten Suchfiltern enthalten sein |
| | | MILD_ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE_625=Das Attribut %s kann nicht durchsucht werden und darf nicht in ansonsten nicht indizierten Suchfiltern enthalten sein |
| | | MILD_ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE_626=Das Attribut %s kann nicht durchsucht werden und darf nicht in ansonsten nicht indizierten Suchfiltern enthalten sein |
| | | MILD_ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE_627=Das Attribut %s kann nicht durchsucht werden und darf nicht in ansonsten nicht indizierten Suchfiltern enthalten sein |
| | | MILD_ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE_628=Das Attribut %s kann nicht durchsucht werden und darf nicht in ansonsten nicht indizierten Suchfiltern enthalten sein |
| | |
| | | MILD_ERR_COLLECTIVEATTRIBUTESUBENTRIES_VATTR_NOT_SEARCHABLE_576=El atributo %s no permite su b\u00fasqueda y no se deber\u00eda incluir en filtros de b\u00fasqueda no indizados |
| | | MILD_ERR_PASSWORDPOLICYSUBENTRY_VATTR_NOT_SEARCHABLE_577=El atributo %s no permite su b\u00fasqueda y no se deber\u00eda incluir en filtros de b\u00fasqueda no indizados |
| | | MILD_ERR_STATICMEMBERS_CANNOT_DECODE_DN_582=Se produjo un error al intentar analizar el ND del miembro %s del grupo est\u00e1tico %s: %s |
| | | MILD_ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE_625=El atributo %s no permite su b\u00fasqueda y no se deber\u00eda incluir en filtros de b\u00fasqueda no indizados |
| | | MILD_ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE_626=El atributo %s no permite su b\u00fasqueda y no se deber\u00eda incluir en filtros de b\u00fasqueda no indizados |
| | | MILD_ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE_627=El atributo %s no permite su b\u00fasqueda y no se deber\u00eda incluir en filtros de b\u00fasqueda no indizados |
| | | MILD_ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE_628=El atributo %s no permite su b\u00fasqueda y no se deber\u00eda incluir en filtros de b\u00fasqueda no indizados |
| | | |
| | |
| | | MILD_ERR_PASSWORDPOLICYSUBENTRY_VATTR_NOT_SEARCHABLE_577=L'attribut %s ne peut pas faire l'objet d'une recherche et ne doit pas \u00eatre inclus dans des filtres de recherche non index\u00e9s |
| | | MILD_ERR_PWSCHEME_INVALID_BASE64_DECODED_STORED_PASSWORD_578=La valeur du mot de passe %s a \u00e9t\u00e9 d\u00e9cod\u00e9 en base64, mais est trop courte pour \u00eatre valide |
| | | MILD_ERR_STATICMEMBERS_CANNOT_DECODE_DN_582=Une erreur s'est produite lors du d\u00e9codage du DN %s, membre du groupe statique %s\u00a0: %s |
| | | MILD_ERR_FIRSTCHANGENUMBER_NOT_SEARCHABLE_625=L'attribut %s ne peut pas faire l'objet d'une recherche et ne doit pas \u00eatre inclus dans des filtres de recherche non index\u00e9s |
| | | MILD_ERR_LASTCHANGENUNBER_NOT_SEARCHABLE_626=L'attribut %s ne peut pas faire l'objet d'une recherche et ne doit pas \u00eatre inclus dans des filtres de recherche non index\u00e9s |
| | | MILD_ERR_LASTCOOKIE_NOT_SEARCHABLE_627=L'attribut %s ne peut pas faire l'objet d'une recherche et ne doit pas \u00eatre inclus dans des filtres de recherche non index\u00e9s |
| | | MILD_ERR_CHANGELOGBASEDN_NOT_SEARCHABLE_628=L'attribut %s ne peut pas faire l'objet d'une recherche et ne doit pas \u00eatre inclus dans des filtres de recherche non index\u00e9s |
| | |
| | | INFO_GSSAPI_STOPPED_575=GSSAPI SASL \u30e1\u30ab\u30cb\u30ba\u30e0\u30cf\u30f3\u30c9\u30e9\u304c\u505c\u6b62\u3057\u307e\u3057\u305f |
| | | MILD_ERR_COLLECTIVEATTRIBUTESUBENTRIES_VATTR_NOT_SEARCHABLE_576=%s \u5c5e\u6027\u306f\u691c\u7d22\u53ef\u80fd\u3067\u306a\u3044\u305f\u3081\u3001\u307b\u304b\u306e\u65b9\u6cd5\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u542b\u3081\u306a\u3044\u3067\u304f\u3060\u3055\u3044 |
| | | MILD_ERR_PASSWORDPOLICYSUBENTRY_VATTR_NOT_SEARCHABLE_577=%s \u5c5e\u6027\u306f\u691c\u7d22\u53ef\u80fd\u3067\u306a\u3044\u305f\u3081\u3001\u307b\u304b\u306e\u65b9\u6cd5\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u542b\u3081\u306a\u3044\u3067\u304f\u3060\u3055\u3044 |
| | | MILD_ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE_625=%s \u5c5e\u6027\u306f\u691c\u7d22\u53ef\u80fd\u3067\u306a\u3044\u305f\u3081\u3001\u307b\u304b\u306e\u65b9\u6cd5\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u542b\u3081\u306a\u3044\u3067\u304f\u3060\u3055\u3044 |
| | | MILD_ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE_626=%s \u5c5e\u6027\u306f\u691c\u7d22\u53ef\u80fd\u3067\u306a\u3044\u305f\u3081\u3001\u307b\u304b\u306e\u65b9\u6cd5\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u542b\u3081\u306a\u3044\u3067\u304f\u3060\u3055\u3044 |
| | | MILD_ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE_627=%s \u5c5e\u6027\u306f\u691c\u7d22\u53ef\u80fd\u3067\u306a\u3044\u305f\u3081\u3001\u307b\u304b\u306e\u65b9\u6cd5\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u542b\u3081\u306a\u3044\u3067\u304f\u3060\u3055\u3044 |
| | | MILD_ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE_628=%s \u5c5e\u6027\u306f\u691c\u7d22\u53ef\u80fd\u3067\u306a\u3044\u305f\u3081\u3001\u307b\u304b\u306e\u65b9\u6cd5\u3067\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u691c\u7d22\u30d5\u30a3\u30eb\u30bf\u306b\u306f\u542b\u3081\u306a\u3044\u3067\u304f\u3060\u3055\u3044 |
| | |
| | | SEVERE_ERR_FCM_ATTR_UNINDEXED_567=\uad6c\uc131 \ud56d\ubaa9 %1$s\uc5d0 \uc815\uc758\ub41c \uc9c0\ubb38 \uc778\uc99d\uc11c \ub9e4\ud37c\uac00 \ubc31\uc5d4\ub4dc %3$s\uc5d0 \ub3d9\uc77c \uc0c9\uc778\uc774 \uc815\uc758\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc740 \uc18d\uc131 \uc720\ud615 %2$s\uc744(\ub97c) \ucc38\uc870\ud569\ub2c8\ub2e4. |
| | | SEVERE_WARN_SATUACM_ATTR_UNINDEXED_568=\uad6c\uc131 \ud56d\ubaa9 %1$s\uc5d0 \uc815\uc758\ub41c \uc8fc\uc81c \uc18d\uc131-\uc0ac\uc6a9\uc790 \uc18d\uc131 \uc778\uc99d\uc11c \ub9e4\ud37c\uac00 \ubc31\uc5d4\ub4dc %3$s\uc5d0 \ub3d9\uc77c \uc0c9\uc778\uc774 \uc815\uc758\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc740 \uc18d\uc131 \uc720\ud615 %2$s\uc744(\ub97c) \ucc38\uc870\ud569\ub2c8\ub2e4. |
| | | SEVERE_ERR_SDTUACM_ATTR_UNINDEXED_569=\uad6c\uc131 \ud56d\ubaa9 %1$s\uc5d0 \uc815\uc758\ub41c \uc8fc\uc81c DN-\uc0ac\uc6a9\uc790 \uc18d\uc131 \uc778\uc99d\uc11c \ub9e4\ud37c\uac00 \ubc31\uc5d4\ub4dc %3$s\uc5d0 \ub3d9\uc77c \uc0c9\uc778\uc774 \uc815\uc758\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc740 \uc18d\uc131 \uc720\ud615 %2$s\uc744(\ub97c) \ucc38\uc870\ud569\ub2c8\ub2e4. |
| | | MILD_ERR_COLLECTIVEATTRIBUTESUBENTRIES_VATTR_NOT_SEARCHABLE_576=%s \uc18d\uc131\uc740 \uac80\uc0c9\ud560 \uc218 \uc5c6\uc73c\uba70 \uc0c9\uc778\ud654\ub418\uc9c0 \uc54a\uc740 \uac80\uc0c9 \ud544\ud130\uc5d0 \ud3ec\ud568\ub418\uc5b4\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4. |
| | | MILD_ERR_PASSWORDPOLICYSUBENTRY_VATTR_NOT_SEARCHABLE_577=%s \uc18d\uc131\uc740 \uac80\uc0c9\ud560 \uc218 \uc5c6\uc73c\uba70 \uc0c9\uc778\ud654\ub418\uc9c0 \uc54a\uc740 \uac80\uc0c9 \ud544\ud130\uc5d0 \ud3ec\ud568\ub418\uc5b4\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4. |
| | | MILD_ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE_625=%s \uc18d\uc131\uc740 \uac80\uc0c9\ud560 \uc218 \uc5c6\uc73c\uba70 \uc0c9\uc778\ud654\ub418\uc9c0 \uc54a\uc740 \uac80\uc0c9 \ud544\ud130\uc5d0 \ud3ec\ud568\ub418\uc5b4\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4. |
| | | MILD_ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE_626=%s \uc18d\uc131\uc740 \uac80\uc0c9\ud560 \uc218 \uc5c6\uc73c\uba70 \uc0c9\uc778\ud654\ub418\uc9c0 \uc54a\uc740 \uac80\uc0c9 \ud544\ud130\uc5d0 \ud3ec\ud568\ub418\uc5b4\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4. |
| | | MILD_ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE_627=%s \uc18d\uc131\uc740 \uac80\uc0c9\ud560 \uc218 \uc5c6\uc73c\uba70 \uc0c9\uc778\ud654\ub418\uc9c0 \uc54a\uc740 \uac80\uc0c9 \ud544\ud130\uc5d0 \ud3ec\ud568\ub418\uc5b4\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4. |
| | | MILD_ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE_628=%s \uc18d\uc131\uc740 \uac80\uc0c9\ud560 \uc218 \uc5c6\uc73c\uba70 \uc0c9\uc778\ud654\ub418\uc9c0 \uc54a\uc740 \uac80\uc0c9 \ud544\ud130\uc5d0 \ud3ec\ud568\ub418\uc5b4\uc11c\ub294 \uc548 \ub429\ub2c8\ub2e4. |
| | |
| | | INFO_GSSAPI_STOPPED_575=GSSAPI SASL \u673a\u5236\u5904\u7406\u7a0b\u5e8f\u5df2\u505c\u6b62 |
| | | MILD_ERR_COLLECTIVEATTRIBUTESUBENTRIES_VATTR_NOT_SEARCHABLE_576=\u65e0\u6cd5\u641c\u7d22 %s \u5c5e\u6027\uff0c\u5e76\u4e14\u4e0d\u5e94\u5c06\u5176\u5305\u542b\u5728\u5176\u4ed6\u672a\u7f16\u5165\u7d22\u5f15\u7684\u641c\u7d22\u8fc7\u6ee4\u5668\u4e2d |
| | | MILD_ERR_PASSWORDPOLICYSUBENTRY_VATTR_NOT_SEARCHABLE_577=\u65e0\u6cd5\u641c\u7d22 %s \u5c5e\u6027\uff0c\u5e76\u4e14\u4e0d\u5e94\u5c06\u5176\u5305\u542b\u5728\u5176\u4ed6\u672a\u7f16\u5165\u7d22\u5f15\u7684\u641c\u7d22\u8fc7\u6ee4\u5668\u4e2d |
| | | MILD_ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE_625=\u65e0\u6cd5\u641c\u7d22 %s \u5c5e\u6027\uff0c\u5e76\u4e14\u4e0d\u5e94\u5c06\u5176\u5305\u542b\u5728\u5176\u4ed6\u672a\u7f16\u5165\u7d22\u5f15\u7684\u641c\u7d22\u8fc7\u6ee4\u5668\u4e2d |
| | | MILD_ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE_626=\u65e0\u6cd5\u641c\u7d22 %s \u5c5e\u6027\uff0c\u5e76\u4e14\u4e0d\u5e94\u5c06\u5176\u5305\u542b\u5728\u5176\u4ed6\u672a\u7f16\u5165\u7d22\u5f15\u7684\u641c\u7d22\u8fc7\u6ee4\u5668\u4e2d |
| | | MILD_ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE_627=\u65e0\u6cd5\u641c\u7d22 %s \u5c5e\u6027\uff0c\u5e76\u4e14\u4e0d\u5e94\u5c06\u5176\u5305\u542b\u5728\u5176\u4ed6\u672a\u7f16\u5165\u7d22\u5f15\u7684\u641c\u7d22\u8fc7\u6ee4\u5668\u4e2d |
| | | MILD_ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE_628=\u65e0\u6cd5\u641c\u7d22 %s \u5c5e\u6027\uff0c\u5e76\u4e14\u4e0d\u5e94\u5c06\u5176\u5305\u542b\u5728\u5176\u4ed6\u672a\u7f16\u5165\u7d22\u5f15\u7684\u641c\u7d22\u8fc7\u6ee4\u5668\u4e2d |
| | |
| | | SEVERE_ERR_FCM_ATTR_UNINDEXED_567=\u914d\u7f6e\u9805\u76ee %s \u4e2d\u5b9a\u7fa9\u7684\u6307\u7d0b\u6191\u8b49\u5c0d\u6620\u5668\u53c3\u7167\u5c6c\u6027\u985e\u578b %s\uff0c\u800c\u6b64\u5c6c\u6027\u985e\u578b\u6c92\u6709\u5728\u5f8c\u7aef %s \u4e2d\u5b9a\u7fa9\u7684\u76f8\u7b49\u7d22\u5f15 |
| | | SEVERE_WARN_SATUACM_ATTR_UNINDEXED_568=\u914d\u7f6e\u9805\u76ee %s \u4e2d\u5b9a\u7fa9\u4e4b\u4f7f\u7528\u8005\u5c6c\u6027\u6191\u8b49\u5c0d\u6620\u5668\u7684\u4e3b\u9ad4\u5c6c\u6027\u53c3\u7167\u5c6c\u6027\u985e\u578b %s\uff0c\u800c\u6b64\u5c6c\u6027\u985e\u578b\u6c92\u6709\u5728\u5f8c\u7aef %s \u4e2d\u5b9a\u7fa9\u7684\u76f8\u7b49\u7d22\u5f15 |
| | | SEVERE_ERR_SDTUACM_ATTR_UNINDEXED_569=\u914d\u7f6e\u9805\u76ee %s \u4e2d\u5b9a\u7fa9\u4e4b\u4f7f\u7528\u8005\u5c6c\u6027\u6191\u8b49\u5c0d\u6620\u5668\u7684\u4e3b\u9ad4 DN \u53c3\u7167\u5c6c\u6027\u985e\u578b %s\uff0c\u800c\u6b64\u5c6c\u6027\u985e\u578b\u6c92\u6709\u5728\u5f8c\u7aef %s \u4e2d\u5b9a\u7fa9\u7684\u76f8\u7b49\u7d22\u5f15 |
| | | MILD_ERR_COLLECTIVEATTRIBUTESUBENTRIES_VATTR_NOT_SEARCHABLE_576=%s \u5c6c\u6027\u7121\u6cd5\u9032\u884c\u641c\u5c0b\uff0c\u4e14\u4e0d\u8a72\u5305\u542b\u65bc\u672a\u7d22\u5f15\u7684\u641c\u5c0b\u7be9\u9078\u5668\u4e2d |
| | | MILD_ERR_PASSWORDPOLICYSUBENTRY_VATTR_NOT_SEARCHABLE_577=%s \u5c6c\u6027\u7121\u6cd5\u9032\u884c\u641c\u5c0b\uff0c\u4e14\u4e0d\u8a72\u5305\u542b\u65bc\u672a\u7d22\u5f15\u7684\u641c\u5c0b\u7be9\u9078\u5668\u4e2d |
| | | MILD_ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE_625=%s \u5c6c\u6027\u7121\u6cd5\u9032\u884c\u641c\u5c0b\uff0c\u4e14\u4e0d\u8a72\u5305\u542b\u65bc\u672a\u7d22\u5f15\u7684\u641c\u5c0b\u7be9\u9078\u5668\u4e2d |
| | | MILD_ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE_626=%s \u5c6c\u6027\u7121\u6cd5\u9032\u884c\u641c\u5c0b\uff0c\u4e14\u4e0d\u8a72\u5305\u542b\u65bc\u672a\u7d22\u5f15\u7684\u641c\u5c0b\u7be9\u9078\u5668\u4e2d |
| | | MILD_ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE_627=%s \u5c6c\u6027\u7121\u6cd5\u9032\u884c\u641c\u5c0b\uff0c\u4e14\u4e0d\u8a72\u5305\u542b\u65bc\u672a\u7d22\u5f15\u7684\u641c\u5c0b\u7be9\u9078\u5668\u4e2d |
| | | MILD_ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE_628=%s \u5c6c\u6027\u7121\u6cd5\u9032\u884c\u641c\u5c0b\uff0c\u4e14\u4e0d\u8a72\u5305\u542b\u65bc\u672a\u7d22\u5f15\u7684\u641c\u5c0b\u7be9\u9078\u5668\u4e2d |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.api; |
| | | import org.opends.messages.Message; |
| | |
| | | * attribute. |
| | | * @param searchOperation The search operation for which to make |
| | | * the determination. |
| | | * |
| | | * @param isPreIndexed Indicates if we expect the search on the virtual |
| | | * attribute to be faster than an index search. |
| | | * @return {@code true} if this attribute may be included in search |
| | | * filters, or {@code false} if not. |
| | | */ |
| | | public abstract boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation |
| | | searchOperation); |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed); |
| | | |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | import org.opends.messages.Message; |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException, DatabaseException, CanceledOperationException |
| | | { |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | | DN aBaseDN = searchOperation.getBaseDN(); |
| | | SearchScope searchScope = searchOperation.getScope(); |
| | | |
| | | PagedResultsControl pageRequest = searchOperation |
| | |
| | | Entry baseEntry = null; |
| | | try |
| | | { |
| | | baseEntry = getEntry(baseDN); |
| | | baseEntry = getEntry(aBaseDN); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | if (baseEntry == null) |
| | | { |
| | | // Check for referral entries above the base entry. |
| | | dn2uri.targetEntryReferrals(baseDN, searchScope); |
| | | dn2uri.targetEntryReferrals(aBaseDN, searchScope); |
| | | |
| | | Message message = ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | Message message = ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(aBaseDN.toString()); |
| | | DN matchedDN = getMatchedDN(aBaseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, matchedDN, null); |
| | | } |
| | |
| | | |
| | | if(entryIDList == null) |
| | | { |
| | | // See if we could use a virtual attribute rule to process the search. |
| | | for (VirtualAttributeRule rule : DirectoryServer.getVirtualAttributes()) |
| | | { |
| | | if (rule.getProvider().isSearchable(rule, searchOperation, true)) |
| | | { |
| | | rule.getProvider().processSearch(rule, searchOperation); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | // Create an index filter to get the search result candidate entries. |
| | | IndexFilter indexFilter = |
| | | new IndexFilter(this, searchOperation, debugBuffer, |
| | |
| | | if (entryIDList.size() > IndexFilter.FILTER_CANDIDATE_THRESHOLD) |
| | | { |
| | | // Read the ID from dn2id. |
| | | EntryID baseID = dn2id.get(null, baseDN, LockMode.DEFAULT); |
| | | EntryID baseID = dn2id.get(null, aBaseDN, LockMode.DEFAULT); |
| | | if (baseID == null) |
| | | { |
| | | Message message = |
| | | ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(aBaseDN.toString()); |
| | | DN matchedDN = getMatchedDN(aBaseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, matchedDN, null); |
| | | } |
| | |
| | | // See if we could use a virtual attribute rule to process the search. |
| | | for (VirtualAttributeRule rule : DirectoryServer.getVirtualAttributes()) |
| | | { |
| | | if (rule.getProvider().isSearchable(rule, searchOperation)) |
| | | if (rule.getProvider().isSearchable(rule, searchOperation, false)) |
| | | { |
| | | rule.getProvider().processSearch(rule, searchOperation); |
| | | return; |
| | |
| | | throws DirectoryException, CanceledOperationException |
| | | { |
| | | EntryCache<?> entryCache = DirectoryServer.getEntryCache(); |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | | DN aBaseDN = searchOperation.getBaseDN(); |
| | | SearchScope searchScope = searchOperation.getScope(); |
| | | boolean manageDsaIT = isManageDsaITOperation(searchOperation); |
| | | |
| | |
| | | Entry baseEntry = null; |
| | | try |
| | | { |
| | | baseEntry = getEntry(baseDN); |
| | | baseEntry = getEntry(aBaseDN); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | if (baseEntry == null) |
| | | { |
| | | // Check for referral entries above the base entry. |
| | | dn2uri.targetEntryReferrals(baseDN, searchScope); |
| | | dn2uri.targetEntryReferrals(aBaseDN, searchScope); |
| | | |
| | | Message message = ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | Message message = ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(aBaseDN.toString()); |
| | | DN matchedDN = getMatchedDN(aBaseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, matchedDN, null); |
| | | } |
| | |
| | | * "cn=joe,ou=people,dc=example,dc=com" will appear after the entry |
| | | * "ou=people,dc=example,dc=com". |
| | | */ |
| | | byte[] baseDNKey = JebFormat.dnToDNKey(baseDN, |
| | | byte[] baseDNKey = JebFormat.dnToDNKey(aBaseDN, |
| | | this.baseDN.getNumComponents()); |
| | | byte[] suffix = Arrays.copyOf(baseDNKey, baseDNKey.length+1); |
| | | suffix[suffix.length-1] = 0x00; |
| | |
| | | { |
| | | EntryCache<?> entryCache = DirectoryServer.getEntryCache(); |
| | | SearchScope searchScope = searchOperation.getScope(); |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | | DN aBaseDN = searchOperation.getBaseDN(); |
| | | boolean manageDsaIT = isManageDsaITOperation(searchOperation); |
| | | boolean continueSearch = true; |
| | | |
| | |
| | | { |
| | | // Check if this entry is an immediate child. |
| | | if ((entryDN.getNumComponents() == |
| | | baseDN.getNumComponents() + 1) && |
| | | entryDN.isDescendantOf(baseDN)) |
| | | aBaseDN.getNumComponents() + 1) && |
| | | entryDN.isDescendantOf(aBaseDN)) |
| | | { |
| | | isInScope = true; |
| | | } |
| | | } |
| | | else if (searchScope == SearchScope.WHOLE_SUBTREE) |
| | | { |
| | | if (entryDN.isDescendantOf(baseDN)) |
| | | if (entryDN.isDescendantOf(aBaseDN)) |
| | | { |
| | | isInScope = true; |
| | | } |
| | |
| | | else if (searchScope == SearchScope.SUBORDINATE_SUBTREE) |
| | | { |
| | | if ((entryDN.getNumComponents() > |
| | | baseDN.getNumComponents()) && |
| | | entryDN.isDescendantOf(baseDN)) |
| | | aBaseDN.getNumComponents()) && |
| | | entryDN.isDescendantOf(aBaseDN)) |
| | | { |
| | | isInScope = true; |
| | | } |
| | |
| | | Entry baseEntry = null; |
| | | try |
| | | { |
| | | baseEntry = getEntry(baseDN); |
| | | baseEntry = getEntry(aBaseDN); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | if (baseEntry == null) |
| | | { |
| | | // Check for referral entries above the base entry. |
| | | dn2uri.targetEntryReferrals(baseDN, searchScope); |
| | | dn2uri.targetEntryReferrals(aBaseDN, searchScope); |
| | | |
| | | Message message = ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | Message message = ERR_JEB_SEARCH_NO_SUCH_OBJECT.get(aBaseDN.toString()); |
| | | DN matchedDN = getMatchedDN(aBaseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, matchedDN, null); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.extensions; |
| | |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE |
| | | * or https://OpenDS.dev.java.net/OpenDS.LICENSE. |
| | | * trunk/opends/resource/legal-notices/CDDLv1_0.txt |
| | | * or http://forgerock.org/license/CDDLv1.0.html. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(final VirtualAttributeRule rule, |
| | | final SearchOperation searchOperation) |
| | | final SearchOperation searchOperation, |
| | | final boolean isPreIndexed) |
| | | { |
| | | // ETags cannot be searched since there is no way to determine which entry |
| | | // is associated with a particular ETag. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | * <LI>It is an OR filter in which all of the components are equality |
| | | * filters targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * This virtual attribute also can be optimized as pre-indexed. |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return isSearchable(rule.getAttributeType(), searchOperation.getFilter(), |
| | | 0); |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. This virtual attribute will support search operations only |
| | | * if one of the following is true about the search filter: |
| | | * <UL> |
| | | * <LI>It is an equality filter targeting the associated attribute |
| | | * type.</LI> |
| | | * <LI>It is an AND filter in which at least one of the components is an |
| | | * equality filter targeting the associated attribute type.</LI> |
| | | * <LI>It is an OR filter in which all of the components are equality |
| | | * filters targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. This virtual attribute will support search operations only |
| | | * if one of the following is true about the search filter: |
| | | * <UL> |
| | | * <LI>It is an equality filter targeting the associated attribute |
| | | * type.</LI> |
| | | * <LI>It is an AND filter in which at least one of the components is an |
| | | * equality filter targeting the associated attribute type.</LI> |
| | | * <LI>It is an OR filter in which all of the components are equality |
| | | * filters targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | //Non-searchable for unindexed searches. |
| | | //Non-searchable. |
| | | return false; |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. This virtual attribute will support search operations only |
| | | * if one of the following is true about the search filter: |
| | | * <UL> |
| | | * <LI>It is an equality filter targeting the associated attribute |
| | | * type.</LI> |
| | | * <LI>It is an AND filter in which at least one of the components is an |
| | | * equality filter targeting the associated attribute type.</LI> |
| | | * <LI>It is an OR filter in which all of the components are equality |
| | | * filters targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | * <LI>It is an AND filter in which at least one of the components is an |
| | | * equality filter targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * Searching for this virtual attribute cannot be pre-indexed and thus, |
| | | * it should not be searchable when pre-indexed is required. |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | if (isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | | return isSearchable(rule.getAttributeType(), searchOperation.getFilter(), |
| | | 0); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | import org.opends.messages.Message; |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. This virtual attribute will support search operations only |
| | | * if one of the following is true about the search filter: |
| | | * <UL> |
| | | * <LI>It is an equality filter targeting the associated attribute |
| | | * type.</LI> |
| | | * <LI>It is an AND filter in which at least one of the components is an |
| | | * equality filter targeting the associated attribute type.</LI> |
| | | * <LI>It is an OR filter in which all of the components are equality |
| | | * filters targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * trunk/opends/resource/legal-notices/CDDLv1_0.txt. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | |
| | | */ |
| | | @Override |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS. |
| | | * Portions copyright 2011-2012 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.server.extensions; |
| | |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | return false; |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. This virtual attribute will support search operations only |
| | | * if one of the following is true about the search filter: |
| | | * <UL> |
| | | * <LI>It is an equality filter targeting the associated attribute |
| | | * type.</LI> |
| | | * <LI>It is an AND filter in which at least one of the components is an |
| | | * equality filter targeting the associated attribute type.</LI> |
| | | * <LI>It is an OR filter in which all of the components are equality |
| | | * filters targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | // This attribute is not searchable, since it will have the same value in |
| | | // tons of entries. |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc}. This virtual attribute will support search operations only |
| | | * if one of the following is true about the search filter: |
| | | * <UL> |
| | | * <LI>It is an equality filter targeting the associated attribute |
| | | * type.</LI> |
| | | * <LI>It is an AND filter in which at least one of the components is an |
| | | * equality filter targeting the associated attribute type.</LI> |
| | | * <LI>It is an OR filter in which all of the components are equality |
| | | * filters targeting the associated attribute type.</LI> |
| | | * </UL> |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | // This attribute is not searchable, since it will have the same value in |
| | | // tons of entries. |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | import org.opends.messages.Message; |
| | |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | // We will not allow searches based only on user-defined virtual attributes. |
| | | return false; |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; |
| | |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | // We will not allow searches based only on user-defined virtual attributes. |
| | | // We do not allow search as it may be present is too many entries. |
| | | return false; |
| | | } |
| | | |
| | |
| | | SearchOperation searchOperation) |
| | | { |
| | | searchOperation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | return; |
| | | final Message message = ERR_CHANGELOGBASEDN_VATTR_NOT_SEARCHABLE.get( |
| | | rule.getAttributeType().getNameOrOID()); |
| | | searchOperation.appendErrorMessage(message); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; |
| | |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | // We will not allow searches based only on user-defined virtual attributes. |
| | | // We do not allow search for the firstChangeNumber. It's a read-only |
| | | // attribute of the RootDSE. |
| | | return false; |
| | | } |
| | | |
| | |
| | | SearchOperation searchOperation) |
| | | { |
| | | searchOperation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | return; |
| | | final Message message = ERR_FIRSTCHANGENUMBER_VATTR_NOT_SEARCHABLE.get( |
| | | rule.getAttributeType().getNameOrOID()); |
| | | searchOperation.appendErrorMessage(message); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; |
| | |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | // We will not allow searches based only on user-defined virtual attributes. |
| | | // We do not allow search for the lastChangeNumber. It's a read-only |
| | | // attribute of the RootDSE. |
| | | return false; |
| | | } |
| | | |
| | |
| | | SearchOperation searchOperation) |
| | | { |
| | | searchOperation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | return; |
| | | final Message message = ERR_LASTCHANGENUMBER_VATTR_NOT_SEARCHABLE.get( |
| | | rule.getAttributeType().getNameOrOID()); |
| | | searchOperation.appendErrorMessage(message); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | |
| | | package org.opends.server.replication.common; |
| | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; |
| | |
| | | */ |
| | | @Override() |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | | { |
| | | // We will not allow searches based only on user-defined virtual attributes. |
| | | // We do not allow search for the lastCookie. It's a read-only |
| | | // attribute of the RootDSE. |
| | | return false; |
| | | } |
| | | |
| | |
| | | SearchOperation searchOperation) |
| | | { |
| | | searchOperation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | return; |
| | | final Message message = ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE.get( |
| | | rule.getAttributeType().getNameOrOID()); |
| | | searchOperation.appendErrorMessage(message); |
| | | } |
| | | |
| | | |
| | |
| | | @Test |
| | | public void testIsSearchable() |
| | | { |
| | | assertFalse(provider.isSearchable(null, null)); |
| | | assertFalse(provider.isSearchable(null, null, false)); |
| | | assertFalse(provider.isSearchable(null, null, true)); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | SearchScope.WHOLE_SUBTREE, |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, 0, |
| | | 0, false, filter, null, null); |
| | | |
| | | assertEquals(provider.isSearchable(rule, searchOperation), isSearchable); |
| | | // This attribute is searchable for either pre-indexed or not |
| | | assertEquals(provider.isSearchable(rule, searchOperation, false), |
| | | isSearchable); |
| | | assertEquals(provider.isSearchable(rule, searchOperation, true), |
| | | isSearchable); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | DereferencePolicy.NEVER_DEREF_ALIASES, 0, |
| | | 0, false, filter, null, null); |
| | | |
| | | assertEquals(provider.isSearchable(rule, new LocalBackendSearchOperation(searchOperation)), isSearchable); |
| | | assertEquals(provider.isSearchable(rule, |
| | | new LocalBackendSearchOperation(searchOperation), false), isSearchable); |
| | | // isMemberOf is not searchable with preIndexed set to true |
| | | assertEquals(provider.isSearchable(rule, |
| | | new LocalBackendSearchOperation(searchOperation), true), false); |
| | | } |
| | | |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | (UserDefinedVirtualAttributeProvider) rule.getProvider(); |
| | | |
| | | assertFalse(provider.isMultiValued()); |
| | | assertFalse(provider.isSearchable(rule, searchOperation)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, false)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, true)); |
| | | |
| | | provider.processSearch(rule, searchOperation); |
| | | assertEquals(searchOperation.getResultCode(), |
| | |
| | | (UserDefinedVirtualAttributeProvider) rule.getProvider(); |
| | | |
| | | assertTrue(provider.isMultiValued()); |
| | | assertFalse(provider.isSearchable(rule, searchOperation)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, false)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, true)); |
| | | |
| | | provider.processSearch(rule, searchOperation); |
| | | assertEquals(searchOperation.getResultCode(), |
| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | SearchFilter.createFilterFromString( |
| | | "(member=" + u1.toString() + ")"), |
| | | null, null); |
| | | assertFalse(provider.isSearchable(rule, searchOperation)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, false)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, true)); |
| | | |
| | | provider.processSearch(rule, searchOperation); |
| | | assertFalse(searchOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | SearchFilter.createFilterFromString( |
| | | "(member=" + u1.toString() + ")"), |
| | | null, null); |
| | | assertFalse(provider.isSearchable(rule, searchOperation)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, false)); |
| | | assertFalse(provider.isSearchable(rule, searchOperation, false)); |
| | | |
| | | provider.processSearch(rule, searchOperation); |
| | | assertFalse(searchOperation.getResultCode() == ResultCode.SUCCESS); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | |
| | | { "cn=#a" }, { "cn=#ag" }, { "cn=#ga" }, { "cn=#abcdefgh" }, |
| | | { "cn=a\\b" }, { "cn=a\\bg" }, { "cn=\"hello" }, |
| | | {"cn=+mail=,dc=example,dc=com"},{"cn=xyz+sn=,dc=example,dc=com"}, |
| | | {"cn=,dc=example,dc=com"}}; |
| | | {"cn=,dc=example,dc=com"}, |
| | | // {"cn=a+cn=b,dc=example,dc=com"} |
| | | }; |
| | | } |
| | | |
| | | |
| New file |
| | |
| | | /* |
| | | * CDDL HEADER START |
| | | * |
| | | * The contents of this file are subject to the terms of the |
| | | * Common Development and Distribution License, Version 1.0 only |
| | | * (the "License"). You may not use this file except in compliance |
| | | * with the License. |
| | | * |
| | | * You can obtain a copy of the license at |
| | | * trunk/opends/resource/legal-notices/CDDLv1_0.txt |
| | | * or http://forgerock.org/license/CDDLv1.0.html. |
| | | * See the License for the specific language governing permissions |
| | | * and limitations under the License. |
| | | * |
| | | * When distributing Covered Code, include this CDDL HEADER in each |
| | | * file and include the License file at |
| | | * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, |
| | | * add the following below this CDDL HEADER, with the fields enclosed |
| | | * by brackets "[]" replaced with your own identifying information: |
| | | * Portions Copyright [yyyy] [name of copyright owner] |
| | | * |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.types; |
| | | |
| | | import static org.testng.Assert.*; |
| | | |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.util.Platform; |
| | | import org.testng.annotations.DataProvider; |
| | | import org.testng.annotations.Test; |
| | | import org.testng.annotations.BeforeClass; |
| | | |
| | | public class TestLDAPURL extends TypesTestCase { |
| | | |
| | | /** |
| | | * Set up the environment for performing the tests in this suite. |
| | | * |
| | | * @throws Exception |
| | | * If the environment could not be set up. |
| | | */ |
| | | @BeforeClass |
| | | public void setUp() throws Exception { |
| | | // This test suite depends on having the schema available, so |
| | | // we'll start the server. |
| | | TestCaseUtils.startServer(); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * Valid URLs test data provider. |
| | | * |
| | | * @return The array of valid test URL strings. |
| | | */ |
| | | @DataProvider(name = "validURLs") |
| | | public Object[][] createValidData() { |
| | | return new Object[][] { |
| | | { "ldap:///", "ldap:///", "ldap:///??base?(objectClass=*)" }, |
| | | { "http:///", "http:///", "http:///??base?(objectClass=*)" }, |
| | | { "ldap://host:389/", "ldap://host:389/", |
| | | "ldap://host:389/??base?(objectClass=*)" }, |
| | | { "ldap://192.168.0.1/", "ldap://192.168.0.1:389/", |
| | | "ldap://192.168.0.1:389/??base?(objectClass=*)" }, |
| | | { "ldap://192.168.0.2:1389/", "ldap://192.168.0.2:1389/", |
| | | "ldap://192.168.0.2:1389/??base?(objectClass=*)" }, |
| | | // URLs with a baseDN |
| | | { "ldap://host:389/cn=Foo,dc=example,dc=com", |
| | | "ldap://host:389/cn=Foo,dc=example,dc=com", |
| | | "ldap://host:389/cn=Foo,dc=example,dc=com??base?(objectClass=*)" }, |
| | | { "ldap:///cn=a,dc=example,dc=com", "ldap:///cn=a,dc=example,dc=com", |
| | | "ldap:///cn=a,dc=example,dc=com??base?(objectClass=*)" }, |
| | | { "ldap:///cn=a\"a,dc=example,dc=com", "ldap:///cn=a%5C%22a,dc=example,dc=com", |
| | | "ldap:///cn=a%5C%22a,dc=example,dc=com??base?(objectClass=*)" }, |
| | | { "ldap://localhost/cn=Foo,dc=a.com", "ldap://localhost:389/cn=Foo,dc=a.com", |
| | | "ldap://localhost:389/cn=Foo,dc=a.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com?", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | // URLs with some attribute lists |
| | | { "ldap://host:1389/cn=Foo,dc=b.com?,", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com?,,,?", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com?cn,sn", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com?cn,sn?base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com?sn,cn", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com?sn,cn?base?(objectClass=*)" }, |
| | | { "ldap://host:1389/?cn", "ldap://host:1389/", |
| | | "ldap://host:1389/?cn?base?(objectClass=*)" }, |
| | | // URLs with scope |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com???", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??base", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??base?", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??one", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??one?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??sub", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??sub?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??subord", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??subordinate?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??subordinate", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??subordinate?(objectClass=*)" }, |
| | | // URLs with filters |
| | | { "ldap://host:1389/cn=Foo,dc=b.com????", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com???(cn=Foo)?", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(cn=Foo)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com???(cn=foo)", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(cn=foo)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com???uid=user.0?", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(uid=user.0)" }, |
| | | // Extensions are always returned, baseOnly or not. |
| | | { "ldap://host:1389/cn=Foo,dc=b.com????x-password", "ldap://host:1389/cn=Foo,dc=b.com????x-password", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)?x-password" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com????a,b,c", "ldap://host:1389/cn=Foo,dc=b.com????a,b,c", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)?a,b,c" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com????,,,", "ldap://host:1389/cn=Foo,dc=b.com", |
| | | "ldap://host:1389/cn=Foo,dc=b.com??base?(objectClass=*)" }, |
| | | // URLs with everything |
| | | { "ldap://myhost.full.com:2389/cn=F oo,dc=full.com?cn,sn,userpassword?one?(cn=foo)?x-nothing", |
| | | "ldap://myhost.full.com:2389/cn=F%20oo,dc=full.com????x-nothing", |
| | | "ldap://myhost.full.com:2389/cn=F%20oo,dc=full.com?cn,sn,userpassword?one?(cn=foo)?x-nothing" }, |
| | | }; |
| | | } |
| | | |
| | | @Test(dataProvider = "validURLs") |
| | | public void testDecodeString(String rawURL, String stringURL, |
| | | String fullURL) |
| | | throws Exception |
| | | { |
| | | LDAPURL url = LDAPURL.decode(rawURL, true); |
| | | StringBuilder buffer = new StringBuilder(); |
| | | url.toString(buffer, true); |
| | | assertEquals(stringURL, buffer.toString()); |
| | | } |
| | | |
| | | |
| | | @Test(dataProvider = "validURLs") |
| | | public void testDecodeStringFull(String rawURL, String stringURL, |
| | | String fullURL) throws Exception |
| | | { |
| | | LDAPURL url = LDAPURL.decode(rawURL, true); |
| | | StringBuilder buffer = new StringBuilder(); |
| | | url.toString(buffer, false); |
| | | assertEquals(fullURL, buffer.toString()); |
| | | } |
| | | /** |
| | | * Illegal URLs test data provider. |
| | | * |
| | | * @return The array of illegal test URk strings. |
| | | */ |
| | | @DataProvider(name = "illegalURLs") |
| | | public Object[][] createIllegalData() { |
| | | return new Object[][] { { "http:" }, { "://" }, { "ldap://:389" }, |
| | | { "ldap://localhost:"}, { "ldap://1.2.3.4:" }, { "ldap://host:-1" }, |
| | | { "ldap://host:65536" }, { "ldap://host:ldap" }, { "ldap://host:389:/" }, |
| | | // { "ldap://host:389/c=a\"a" }, |
| | | { "ldap://host:389/cn=a,a" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com??suberror" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com???(invalidFilter)" }, |
| | | { "ldap://host:1389/cn=Foo,dc=b.com???(&(cn=Foo)(cn=Bar" }, |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * Test LDAPUrl string decoder against illegal strings. |
| | | * |
| | | * @param rawURL |
| | | * Illegal URL string representation. |
| | | * @throws Exception |
| | | * If the test failed unexpectedly. |
| | | */ |
| | | @Test(dataProvider = "illegalURLs", expectedExceptions = DirectoryException.class) |
| | | public void testDecodeString(String rawURL) throws Exception |
| | | { |
| | | LDAPURL.decode(rawURL, true); |
| | | |
| | | fail("Expected exception for value \"" + rawURL + "\""); |
| | | } |
| | | |
| | | } |