| | |
| | | } |
| | | } |
| | | desc.serverProperties.put(ServerProperty.IS_REPLICATION_ENABLED, |
| | | replicationEnabled ? Boolean.TRUE : Boolean.FALSE); |
| | | Boolean.valueOf(replicationEnabled)); |
| | | |
| | | Set<String> allReplicationServers = new LinkedHashSet<String>(); |
| | | |
| | |
| | | } |
| | | } |
| | | desc.serverProperties.put(ServerProperty.IS_REPLICATION_SECURE, |
| | | replicationSecure ? Boolean.TRUE : Boolean.FALSE); |
| | | Boolean.valueOf(replicationSecure)); |
| | | } |
| | | |
| | | /** |
| | |
| | | // is listed in in the hacker. |
| | | // Note: *usable* means *usable for detecting children presence*. |
| | | private boolean isNumSubOrdinatesUsable() throws NamingException { |
| | | boolean result; |
| | | SearchResult entry = getDisplayedEntry(); |
| | | boolean hasSubOrdinates = BrowserController.getHasSubOrdinates(entry); |
| | | if (!hasSubOrdinates) { // We must check |
| | | LDAPURL url = getDisplayedUrl(); |
| | | if (controller.getNumSubordinateHacker().contains(url)) { |
| | | // The numSubOrdinate we have is unreliable. |
| | | result = false; |
| | | // System.out.println("numSubOrdinates of " + url + |
| | | // " is not reliable"); |
| | | } |
| | | else { |
| | | result = true; |
| | | } |
| | | return !controller.getNumSubordinateHacker().contains(url); |
| | | } |
| | | else { // Other values are usable |
| | | result = true; |
| | | } |
| | | return result; |
| | | // Other values are usable |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Searchs for the children. |
| | | * Searches for the children. |
| | | * @throws SearchAbandonException if an error occurs. |
| | | */ |
| | | private void runSearchChildren() throws SearchAbandonException { |
| | |
| | | return false; |
| | | } |
| | | String os = getFirstValueAsString(sr, "operatingSystem"); |
| | | if (os != null) |
| | | { |
| | | return OperatingSystem.WINDOWS == OperatingSystem.forName(os); |
| | | } |
| | | return false; |
| | | return os != null && OperatingSystem.WINDOWS.equals(OperatingSystem.forName(os)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import javax.swing.tree.DefaultTreeModel; |
| | | import javax.swing.tree.TreePath; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.forgerock.opendj.ldap.schema.MatchingRule; |
| | | import org.opends.guitools.controlpanel.browser.IconPool; |
| | | import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo; |
| | | import org.opends.guitools.controlpanel.datamodel.ServerDescriptor; |
| | |
| | | import org.opends.guitools.controlpanel.util.LowerCaseComparator; |
| | | import org.opends.guitools.controlpanel.util.Utilities; |
| | | import org.opends.guitools.controlpanel.util.ViewPositions; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageBuilder; |
| | | import org.opends.server.api.AttributeSyntax; |
| | | import org.forgerock.opendj.ldap.schema.MatchingRule; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.CommonSchemaElements; |
| | | import org.opends.server.types.ObjectClass; |
| | |
| | | |
| | | /** |
| | | * The pane that is displayed when the user clicks on 'Browse Schema'. |
| | | * |
| | | */ |
| | | public class BrowseSchemaPanel extends StatusGenericPanel |
| | | { |
| | |
| | | private JButton newObjectClass; |
| | | |
| | | private JLabel lNumberOfElements; |
| | | |
| | | private JLabel lFilter; |
| | | |
| | | private SchemaBrowserRightPanel entryPane; |
| | |
| | | { |
| | | schemaChanged = false; |
| | | } |
| | | else if (lastSchema == null && schema != null) |
| | | { |
| | | schemaChanged = true; |
| | | } |
| | | else |
| | | { |
| | | schemaChanged = false; |
| | | schemaChanged = schema != null && lastSchema == null; |
| | | } |
| | | if (schemaChanged) |
| | | { |
| | |
| | | names.add(matchingRuleNames); |
| | | names.add(syntaxNames); |
| | | |
| | | int size = 0; |
| | | for (TreeSet<String> set : names) |
| | | { |
| | | size += set.size(); |
| | | } |
| | | |
| | | ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>> nodes = |
| | | new ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>>(); |
| | | nodes.add(hmStandardOcs); |
| | |
| | | */ |
| | | @Override |
| | | public boolean isCellEditable(int row, int col) { |
| | | if (col == 0) |
| | | { |
| | | return false; |
| | | } else |
| | | { |
| | | return true; |
| | | } |
| | | return col != 0; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | else if (value instanceof ObjectClassValue) |
| | | { |
| | | if (!table.isCellEditable(row, column)) |
| | | { |
| | | ocPanel.setLockIconVisible(true); |
| | | ocPanel.setEditButtonVisible(false); |
| | | } |
| | | else |
| | | { |
| | | ocPanel.setLockIconVisible(false); |
| | | ocPanel.setEditButtonVisible(true); |
| | | } |
| | | final boolean cellEditable = table.isCellEditable(row, column); |
| | | ocPanel.setLockIconVisible(!cellEditable); |
| | | ocPanel.setEditButtonVisible(cellEditable); |
| | | ocPanel.setValue((ObjectClassValue)value); |
| | | if (hasFocus) |
| | | { |
| | | ocPanel.setBorder(getDefaultFocusBorder(table, value, isSelected, |
| | | row, column)); |
| | | ocPanel.setBorder(getDefaultFocusBorder(table, value, isSelected, row, column)); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else if (fieldName == FieldName.REPLICATION_SECURE) |
| | | { |
| | | if (cbSecureReplication.isSelected()) |
| | | { |
| | | value = Boolean.TRUE; |
| | | } |
| | | else |
| | | { |
| | | value = Boolean.FALSE; |
| | | } |
| | | value = Boolean.valueOf(cbSecureReplication.isSelected()); |
| | | } |
| | | else |
| | | { |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | public boolean isModified() { |
| | | if (activeValues.size() == pendingValues.size() |
| | | && activeValues.containsAll(pendingValues)) { |
| | | return false; |
| | | } |
| | | return true; |
| | | return activeValues.size() != pendingValues.size() |
| | | || !activeValues.containsAll(pendingValues); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public final boolean equals(Object o) |
| | | { |
| | | if (o == null) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (this == o) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if (! (o instanceof AttributeSyntax)) |
| | | if (!(o instanceof AttributeSyntax)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return getOID().equals(((AttributeSyntax<?>) o).getOID()); |
| | | } |
| | | |
| | |
| | | * @throws DirectoryException If a problem occurs while attempting |
| | | * to make the determination. |
| | | */ |
| | | public boolean isMember(DN userDN) |
| | | throws DirectoryException |
| | | public boolean isMember(DN userDN) throws DirectoryException |
| | | { |
| | | if (userDN != null) |
| | | return isMember(userDN, new HashSet<DN>()); |
| | | return false; |
| | | return userDN != null && isMember(userDN, new HashSet<DN>()); |
| | | } |
| | | |
| | | |
| | |
| | | public static boolean isTargetFilterApplicable(Aci aci, |
| | | AciTargetMatchContext matchCtx) { |
| | | TargetFilter targetFilter=aci.getTargets().getTargetFilter(); |
| | | if(targetFilter != null) |
| | | return targetFilter.isApplicable(matchCtx); |
| | | return true; |
| | | return targetFilter == null || targetFilter.isApplicable(matchCtx); |
| | | } |
| | | |
| | | /** |
| | |
| | | public static boolean isTargetControlApplicable(Aci aci, |
| | | AciTargetMatchContext matchCtx) { |
| | | TargetControl targetControl=aci.getTargets().getTargetControl(); |
| | | if(targetControl != null) |
| | | return targetControl.isApplicable(matchCtx); |
| | | return false; |
| | | return targetControl != null && targetControl.isApplicable(matchCtx); |
| | | } |
| | | |
| | | /** |
| | |
| | | public static boolean isExtOpApplicable(Aci aci, |
| | | AciTargetMatchContext matchCtx) { |
| | | ExtOp extOp=aci.getTargets().getExtOp(); |
| | | if(extOp != null) |
| | | return extOp.isApplicable(matchCtx); |
| | | return false; |
| | | return extOp != null && extOp.isApplicable(matchCtx); |
| | | } |
| | | |
| | | |
| | |
| | | setEvalAttributes(targetMatchCtx,targetAttr,ret); |
| | | } else if (attrType != null || targetAttr != null) { |
| | | if (aci.hasRights(skipRights) |
| | | && skipRightsHasRights(targetMatchCtx.getRights())) |
| | | && skipRightsHasRights(targetMatchCtx.getRights())) { |
| | | ret = true; |
| | | else if (attrType == null && targetAttr != null |
| | | && aci.hasRights(ACI_WRITE)) |
| | | ret = true; |
| | | else |
| | | ret = false; |
| | | } else { |
| | | ret = attrType == null |
| | | && targetAttr != null |
| | | && aci.hasRights(ACI_WRITE); |
| | | } |
| | | } |
| | | if (isFirstAttr && targetAttr == null |
| | | && aci.getTargets().getTargAttrFilters() == null) |
| | |
| | | ByteString key = keyForIndex(index); |
| | | ByteString value = read(txn, key, false); |
| | | |
| | | if (value != null) |
| | | { |
| | | return value.equals(trueBytes); |
| | | } |
| | | return false; |
| | | return value != null && value.equals(trueBytes); |
| | | } |
| | | |
| | | /** |
| | |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.controls; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.StringTokenizer; |
| | | import java.io.IOException; |
| | |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | |
| | | |
| | | /** |
| | | * This class implements the server-side sort request control as defined in RFC |
| | | * 2891 section 1.1. The subclass ServerSideSortRequestControl.ClientRequest |
| | |
| | | } |
| | | } |
| | | |
| | | boolean ascending = true; |
| | | if(decodedKey[2] != null && decodedKey[2].equals("r")) |
| | | String decodedKey2 = decodedKey[2]; |
| | | boolean ascending = decodedKey2 == null || !decodedKey2.equals("r"); |
| | | if (orderingRule == null |
| | | && attrType.getOrderingMatchingRule() == null) |
| | | { |
| | | ascending = false; |
| | | } |
| | | |
| | | if ((orderingRule == null) && |
| | | (attrType.getOrderingMatchingRule() == null)) |
| | | { |
| | | LocalizableMessage message = |
| | | INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get( |
| | | decodedKey[0]); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | message); |
| | | INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get(decodedKey[0])); |
| | | } |
| | | |
| | | sortKeys.add(new SortKey(attrType, ascending, orderingRule)); |
| | |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | import static org.forgerock.util.Reject.*; |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | |
| | | import java.util.Iterator; |
| | | import java.util.Set; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizedIllegalArgumentException; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.SearchScope; |
| | | import org.forgerock.opendj.ldap.DN.CompactDn; |
| | | import org.forgerock.opendj.ldap.SearchScope; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.DirectoryConfig; |
| | | import org.opends.server.types.DirectoryException; |
| | | import org.opends.server.types.DN; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.MemberList; |
| | | import org.opends.server.types.MembershipException; |
| | | import org.opends.server.types.SearchFilter; |
| | | |
| | | import static org.forgerock.util.Reject.*; |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | |
| | | /** |
| | | * This class provides an implementation of the {@code MemberList} class that |
| | | * may be used in conjunction when static groups when additional criteria is to |
| | |
| | | @Override |
| | | public boolean hasMoreMembers() |
| | | { |
| | | if (! memberDNIterator.hasNext()) |
| | | { |
| | | return false; |
| | | } |
| | | return ((nextMatchingEntry != null) || (nextMembershipException != null)); |
| | | return memberDNIterator.hasNext() |
| | | && (nextMatchingEntry != null || nextMembershipException != null); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | import org.opends.server.types.MemberList; |
| | | import org.opends.server.types.MembershipException; |
| | | import org.opends.server.types.Modification; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.SearchFilter; |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | |
| | | // Determine whether it is a groupOfNames, groupOfEntries or |
| | | // groupOfUniqueNames entry. If not, then that's a problem. |
| | | AttributeType someMemberAttributeType; |
| | | ObjectClass groupOfEntriesClass = DirectoryConfig.getObjectClass(OC_GROUP_OF_ENTRIES_LC, true); |
| | | ObjectClass groupOfNamesClass = DirectoryConfig.getObjectClass(OC_GROUP_OF_NAMES_LC, true); |
| | | ObjectClass groupOfUniqueNamesClass = DirectoryConfig.getObjectClass(OC_GROUP_OF_UNIQUE_NAMES_LC, true); |
| | | if (groupEntry.hasObjectClass(groupOfEntriesClass)) |
| | | boolean hasGroupOfEntriesClass = hasObjectClass(groupEntry, OC_GROUP_OF_ENTRIES_LC); |
| | | boolean hasGroupOfNamesClass = hasObjectClass(groupEntry, OC_GROUP_OF_NAMES_LC); |
| | | boolean hasGroupOfUniqueNamesClass = hasObjectClass(groupEntry, OC_GROUP_OF_UNIQUE_NAMES_LC); |
| | | if (hasGroupOfEntriesClass) |
| | | { |
| | | if (groupEntry.hasObjectClass(groupOfNamesClass)) |
| | | if (hasGroupOfNamesClass) |
| | | { |
| | | LocalizableMessage message = ERR_STATICGROUP_INVALID_OC_COMBINATION.get( |
| | | groupEntry.getName(), OC_GROUP_OF_ENTRIES, OC_GROUP_OF_NAMES); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message); |
| | | } |
| | | else if (groupEntry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | else if (hasGroupOfUniqueNamesClass) |
| | | { |
| | | LocalizableMessage message = ERR_STATICGROUP_INVALID_OC_COMBINATION.get( |
| | | groupEntry.getName(), OC_GROUP_OF_ENTRIES, OC_GROUP_OF_UNIQUE_NAMES); |
| | |
| | | |
| | | someMemberAttributeType = DirectoryConfig.getAttributeType(ATTR_MEMBER, true); |
| | | } |
| | | else if (groupEntry.hasObjectClass(groupOfNamesClass)) |
| | | else if (hasGroupOfNamesClass) |
| | | { |
| | | if (groupEntry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | if (hasGroupOfUniqueNamesClass) |
| | | { |
| | | LocalizableMessage message = ERR_STATICGROUP_INVALID_OC_COMBINATION.get( |
| | | groupEntry.getName(), OC_GROUP_OF_NAMES, OC_GROUP_OF_UNIQUE_NAMES); |
| | |
| | | |
| | | someMemberAttributeType = DirectoryConfig.getAttributeType(ATTR_MEMBER, true); |
| | | } |
| | | else if (groupEntry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | else if (hasGroupOfUniqueNamesClass) |
| | | { |
| | | someMemberAttributeType = DirectoryConfig.getAttributeType(ATTR_UNIQUE_MEMBER_LC, true); |
| | | } |
| | |
| | | ifNull(entry); |
| | | |
| | | // FIXME -- This needs to exclude enhanced groups once we have support for them. |
| | | ObjectClass virtualStaticGroupClass = |
| | | DirectoryConfig.getObjectClass(OC_VIRTUAL_STATIC_GROUP, true); |
| | | if (entry.hasObjectClass(virtualStaticGroupClass)) |
| | | if (hasObjectClass(entry, OC_VIRTUAL_STATIC_GROUP)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | ObjectClass groupOfEntriesClass = |
| | | DirectoryConfig.getObjectClass(OC_GROUP_OF_ENTRIES_LC, true); |
| | | ObjectClass groupOfNamesClass = |
| | | DirectoryConfig.getObjectClass(OC_GROUP_OF_NAMES_LC, true); |
| | | ObjectClass groupOfUniqueNamesClass = |
| | | DirectoryConfig.getObjectClass(OC_GROUP_OF_UNIQUE_NAMES_LC, true); |
| | | if (entry.hasObjectClass(groupOfEntriesClass)) |
| | | boolean hasGroupOfEntriesClass = hasObjectClass(entry, OC_GROUP_OF_ENTRIES_LC); |
| | | boolean hasGroupOfNamesClass = hasObjectClass(entry, OC_GROUP_OF_NAMES_LC); |
| | | boolean hasGroupOfUniqueNamesClass = hasObjectClass(entry, OC_GROUP_OF_UNIQUE_NAMES_LC); |
| | | if (hasGroupOfEntriesClass) |
| | | { |
| | | if (entry.hasObjectClass(groupOfNamesClass) || |
| | | entry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | return !hasGroupOfNamesClass |
| | | && !hasGroupOfUniqueNamesClass; |
| | | } |
| | | else if (entry.hasObjectClass(groupOfNamesClass)) |
| | | else if (hasGroupOfNamesClass) |
| | | { |
| | | if (entry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | else if (entry.hasObjectClass(groupOfUniqueNamesClass)) |
| | | { |
| | | return true; |
| | | return !hasGroupOfUniqueNamesClass; |
| | | } |
| | | else |
| | | { |
| | | return false; |
| | | return hasGroupOfUniqueNamesClass; |
| | | } |
| | | } |
| | | |
| | | private boolean hasObjectClass(Entry entry, String ocName) |
| | | { |
| | | return entry.hasObjectClass(DirectoryConfig.getObjectClass(ocName, true)); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getGroupDN() |
| | |
| | | @Override |
| | | public boolean isMultiValued() |
| | | { |
| | | if (currentConfig != null) |
| | | { |
| | | return currentConfig.getValue().size() > 1; |
| | | } |
| | | return true; |
| | | return currentConfig == null || currentConfig.getValue().size() > 1; |
| | | } |
| | | |
| | | |
| | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.LocalizableMessageDescriptor.Arg2; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.AddressMask; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.opends.server.admin.server.ConfigurationAddListener; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | | import org.opends.server.admin.server.ConfigurationDeleteListener; |
| | | import org.opends.server.admin.std.meta.AccessLogFilteringCriteriaCfgDefn.*; |
| | | import org.opends.server.admin.std.meta.AccessLogPublisherCfgDefn.*; |
| | | import org.opends.server.admin.std.meta.AccessLogFilteringCriteriaCfgDefn.LogRecordType; |
| | | import org.opends.server.admin.std.meta.AccessLogPublisherCfgDefn.FilteringPolicy; |
| | | import org.opends.server.admin.std.server.AccessLogFilteringCriteriaCfg; |
| | | import org.opends.server.admin.std.server.AccessLogPublisherCfg; |
| | | import org.opends.server.api.ClientConnection; |
| | | import org.opends.server.api.Group; |
| | | import org.opends.server.authorization.dseecompat.PatternDN; |
| | | import org.forgerock.opendj.config.server.ConfigChangeResult; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.opends.server.core.*; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.AddressMask; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | |
| | | /** |
| | | * This class provides the base implementation of the access loggers used by the |
| | |
| | | @Override |
| | | public boolean isConnectLoggable(final ClientConnection connection) |
| | | { |
| | | if (!logConnectRecords) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (!filterClientConnection(connection)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | return logConnectRecords && filterClientConnection(connection); |
| | | } |
| | | |
| | | |
| | |
| | | @Override |
| | | public boolean isDisconnectLoggable(final ClientConnection connection) |
| | | { |
| | | if (!logDisconnectRecords) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (!filterClientConnection(connection)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (!filterUser(connection)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | return logDisconnectRecords |
| | | && filterClientConnection(connection) |
| | | && filterUser(connection); |
| | | } |
| | | |
| | | |
| | |
| | | public boolean isRequestLoggable(final Operation operation) |
| | | { |
| | | final ClientConnection connection = operation.getClientConnection(); |
| | | final boolean matches = logOperationRecords.contains(operation |
| | | .getOperationType()) |
| | | final boolean matches = logOperationRecords.contains(operation.getOperationType()) |
| | | && filterClientConnection(connection) |
| | | && filterUser(connection) && filterRequest(operation); |
| | | |
| | |
| | | public boolean isResponseLoggable(final Operation operation) |
| | | { |
| | | // First check the result that was computed for the initial request. |
| | | Boolean requestMatched = (Boolean) operation |
| | | .getAttachment(attachmentName); |
| | | Boolean requestMatched = (Boolean) operation.getAttachment(attachmentName); |
| | | if (requestMatched == null) |
| | | { |
| | | // This should not happen. |
| | |
| | | requestMatched = isRequestLoggable(operation); |
| | | } |
| | | |
| | | if (!requestMatched) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | // Check the response parameters. |
| | | if (!filterResponse(operation)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | return requestMatched && filterResponse(operation); |
| | | } |
| | | |
| | | |
| | |
| | | // Check protocol. |
| | | if (clientProtocols.length > 0) |
| | | { |
| | | boolean found = false; |
| | | final String protocol = toLowerCase(connection.getProtocol()); |
| | | for (final String p : clientProtocols) |
| | | { |
| | | if (protocol.equals(p)) |
| | | { |
| | | found = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!found) |
| | | { |
| | | if (!find(clientProtocols, protocol)) { |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | // Check server port. |
| | | if (clientPorts.length > 0) |
| | | if (clientPorts.length > 0 |
| | | && !find(clientPorts, connection.getServerPort())) |
| | | { |
| | | boolean found = false; |
| | | final int port = connection.getServerPort(); |
| | | for (final int p : clientPorts) |
| | | { |
| | | if (port == p) |
| | | { |
| | | found = true; |
| | | break; |
| | | } |
| | | } |
| | | if (!found) |
| | | { |
| | | return false; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | // Check client address. |
| | | final InetAddress ipAddr = connection.getRemoteAddress(); |
| | | if (!clientAddressNotEqualTo.isEmpty() |
| | | && AddressMask.matchesAny(clientAddressNotEqualTo, ipAddr)) |
| | | { |
| | | return false; |
| | | } |
| | | if (!clientAddressEqualTo.isEmpty() |
| | | && !AddressMask.matchesAny(clientAddressEqualTo, ipAddr)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | return !AddressMask.matchesAny(clientAddressNotEqualTo, ipAddr) |
| | | && emptyOrMatchesAny(clientAddressEqualTo, ipAddr); |
| | | } |
| | | |
| | | private boolean emptyOrMatchesAny(Collection<AddressMask> masks, final InetAddress address) |
| | | { |
| | | return masks.isEmpty() || AddressMask.matchesAny(masks, address); |
| | | } |
| | | |
| | | private boolean find(String[] strings, String toFind) |
| | | { |
| | | if (strings.length > 0) |
| | | { |
| | | for (final String s : strings) |
| | | { |
| | | if (toFind.equals(s)) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean find(int[] ports, final int toFind) |
| | | { |
| | | if (ports.length > 0) |
| | | { |
| | | for (final int i : ports) |
| | | { |
| | | if (toFind == i) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | private boolean filterRequest(final Operation operation) |
| | | { |
| | |
| | | */ |
| | | private boolean checkParameters(DirectoryRMIServerSocketFactory that) |
| | | { |
| | | if (needClientCertificate != that.needClientCertificate) |
| | | return false; |
| | | |
| | | if (!sslSocketFactory.equals(that.sslSocketFactory)) |
| | | return false; |
| | | |
| | | return true; |
| | | return needClientCertificate == that.needClientCertificate |
| | | && sslSocketFactory.equals(that.sslSocketFactory); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public boolean equals(Object obj) |
| | | { |
| | | // Compare with the underlying real update message |
| | | if (obj == null) |
| | | { |
| | | return false; |
| | | } |
| | | return obj.getClass() == realUpdateMsg.getClass() |
| | | return obj != null |
| | | && obj.getClass() == realUpdateMsg.getClass() |
| | | && realUpdateMsg.getCSN().equals(((UpdateMsg) obj).getCSN()); |
| | | } |
| | | |
| | |
| | | return false; |
| | | } |
| | | Record<?, ?> other = (Record<?, ?>) that; |
| | | final boolean keyEquals = key == null ? other.key == null : key.equals(other.key); |
| | | if (!keyEquals) |
| | | { |
| | | return false; |
| | | } |
| | | return value == null ? other.value == null : value.equals(other.value); |
| | | return equals(key, other.key) |
| | | && equals(value, other.value); |
| | | } |
| | | |
| | | private boolean equals(Object o1, Object o2) |
| | | { |
| | | return o1 == null ? o2 == null : o1.equals(o2); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | |
| | | return false; |
| | | } |
| | | |
| | | if (! isValidSchemaElement(ocName, 0, ocLength, invalidReason)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | |
| | | // The rest of the value must be the criteria. |
| | | return criteriaIsValid(valueStr.substring(sharpPos+1), valueStr, |
| | | invalidReason); |
| | | return isValidSchemaElement(ocName, 0, ocLength, invalidReason) |
| | | // The rest of the value must be the criteria. |
| | | && criteriaIsValid(valueStr.substring(sharpPos+1), valueStr, invalidReason); |
| | | } |
| | | |
| | | |
| | |
| | | private boolean isSubcommand(String name) |
| | | { |
| | | SubCommand subCommand = getSubCommand(); |
| | | if (subCommand != null) |
| | | { |
| | | return subCommand.getName().equalsIgnoreCase(name); |
| | | } |
| | | return false; |
| | | return subCommand != null && subCommand.getName().equalsIgnoreCase(name); |
| | | } |
| | | |
| | | /** |
| | |
| | | return entryDN; |
| | | } |
| | | |
| | | private static boolean isScheduleRecurring( |
| | | TaskScheduleInformation information) |
| | | private static boolean isScheduleRecurring(TaskScheduleInformation information) |
| | | { |
| | | boolean scheduleRecurring = false; |
| | | |
| | | if (information.getRecurringDateTime() != null) { |
| | | scheduleRecurring = true; |
| | | } |
| | | return scheduleRecurring; |
| | | return information.getRecurringDateTime() != null; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public final boolean hasNameOrOID(String lowerValue) { |
| | | |
| | | if (names.containsKey(lowerValue)) { |
| | | return true; |
| | | } |
| | | |
| | | return oid.equals(lowerValue); |
| | | return names.containsKey(lowerValue) || oid.equals(lowerValue); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if ((o == null) || (! (o instanceof DITStructureRule))) |
| | | if (!(o instanceof DITStructureRule)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return (ruleID == ((DITStructureRule) o).ruleID); |
| | | return ruleID == ((DITStructureRule) o).ruleID; |
| | | } |
| | | |
| | | |
| | |
| | | message); |
| | | } |
| | | |
| | | boolean excludeDN = false; |
| | | byte b = buffer.get(); |
| | | if ((b & ENCODE_FLAG_EXCLUDE_DN) == ENCODE_FLAG_EXCLUDE_DN) |
| | | { |
| | | excludeDN = true; |
| | | } |
| | | |
| | | boolean compressAttrDescriptions = false; |
| | | if ((b & ENCODE_FLAG_COMPRESS_ADS) == ENCODE_FLAG_COMPRESS_ADS) |
| | | { |
| | | compressAttrDescriptions = true; |
| | | } |
| | | |
| | | boolean compressObjectClassSets = false; |
| | | if ((b & ENCODE_FLAG_COMPRESS_OCS) == ENCODE_FLAG_COMPRESS_OCS) |
| | | { |
| | | compressObjectClassSets = true; |
| | | } |
| | | |
| | | boolean excludeDN = is(b, ENCODE_FLAG_EXCLUDE_DN); |
| | | boolean compressAttrDescriptions = is(b, ENCODE_FLAG_COMPRESS_ADS); |
| | | boolean compressObjectClassSets = is(b, ENCODE_FLAG_COMPRESS_OCS); |
| | | return new EntryEncodeConfig(excludeDN, compressAttrDescriptions, |
| | | compressObjectClassSets, |
| | | compressedSchema); |
| | | } |
| | | |
| | | |
| | | private static boolean is(byte b, byte flag) |
| | | { |
| | | return (b & flag) == flag; |
| | | } |
| | | |
| | | /** |
| | | * Retrieves a string representation of this entry encode |
| | |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if ((o == null) || (! (o instanceof LDAPSyntaxDescription))) |
| | | if (!(o instanceof LDAPSyntaxDescription)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return oid.equals(((LDAPSyntaxDescription) o).oid); |
| | | } |
| | | |
| | |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if ((o == null) || (! (o instanceof MatchingRuleUse))) |
| | | if (!(o instanceof MatchingRuleUse)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return matchingRule.equals(((MatchingRuleUse) o).matchingRule); |
| | | } |
| | | |
| | |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if ((o == null) || (! (o instanceof Modification))) |
| | | if (!(o instanceof Modification)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | Modification m = (Modification) o; |
| | | if (modificationType != m.modificationType) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return attribute.equals(m.attribute); |
| | | return modificationType == m.modificationType |
| | | && attribute.equals(m.attribute); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public boolean hasNameOrOID(String lowerValue) |
| | | { |
| | | if (names.containsKey(lowerValue)) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | return lowerValue.equals(oid); |
| | | return names.containsKey(lowerValue) || lowerValue.equals(oid); |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if ((o == null) || (! (o instanceof NameForm))) |
| | | if (!(o instanceof NameForm)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return oid.equals(((NameForm) o).oid); |
| | | } |
| | | |
| | |
| | | this.definition = definition; |
| | | } |
| | | |
| | | // Set flag indicating whether or not this object class allows any |
| | | // attributes. |
| | | if (hasName(OC_EXTENSIBLE_OBJECT_LC) |
| | | || oid.equals(OID_EXTENSIBLE_OBJECT)) { |
| | | this.isExtensibleObject = true; |
| | | } else { |
| | | this.isExtensibleObject = false; |
| | | } |
| | | // Set flag indicating whether or not this object class allows any attributes |
| | | this.isExtensibleObject = hasName(OC_EXTENSIBLE_OBJECT_LC) |
| | | || oid.equals(OID_EXTENSIBLE_OBJECT); |
| | | |
| | | // Construct unmodifiable views of the required attributes. |
| | | if (requiredAttributes != null) { |
| | |
| | | */ |
| | | public boolean isOptional(AttributeType attributeType) { |
| | | |
| | | if (optionalAttributesChain.contains(attributeType)) { |
| | | return true; |
| | | } |
| | | |
| | | if (isExtensibleObject |
| | | && !requiredAttributesChain.contains(attributeType)) { |
| | | // FIXME -- Do we need to do other checks here, like whether the |
| | | // attribute type is actually defined in the schema? |
| | | // What about DIT content rules? |
| | | return true; |
| | | } |
| | | |
| | | return false; |
| | | return optionalAttributesChain.contains(attributeType) |
| | | || (isExtensibleObject && !requiredAttributesChain.contains(attributeType)); |
| | | // FIXME -- Do we need to do other checks here, like whether the |
| | | // attribute type is actually defined in the schema? |
| | | // What about DIT content rules? |
| | | } |
| | | |
| | | |
| | |
| | | private boolean commonComponentsEquals( |
| | | final SubtreeSpecification other) |
| | | { |
| | | |
| | | if (this == other) |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | if (minimumDepth != other.minimumDepth) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (maximumDepth != other.maximumDepth) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (!chopBefore.values().equals(other.chopBefore.values())) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | if (!chopAfter.values().equals(other.chopAfter.values())) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | return minimumDepth == other.minimumDepth |
| | | && maximumDepth == other.maximumDepth |
| | | && chopBefore.values().equals(other.chopBefore.values()) |
| | | && chopAfter.values().equals(other.chopAfter.values()); |
| | | } |
| | | |
| | | |
| | |
| | | throws KeyStoreException { |
| | | ensureValid(alias, CERT_ALIAS_MSG); |
| | | KeyStore keyStore = getKeyStore(); |
| | | if (keyStore == null) |
| | | return false; |
| | | return keyStore.containsAlias(alias); |
| | | return keyStore != null && keyStore.containsAlias(alias); |
| | | } |
| | | |
| | | |
| | |
| | | new ArrayList<VersionCompatibilityIssue>(); |
| | | for (VersionCompatibilityIssue evt : VERSION_COMPATIBILITY_ISSUES) { |
| | | if (!excludeIds.contains(evt.getCause().getId())) { |
| | | boolean isUpgrade = neu.compareTo(current) >= 0; |
| | | BuildVersion currentVersion = new BuildVersion( |
| | | current.getMajorVersion(), current.getMinorVersion(), |
| | | current.getPointVersion(), current.getRevisionNumber()); |
| | | if (isUpgrade) |
| | | // If the currentVersion is newer than the issue described, then there |
| | | // is no problem. This can occur for instance when we discovered a |
| | | // flag day too late (and we added the flag day description to the |
| | | // code way after the revision). |
| | | if (currentVersion.compareTo(evt.getVersion()) < 0) |
| | | { |
| | | // If the currentVersion is newer than the issue described, then there |
| | | // is no problem. This can occur for instance when we discovered a |
| | | // flag day too late (and we added the flag day description to the |
| | | // code way after the revision). |
| | | if (currentVersion.compareTo(evt.getVersion()) < 0) |
| | | { |
| | | issueList.add(evt); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // If the newVersion in the reversion is newer than the issue |
| | | // described, then there is no problem. This can occur for instance |
| | | // when we discovered a flag day too late (and we added the flag day |
| | | // description to the code way after the revision). |
| | | if (currentVersion.compareTo(evt.getVersion()) < 0) |
| | | { |
| | | issueList.add(evt); |
| | | } |
| | | issueList.add(evt); |
| | | } |
| | | } |
| | | } |
| | |
| | | "ds-task-class-name: org.opends.server.tasks.DummyTask", |
| | | "ds-task-dummy-sleep-time: 0"); |
| | | |
| | | if (rc != ResultCode.SUCCESS) { |
| | | return false; |
| | | } |
| | | |
| | | return DirectoryServer.entryExists(DN.valueOf(taskDN)); |
| | | return rc == ResultCode.SUCCESS |
| | | && DirectoryServer.entryExists(DN.valueOf(taskDN)); |
| | | } |
| | | } |
| | |
| | | */ |
| | | static boolean testEqual(LDAPAttribute a1, LDAPAttribute a2) |
| | | { |
| | | if (a1.getAttributeType().equals(a2.getAttributeType())) |
| | | { |
| | | return a1.getValues().equals(a2.getValues()); |
| | | } |
| | | return false; |
| | | return a1.getAttributeType().equals(a2.getAttributeType()) |
| | | && a1.getValues().equals(a2.getValues()); |
| | | } |
| | | |
| | | /** |