| File was renamed from opendj3-server-dev/src/server/org/opends/server/replication/common/LastCookieVirtualProvider.java |
| | |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | package org.opends.server.replication.server; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.admin.std.server.UserDefinedVirtualAttributeCfg; |
| | | import org.opends.server.api.VirtualAttributeProvider; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.replication.server.ReplicationServer; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.Entry; |
| | |
| | | * that contains the last (newest) cookie (cross domain state) |
| | | * available in the server. |
| | | */ |
| | | public class LastCookieVirtualProvider |
| | | extends VirtualAttributeProvider<UserDefinedVirtualAttributeCfg> |
| | | class LastCookieVirtualProvider extends VirtualAttributeProvider<UserDefinedVirtualAttributeCfg> |
| | | { |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | |
| | | */ |
| | | public LastCookieVirtualProvider(ReplicationServer replicationServer) |
| | | { |
| | | super(); |
| | | this.replicationServer = replicationServer; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | @Override |
| | | public boolean hasValue(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | // There's only a value for the rootDSE, i.e. the Null DN. |
| | | return entry.getName().isRootDN(); |
| | | |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | @Override |
| | | public boolean isMultiValued() |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | @Override |
| | | public Attribute getValues(Entry entry, VirtualAttributeRule rule) |
| | | { |
| | | try |
| | |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | @Override |
| | | public boolean isSearchable(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation, |
| | | boolean isPreIndexed) |
| | |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | @Override |
| | | public void processSearch(VirtualAttributeRule rule, |
| | | SearchOperation searchOperation) |
| | | { |
| | | searchOperation.setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | final LocalizableMessage message = ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE.get( |
| | | rule.getAttributeType().getNameOrOID()); |
| | | searchOperation.appendErrorMessage(message); |
| | | searchOperation.appendErrorMessage(ERR_LASTCOOKIE_VATTR_NOT_SEARCHABLE.get( |
| | | rule.getAttributeType().getNameOrOID())); |
| | | } |
| | | |
| | | } |