mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
05.42.2009 35c5f651a0c5c658a4bc67614e815405fcc6a830
Merge ASN1 branch to trunk
34 files deleted
1 files copied
619 files modified
1 files renamed
32 files added
78234 ■■■■■ changed files
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLDeleteOperation.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLExtendedOperation.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLModifyDNOperation.java 23 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLModifyOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java 439 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/ModifyEntryTask.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/NewEntryTask.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/Task.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java 30 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewIndexPanel.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java 11 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/nodes/BasicNode.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/extension.properties 28 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/jeb.properties 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/messages/protocol.properties 161 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/messages/src/org/opends/messages/MessageBuilder.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/ui/SecurityOptionsDialog.java 5 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/CertificateDialog.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/ACIPropertyDefinition.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/AdministrationConnector.java 441 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/AdministrationDataSync.java 102 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/ManagedObjectPath.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/Reference.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/server/ConfigAddListenerAdaptor.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/server/ConfigDeleteListenerAdaptor.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/admin/server/ServerManagementContext.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/AccessControlHandler.java 233 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/ApproximateMatchingRule.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/AttributeSyntax.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/ClientConnection.java 48 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/CompressedSchema.java 42 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/ConnectionSecurityProvider.java 234 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/DebugLogPublisher.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/DirectoryThread.java 3 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/EqualityMatchingRule.java 54 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/ExtensibleIndexer.java 60 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/ExtensibleMatchingRule.java 46 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/IndexQueryFactory.java 95 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/MatchingRule.java 74 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/OrderingMatchingRule.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/PasswordGenerator.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/PasswordStorageScheme.java 23 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/PasswordValidator.java 5 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/SubstringMatchingRule.java 112 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/api/VirtualAttributeProvider.java 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/Aci.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciContainer.java 25 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciEffectiveRights.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java 27 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciList.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciListenerManager.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/GroupDN.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/PatternDN.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/PatternRDN.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/UserAttr.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/UserDN.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/BackupBackend.java 60 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/LDIFBackend.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/MemoryBackend.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/MonitorBackend.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/NullBackend.java 80 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/RootDSEBackend.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java 68 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/TrustStoreBackend.java 44 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ApproximateIndexer.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/DN2URI.java 23 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryCachePreloader.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java 156 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryIDSetSorter.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EqualityIndexer.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ExportJob.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ID2Entry.java 260 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexQuery.java 63 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexQueryFactoryImpl.java 49 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java 21 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/JECompressedSchema.java 371 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/JEExtensibleIndexer.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/JebFormat.java 239 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/OctetStringKeyComparator.java 72 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/OrderingIndexer.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SortValues.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java 47 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SubstringIndexer.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java 51 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VLVKeyComparator.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VerifyJob.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/task/RecurringTask.java 16 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/task/Task.java 20 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/task/TaskBackend.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/backends/task/TaskScheduler.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/BooleanConfigAttribute.java 21 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/ConfigAttribute.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/DNConfigAttribute.java 34 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/IntegerConfigAttribute.java 31 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/IntegerWithUnitConfigAttribute.java 19 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/JMXMBean.java 32 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/MultiChoiceConfigAttribute.java 35 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/ReadOnlyConfigAttribute.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/config/StringConfigAttribute.java 27 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/AccountUsableRequestControl.java 101 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/AccountUsableResponseControl.java 546 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/AuthorizationIdentityResponseControl.java 257 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/ControlDecoder.java 68 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/EntryChangeNotificationControl.java 423 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRights.java 249 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRightsRequestControl.java 287 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPAssertionRequestControl.java 196 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPostReadRequestControl.java 261 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPostReadResponseControl.java 221 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPreReadRequestControl.java 281 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPreReadResponseControl.java 216 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesControl.java 235 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesFilter.java 434 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/PagedResultsControl.java 227 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordExpiredControl.java 109 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordExpiringControl.java 163 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordPolicyRequestControl.java 92 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordPolicyResponseControl.java 332 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/PersistentSearchControl.java 298 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/ProxiedAuthV1Control.java 257 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/ProxiedAuthV2Control.java 267 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/ServerSideSortRequestControl.java 600 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/ServerSideSortResponseControl.java 178 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/SubtreeDeleteControl.java 94 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java 367 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/controls/VLVResponseControl.java 220 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/AddOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/AddOperationBasis.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/AddOperationWrapper.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/BindOperation.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/BindOperationBasis.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/BindOperationWrapper.java 16 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/CompareOperation.java 5 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/CompareOperationBasis.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/DefaultCompressedSchema.java 333 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/DeleteOperationBasis.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java 133 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ExtendedOperation.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ExtendedOperationBasis.java 23 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/GroupManager.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ModifyDNOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ModifyDNOperationBasis.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ModifyDNOperationWrapper.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperation.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperationBasis.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperationWrapper.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/OperationWrapper.java 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/PasswordPolicy.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/PasswordPolicyState.java 100 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/PluginConfigManager.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/SchemaConfigManager.java 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/SearchOperation.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/SearchOperationBasis.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/SearchOperationWrapper.java 12 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/UnbindOperationBasis.java 4 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/networkgroups/NetworkGroup.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyFactory.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/crypto/CryptoManagerImpl.java 61 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/crypto/CryptoManagerSync.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/crypto/GetSymmetricKeyExtendedOperation.java 55 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/AESPasswordStorageScheme.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/AnonymousSASLMechanismHandler.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/AttributeValuePasswordValidator.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/Base64PasswordStorageScheme.java 36 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/BlowfishPasswordStorageScheme.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/CancelExtendedOperation.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/CharacterSetPasswordValidator.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/ClearPasswordStorageScheme.java 32 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/ConfigFileHandler.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/ConnectionSecurityProvider.java 81 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/CryptPasswordStorageScheme.java 42 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/DictionaryPasswordValidator.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/DynamicGroup.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java 25 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/EntryUUIDVirtualAttributeProvider.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/ExactMatchIdentityMapper.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/ExternalSASLMechanismHandler.java 63 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java 48 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/FingerprintCertificateMapper.java 16 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/GSSAPISASLMechanismHandler.java 303 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/GetConnectionIDExtendedOperation.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/HasSubordinatesVirtualAttributeProvider.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/InternalConnectionSecurityProvider.java 127 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java 16 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/LengthBasedPasswordValidator.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/MD5PasswordStorageScheme.java 50 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/MemberVirtualAttributeProvider.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/NullConnectionSecurityProvider.java 510 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/NumSubordinatesVirtualAttributeProvider.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java 82 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java 1156 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/PlainSASLMechanismHandler.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/RC4PasswordStorageScheme.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/RandomPasswordGenerator.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/RedirectingByteChannel.java 114 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/RegularExpressionIdentityMapper.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/RepeatedCharactersPasswordValidator.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SASLByteChannel.java 329 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SASLContext.java 49 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SASLSecurityProvider.java 467 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SHA1PasswordStorageScheme.java 50 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedMD5PasswordStorageScheme.java 71 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA1PasswordStorageScheme.java 71 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA256PasswordStorageScheme.java 71 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA384PasswordStorageScheme.java 71 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA512PasswordStorageScheme.java 71 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SimilarityBasedPasswordValidator.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/StartTLSExtendedOperation.java 23 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/StaticGroup.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProvider.java 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/TLSByteChannel.java 400 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/TLSCapableConnection.java 21 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/TLSConnectionSecurityProvider.java 1082 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/TripleDESPasswordStorageScheme.java 39 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/UniqueCharactersPasswordValidator.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/UserAttributeNotificationMessageTemplateElement.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/UserDefinedVirtualAttributeProvider.java 15 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/VirtualStaticGroup.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/extensions/WhoAmIExtendedOperation.java 121 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/TextAccessLogPublisher.java 64 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/debug/DebugTracer.java 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/loggers/debug/TraceSettings.java 55 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/monitors/BackendMonitor.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/monitors/ClientConnectionMonitorProvider.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/monitors/ConnectionHandlerMonitor.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/monitors/MemoryUsageMonitorProvider.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/monitors/StackTraceMonitorProvider.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/monitors/SystemInfoMonitorProvider.java 25 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/monitors/VersionMonitorProvider.java 24 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/ChangeNumberControlPlugin.java 52 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/EntryUUIDPlugin.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/LastModPlugin.java 55 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/SevenBitCleanPlugin.java 23 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/UniqueAttributePlugin.java 16 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileStack.java 69 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileViewer.java 31 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfilerThread.java 22 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1.java 302 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Boolean.java 341 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReader.java 456 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelWriter.java 318 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReader.java 486 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Element.java 1247 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Enumerated.java 358 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReader.java 793 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Integer.java 373 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Long.java 384 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Null.java 259 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1OctetString.java 515 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1OutputStreamWriter.java 591 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java 384 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Sequence.java 436 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Set.java 414 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Writer.java 389 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ByteSequenceOutputStream.java 115 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java 200 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/internal/InternalLDAPInputStream.java 166 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/internal/InternalLDAPOutputStream.java 519 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java 119 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java 16 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/AbandonRequestProtocolOp.java 70 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/AddRequestProtocolOp.java 164 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/AddResponseProtocolOp.java 245 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/BindRequestProtocolOp.java 313 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/BindResponseProtocolOp.java 348 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/CompareRequestProtocolOp.java 220 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/CompareResponseProtocolOp.java 245 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/DeleteRequestProtocolOp.java 79 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/DeleteResponseProtocolOp.java 245 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ExtendedRequestProtocolOp.java 157 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ExtendedResponseProtocolOp.java 329 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/IntermediateResponseProtocolOp.java 205 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java 54 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java 2266 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java 246 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPControl.java 388 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPFilter.java 213 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPMessage.java 172 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPReader.java 2977 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPRequestHandler.java 5 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java 528 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyDNRequestProtocolOp.java 247 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyDNResponseProtocolOp.java 246 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java 150 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyResponseProtocolOp.java 248 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ProtocolOp.java 149 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java 415 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java 240 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java 153 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java 89 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/UnbindRequestProtocolOp.java 53 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerState.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/HistVal.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/Historical.java 28 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRule.java 14 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java 56 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationRepairRequestControl.java 87 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddMsg.java 89 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteMsg.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyCommonMsg.java 23 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java 25 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java 25 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/protocol/MonitorMsg.java 208 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationBackend.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationMonitor.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/AbsoluteSubtreeSpecificationSyntax.java 12 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/AciSyntax.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/AttributeTypeSyntax.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/AuthPasswordEqualityMatchingRule.java 60 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/AuthPasswordExactEqualityMatchingRule.java 60 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/AuthPasswordSyntax.java 21 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/BinarySyntax.java 14 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/BitStringEqualityMatchingRule.java 65 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/BitStringSyntax.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/BooleanEqualityMatchingRule.java 63 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/BooleanSyntax.java 71 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactEqualityMatchingRule.java 54 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactIA5EqualityMatchingRule.java 64 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactIA5SubstringMatchingRule.java 164 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactOrderingMatchingRule.java 64 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactSubstringMatchingRule.java 154 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreEqualityMatchingRule.java 83 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreIA5EqualityMatchingRule.java 64 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreIA5SubstringMatchingRule.java 173 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreListEqualityMatchingRule.java 55 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreListSubstringMatchingRule.java 164 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreOrderingMatchingRule.java 71 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreSubstringMatchingRule.java 164 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CertificateListSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CertificatePairSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CertificateSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CollationMatchingRuleFactory.java 839 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/CountryStringSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DITContentRuleSyntax.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DITStructureRuleSyntax.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DeliveryMethodSyntax.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DirectoryStringFirstComponentEqualityMatchingRule.java 50 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DirectoryStringSyntax.java 12 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java 72 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DistinguishedNameSyntax.java 14 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java 34 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/EnhancedGuideSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/FaxNumberSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/FaxSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/GeneralizedTimeEqualityMatchingRule.java 29 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/GeneralizedTimeOrderingMatchingRule.java 40 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java 17 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/GuideSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/IA5StringSyntax.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/IntegerEqualityMatchingRule.java 61 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/IntegerFirstComponentEqualityMatchingRule.java 60 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/IntegerOrderingMatchingRule.java 150 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/IntegerSyntax.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/JPEGSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java 30 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java 30 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/MatchingRuleUseSyntax.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/NameAndOptionalUIDSyntax.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/NameFormSyntax.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringEqualityMatchingRule.java 55 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringOrderingMatchingRule.java 71 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringSubstringMatchingRule.java 165 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/OIDSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/ObjectClassSyntax.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/ObjectIdentifierEqualityMatchingRule.java 46 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/ObjectIdentifierFirstComponentEqualityMatchingRule.java 44 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringEqualityMatchingRule.java 36 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringOrderingMatchingRule.java 22 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringSubstringMatchingRule.java 137 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/OtherMailboxSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/PostalAddressSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/PresentationAddressEqualityMatchingRule.java 47 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/PresentationAddressSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/PrintableStringSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/ProtocolInformationEqualityMatchingRule.java 47 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/ProtocolInformationSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/RFC3672SubtreeSpecificationSyntax.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/RelativeSubtreeSpecificationSyntax.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/SubstringAssertionSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/SupportedAlgorithmSyntax.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/TelephoneNumberEqualityMatchingRule.java 40 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/TelephoneNumberSubstringMatchingRule.java 147 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/TelephoneNumberSyntax.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/TeletexTerminalIdentifierSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/TelexNumberSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UTCTimeSyntax.java 17 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UUIDEqualityMatchingRule.java 87 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UUIDOrderingMatchingRule.java 114 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UUIDSyntax.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UniqueMemberEqualityMatchingRule.java 56 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordEqualityMatchingRule.java 65 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordExactEqualityMatchingRule.java 134 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordSyntax.java 19 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/schema/WordEqualityMatchingRule.java 45 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tasks/AddSchemaFileTask.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tasks/BackupTask.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tasks/DisconnectClientTask.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tasks/ShutdownTask.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tasks/TaskUtils.java 36 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/BackUpDB.java 51 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/ConsoleDebugLogPublisher.java 474 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/DBTest.java 112 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/EncodePassword.java 48 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java 67 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/ImportLDIF.java 81 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java 209 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java 20 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPConnection.java 118 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java 178 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java 77 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPReader.java 101 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java 137 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPToolOptions.java 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPToolUtils.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDAPWriter.java 97 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDIFDiff.java 19 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/LDIFModify.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/ManageAccount.java 231 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/RestoreDB.java 24 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java 51 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/VerboseTracer.java 172 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/Branch.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/TemplateEntry.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/tasks/TaskClient.java 118 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/tasks/TaskEntry.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/AbstractOperation.java 32 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/AccountStatusNotification.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/AttributeBuilder.java 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/AttributeType.java 93 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/AttributeValue.java 343 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/AttributeValues.java 424 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/Attributes.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/ByteArray.java 132 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/ByteSequence.java 353 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/ByteSequenceReader.java 509 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/ByteString.java 818 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/ByteStringBuilder.java 1155 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/ByteStringFactory.java 91 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/CommonSchemaElements.java 19 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/Control.java 141 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/CryptoManager.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/DITContentRule.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/DITStructureRule.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/DN.java 541 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/Entry.java 1664 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/EntryEncodeConfig.java 37 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/IntermediateResponse.java 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/MatchingRuleUse.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/NameForm.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/ObjectClass.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/Operation.java 19 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/RDN.java 65 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/RawAttribute.java 128 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/RawFilter.java 529 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/RawModification.java 92 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/RecordingInputStream.java 180 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/RecordingOutputStream.java 144 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/Schema.java 312 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/SearchFilter.java 110 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PluginOperation.java 19 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostOperationBindOperation.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostOperationExtendedOperation.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseAddOperation.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseBindOperation.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseCompareOperation.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseDeleteOperation.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseExtendedOperation.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseModifyDNOperation.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseModifyOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseSearchOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreOperationBindOperation.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreOperationExtendedOperation.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseAddOperation.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseBindOperation.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseCompareOperation.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseDeleteOperation.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseExtendedOperation.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseModifyDNOperation.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseModifyOperation.java 1 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/SearchEntrySearchOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/SearchReferenceSearchOperation.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/types/operation/SubordinateModifyDNOperation.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/Base64.java 50 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/LDIFReader.java 70 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/LDIFWriter.java 72 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java 17 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/SizeLimitInputStream.java 182 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/util/StaticUtils.java 276 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java 145 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java 82 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendDeleteOperation.java 115 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java 131 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java 204 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendSearchOperation.java 129 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_targetattr.xml 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_targetfilter.xml 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/multiple_aci_tests.xml 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsml/dsml_test.xml 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog.xml 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/quicksetup/TestUtilities.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/RelativeInheritedDefaultBehaviorProviderTest.java 4 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/TestCfg.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/MockLDAPConnection.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/server/DefaultBehaviorTest.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/api/PasswordValidatorTestCase.java 173 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/TargetTestCase.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/GenericBackendTestCase.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaTestMatchingRule.java 24 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestBackendImpl.java 26 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestImportJob.java 9 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestJebFormat.java 305 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestRebuildJob.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestVLVIndex.java 200 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestVerifyJob.java 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/MatchedValuesControlTest.java 78 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/PasswordControlTest.java 199 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/PasswordPolicyControlTestCase.java 466 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/PersistentSearchControlTest.java 139 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/ProxiedAuthV1ControlTestCase.java 182 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/ProxiedAuthV2ControlTestCase.java 149 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/ServerSideSortControlTestCase.java 77 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/VLVControlTestCase.java 258 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/AbandonOperationTestCase.java 209 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/AddOperationTestCase.java 462 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/BindOperationTestCase.java 561 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/CompareOperationTestCase.java 135 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/DeleteOperationTestCase.java 159 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/IdleTimeLimitTestCase.java 48 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/ModifyOperationTestCase.java 655 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/OperationTestCase.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/PluginConfigManagerTestCase.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/RejectUnauthReqTests.java 26 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/SearchOperationTestCase.java 136 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestModifyDNOperation.java 208 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/WorkflowConfigurationTest.java 18 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/MockClientConnection.java 32 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/NetworkGroupTest.java 15 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/crypto/GetSymmetricKeyExtendedOperationTestCase.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/AnonymousSASLMechanismHandlerTestCase.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandlerTestCase.java 20 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/CancelExtendedOperationTestCase.java 371 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/DigestMD5SASLMechanismHandlerTestCase.java 12 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java 51 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/EntryUUIDVirtualAttributeProviderTestCase.java 43 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java 48 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java 21 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/HasSubordinatesVirtualAttributeProviderTestCase.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/InternalConnectionSecurityProviderTestCase.java 123 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java 79 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/NullConnectionSecurityProviderTestCase.java 183 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/NumSubordinatesVirtualAttributeProviderTestCase.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java 71 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/PasswordStorageSchemeTestCase.java 63 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/PlainSASLMechanismHandlerTestCase.java 155 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/SaltedSHA1PasswordStorageSchemeTestCase.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProviderTestCase.java 68 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/TestPasswordValidator.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java 13 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/UserDefinedVirtualAttributeProviderTestCase.java 24 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/VirtualStaticGroupTestCase.java 33 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java 70 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/monitors/InternalSearchMonitorTestCase.java 11 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/DelayPreOpPlugin.java 170 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/DisconnectClientPlugin.java 143 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/EntryUUIDPluginTestCase.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/LDAPADListPluginTestCase.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/LastModPluginTestCase.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/PasswordPolicyImportPluginTestCase.java 6 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/ShortCircuitPlugin.java 196 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/UniqueAttributePluginTestCase.java 8 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReaderTestCase.java 244 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelWriterTestCase.java 73 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReaderTestCase.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReaderTestCase.java 17 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1OutputStreamWriterTestCase.java 66 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ReaderTestCase.java 804 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1WriterTestCase.java 709 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/SocketReadThread.java 156 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/SocketWriteThread.java 103 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Boolean.java 473 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Element.java 1383 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Enumerated.java 573 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Exception.java 66 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Integer.java 639 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Long.java 808 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Null.java 311 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1OctetString.java 671 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1ReaderAndWriter.java 367 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Sequence.java 638 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Set.java 530 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java 101 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java 48 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/internal/InternalSearchOperationTestCase.java 25 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java 31 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java 51 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LDAPv2TestCase.java 176 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LdapTestCase.java 49 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestAbandonRequestProtocolOp.java 34 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java 125 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java 138 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java 146 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java 149 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestCompareRequestProtocolOp.java 112 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java 142 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestDeleteRequestProtocolOp.java 53 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java 142 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPFilter.java 77 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyDNRequestProtocolOp.java 139 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java 142 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java 118 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java 142 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestSearchProtocolOp.java 334 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestSearchResultEntryProtocolOp.java 76 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestUnbindRequestProtocolOp.java 13 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/GenerationIdTest.java 4 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java 23 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java 32 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AttrInfoTest.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java 8 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ModifyConflictTest.java 40 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ValueInfoTest.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java 22 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/AttributeSyntaxTest.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/AttributeTypeSyntaxTest.java 4 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/AuthPasswordEqualityMatchingRuleTest.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/BitStringSyntaxTest.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/CollationMatchingRuleTest.java 23 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ConfigurableAttributeSyntaxTest.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/EqualLengthApproximateMatchingRule.java 26 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/EqualityMatchingRuleTest.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/OrderingMatchingRuleTest.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/SubstringMatchingRuleTest.java 17 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/UserPasswordEqualityMatchingRuleTest.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/DisconnectClientTaskTestCase.java 41 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/DummyTask.java 2 ●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java 619 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/AttributeBuilderTest.java 112 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteSequenceReaderTest.java 402 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteSequenceTest.java 209 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteStringBuilderTest.java 246 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteStringTest.java 149 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/PrivilegeTestCase.java 11 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/SearchFilterTests.java 9 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestAttributeType.java 82 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestAttributeValue.java 111 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestDN.java 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestEntry.java 5 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestRDN.java 7 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/VirtualAttributeTestCase.java 16 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/util/TestLDIFReader.java 36 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/util/TestStaticUtils.java 10 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLAddOperation.java
@@ -32,13 +32,13 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.AddRequestProtocolOp;
import org.opends.server.protocols.ldap.AddResponseProtocolOp;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.ProtocolOp;
import org.opends.server.tools.LDAPConnection;
import org.opends.server.types.ByteString;
import org.opends.server.types.LDAPException;
import org.opends.server.types.RawAttribute;
@@ -86,17 +86,17 @@
    LDAPResult addResponse = objFactory.createLDAPResult();
    addResponse.setRequestID(addRequest.getRequestID());
    ASN1OctetString dnStr = new ASN1OctetString(addRequest.getDn());
    ByteString dnStr = ByteString.valueOf(addRequest.getDn());
    ArrayList<RawAttribute> attributes = new ArrayList<RawAttribute>();
    List<DsmlAttr> addList = addRequest.getAttr();
    for(DsmlAttr attr : addList)
    {
      ArrayList<ASN1OctetString> values = new ArrayList<ASN1OctetString>();
      ArrayList<ByteString> values = new ArrayList<ByteString>();
      List<String> vals = attr.getValue();
      for(String val : vals)
      {
        values.add(new ASN1OctetString(val));
        values.add(ByteString.valueOf(val));
      }
      LDAPAttribute ldapAttribute = new LDAPAttribute(attr.getName(), values);
      attributes.add(ldapAttribute);
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLCompareOperation.java
@@ -32,12 +32,12 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.CompareRequestProtocolOp;
import org.opends.server.protocols.ldap.CompareResponseProtocolOp;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.ProtocolOp;
import org.opends.server.tools.LDAPConnection;
import org.opends.server.types.ByteString;
import org.opends.server.types.LDAPException;
@@ -87,10 +87,8 @@
    // Read the attribute name and value for the compare request.
    AttributeValueAssertion attrValAssertion = compareRequest.getAssertion();
    String attrName = attrValAssertion.getName();
    ASN1OctetString attrValue =
      new ASN1OctetString(attrValAssertion.getValue());
    ASN1OctetString dnStr = new ASN1OctetString(compareRequest.getDn());
    ByteString attrValue = ByteString.valueOf(attrValAssertion.getValue());
    ByteString dnStr = ByteString.valueOf(compareRequest.getDn());
    // Create and send the LDAP compare request to the server.
    ProtocolOp op = new CompareRequestProtocolOp(dnStr, attrName, attrValue);
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLDeleteOperation.java
@@ -30,12 +30,12 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.DeleteRequestProtocolOp;
import org.opends.server.protocols.ldap.DeleteResponseProtocolOp;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.ProtocolOp;
import org.opends.server.tools.LDAPConnection;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.LDAPException;
@@ -88,7 +88,7 @@
    delResponse.setRequestID(deleteRequest.getRequestID());
    // Create and send the LDAP delete request to the server.
    ASN1OctetString dnStr = new ASN1OctetString(deleteRequest.getDn());
    ByteString dnStr = ByteString.valueOf(deleteRequest.getDn());
    ProtocolOp op = new DeleteRequestProtocolOp(dnStr);
    LDAPMessage msg = new LDAPMessage(DSMLServlet.nextMessageID(), op);
    connection.getLDAPWriter().writeMessage(msg);
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLExtendedOperation.java
@@ -32,12 +32,12 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.ExtendedRequestProtocolOp;
import org.opends.server.protocols.ldap.ExtendedResponseProtocolOp;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.ProtocolOp;
import org.opends.server.tools.LDAPConnection;
import org.opends.server.types.ByteString;
import org.opends.server.types.LDAPException;
@@ -86,7 +86,7 @@
    String requestName = extendedRequest.getRequestName();
    Object value = extendedRequest.getRequestValue();
    ASN1OctetString asnValue = new ASN1OctetString(value.toString());
    ByteString asnValue = ByteString.valueOf(value.toString());
    // Create and send the LDAP request to the server.
    ProtocolOp op = new ExtendedRequestProtocolOp(requestName, asnValue);
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLModifyDNOperation.java
@@ -33,11 +33,11 @@
import org.opends.messages.Message;
import org.opends.server.tools.LDAPConnection;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.ModifyDNRequestProtocolOp;
import org.opends.server.protocols.ldap.ModifyDNResponseProtocolOp;
import org.opends.server.protocols.ldap.ProtocolOp;
import org.opends.server.types.ByteString;
import org.opends.server.types.LDAPException;
@@ -84,22 +84,21 @@
  {
    LDAPResult modDNResponse = objFactory.createLDAPResult();
    modDNResponse.setRequestID(modifyDNRequest.getRequestID());
    ASN1OctetString dnStr = new ASN1OctetString(modifyDNRequest.getDn());
    ByteString dnStr = ByteString.valueOf(modifyDNRequest.getDn());
    ProtocolOp op = null;
    if(modifyDNRequest.getNewSuperior() != null)
    {
      op = new ModifyDNRequestProtocolOp(dnStr,
    new ASN1OctetString(modifyDNRequest.getNewrdn()),
    modifyDNRequest.isDeleteoldrdn(),
    new ASN1OctetString(modifyDNRequest.getNewSuperior()));
    } else
      op = new ModifyDNRequestProtocolOp(dnStr, ByteString
          .valueOf(modifyDNRequest.getNewrdn()), modifyDNRequest
          .isDeleteoldrdn(), ByteString.valueOf(modifyDNRequest
          .getNewSuperior()));
    }
    else
    {
      op = new ModifyDNRequestProtocolOp(dnStr,
    new ASN1OctetString(modifyDNRequest.getNewrdn()),
    modifyDNRequest.isDeleteoldrdn());
      op = new ModifyDNRequestProtocolOp(dnStr, ByteString
          .valueOf(modifyDNRequest.getNewrdn()), modifyDNRequest
          .isDeleteoldrdn());
    }
    // Create and send the LDAP request to the server.
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLModifyOperation.java
@@ -34,7 +34,6 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.LDAPModification;
@@ -42,6 +41,7 @@
import org.opends.server.protocols.ldap.ModifyResponseProtocolOp;
import org.opends.server.protocols.ldap.ProtocolOp;
import org.opends.server.tools.LDAPConnection;
import org.opends.server.types.ByteString;
import org.opends.server.types.LDAPException;
import org.opends.server.types.ModificationType;
import org.opends.server.types.RawModification;
@@ -109,12 +109,12 @@
      // Read the attribute name and values.
      String attrType = attr.getName();
      ArrayList<ASN1OctetString> values = new ArrayList<ASN1OctetString> ();
      ArrayList<ByteString> values = new ArrayList<ByteString> ();
      List<String> vals = attr.getValue();
      for(String val : vals)
      {
        values.add(new ASN1OctetString(val));
        values.add(ByteString.valueOf(val));
      }
      LDAPAttribute ldapAttr = new LDAPAttribute(attrType, values);
@@ -123,7 +123,7 @@
    }
    ASN1OctetString dnStr = new ASN1OctetString(modifyRequest.getDn());
    ByteString dnStr = ByteString.valueOf(modifyRequest.getDn());
    // Create and send the LDAP request to the server.
    ProtocolOp op = new ModifyRequestProtocolOp(dnStr, modifications);
opendj-sdk/opends/src/dsml/org/opends/dsml/protocol/DSMLSearchOperation.java
@@ -25,25 +25,26 @@
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 */
package org.opends.dsml.protocol;
import org.opends.messages.Message;
import java.io.IOException;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import javax.xml.bind.JAXBElement;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.protocols.ldap.LDAPConstants;
import org.opends.server.protocols.ldap.LDAPFilter;
import org.opends.server.protocols.ldap.LDAPMessage;
import org.opends.server.protocols.ldap.SearchRequestProtocolOp;
import org.opends.server.protocols.ldap.SearchResultEntryProtocolOp;
import org.opends.server.protocols.ldap.SearchResultReferenceProtocolOp;
import org.opends.server.protocols.ldap.SearchResultDoneProtocolOp;
import org.opends.server.tools.LDAPConnection;
import org.opends.server.types.ByteString;
@@ -55,17 +56,21 @@
/**
 * This class provides the functionality for the performing an
 * LDAP SEARCH operation based on the specified DSML request.
 * This class provides the functionality for the performing an LDAP
 * SEARCH operation based on the specified DSML request.
 */
public class DSMLSearchOperation
{
  private LDAPConnection connection;
  /**
   * Create the instance with the specified connection.
   *
   * @param connection    The LDAP connection to send the request on.
   * @param connection
   *          The LDAP connection to send the request on.
   */
  public DSMLSearchOperation(LDAPConnection connection)
@@ -73,301 +78,381 @@
    this.connection = connection;
  }
  /**
   * Returns a new AND search filter with the provided filter components.
   * Returns a new AND search filter with the provided filter
   * components.
   *
   * @param filterSet The filter components for this filter
   *
   * @return a new AND search filter with the provided filter components.
   *
   * @throws LDAPException an LDAPException is thrown if the creation of a
   *                       filter component fails.
   * @param filterSet
   *          The filter components for this filter
   * @return a new AND search filter with the provided filter
   *         components.
   * @throws LDAPException
   *           an LDAPException is thrown if the creation of a filter
   *           component fails.
   */
  private static LDAPFilter createANDFilter(FilterSet filterSet)
          throws LDAPException {
      throws LDAPException
  {
    List<JAXBElement<?>> list = filterSet.getFilterGroup();
    ArrayList<RawFilter> filters = new ArrayList<RawFilter>(list.size());
    for(JAXBElement<?> filter : list) {
    for (JAXBElement<?> filter : list)
    {
      filters.add(createFilter(filter));
    }
    return LDAPFilter.createANDFilter(filters);
  }
  /**
   * Returns a new Approximate search filter with the provided information.
   * Returns a new Approximate search filter with the provided
   * information.
   *
   * @param ava the attribute value assertion for this approximate filter.
   *
   * @return a new Approximate search filter with the provided information.
   * @param ava
   *          the attribute value assertion for this approximate
   *          filter.
   * @return a new Approximate search filter with the provided
   *         information.
   */
  private static LDAPFilter createApproximateFilter(AttributeValueAssertion ava)
  {
    return LDAPFilter.createApproximateFilter(ava.getName(),
                                           new ASN1OctetString(ava.getValue()));
    return LDAPFilter.createApproximateFilter(ava.getName(), ByteString
        .valueOf(ava.getValue()));
  }
  /**
   * Returns a new Equality search filter with the provided information.
   * Returns a new Equality search filter with the provided
   * information.
   *
   * @param ava the attribute value assertion for this Equality filter.
   *
   * @return a new Equality search filter with the provided information.
   * @param ava
   *          the attribute value assertion for this Equality filter.
   * @return a new Equality search filter with the provided
   *         information.
   */
  private static LDAPFilter createEqualityFilter(AttributeValueAssertion ava) {
    return LDAPFilter.createEqualityFilter(ava.getName(),
                                          new ASN1OctetString(ava.getValue()));
  private static LDAPFilter createEqualityFilter(AttributeValueAssertion ava)
  {
    return LDAPFilter.createEqualityFilter(ava.getName(), ByteString
        .valueOf(ava.getValue()));
  }
  /**
   * Returns a new Extensible search filter with the provided information.
   * Returns a new Extensible search filter with the provided
   * information.
   *
   * @param mra the matching rule assertion for this Extensible filter.
   *
   * @return a new Extensible search filter with the provided information.
   * @param mra
   *          the matching rule assertion for this Extensible filter.
   * @return a new Extensible search filter with the provided
   *         information.
   */
  private static LDAPFilter createExtensibleFilter(MatchingRuleAssertion mra) {
    return LDAPFilter.createExtensibleFilter(mra.getMatchingRule(),
                                        mra.getName(),
                                        new ASN1OctetString(mra.getValue()),
                                        mra.isDnAttributes());
  private static LDAPFilter createExtensibleFilter(MatchingRuleAssertion mra)
  {
    return LDAPFilter.createExtensibleFilter(mra.getMatchingRule(), mra
        .getName(), ByteString.valueOf(mra.getValue()), mra.isDnAttributes());
  }
  /**
   * Returns a new GreaterOrEqual search filter with the provided information.
   * Returns a new GreaterOrEqual search filter with the provided
   * information.
   *
   * @param ava the attribute value assertion for this GreaterOrEqual filter.
   *
   * @return a new GreaterOrEqual search filter with the provided information.
   * @param ava
   *          the attribute value assertion for this GreaterOrEqual
   *          filter.
   * @return a new GreaterOrEqual search filter with the provided
   *         information.
   */
  private static LDAPFilter createGreaterOrEqualFilter(
                              AttributeValueAssertion ava) {
    return LDAPFilter.createGreaterOrEqualFilter(ava.getName(),
                                          new ASN1OctetString(ava.getValue()));
      AttributeValueAssertion ava)
  {
    return LDAPFilter.createGreaterOrEqualFilter(ava.getName(), ByteString
        .valueOf(ava.getValue()));
  }
  /**
   * Returns a new LessOrEqual search filter with the provided information.
   * Returns a new LessOrEqual search filter with the provided
   * information.
   *
   * @param ava the attribute value assertion for this LessOrEqual filter.
   *
   * @return a new LessOrEqual search filter with the provided information.
   * @param ava
   *          the attribute value assertion for this LessOrEqual
   *          filter.
   * @return a new LessOrEqual search filter with the provided
   *         information.
   */
  private static LDAPFilter createLessOrEqualFilter(
                              AttributeValueAssertion ava) {
    return LDAPFilter.createLessOrEqualFilter(ava.getName(),
                                          new ASN1OctetString(ava.getValue()));
  private static LDAPFilter createLessOrEqualFilter(AttributeValueAssertion ava)
  {
    return LDAPFilter.createLessOrEqualFilter(ava.getName(), ByteString
        .valueOf(ava.getValue()));
  }
  /**
   * Returns a new NOT search filter with the provided information.
   *
   * @param filter the filter for this NOT filter.
   *
   * @param filter
   *          the filter for this NOT filter.
   * @return a new NOT search filter with the provided information.
   *
   * @throws LDAPException an LDAPException is thrown if the creation of the
   * @throws LDAPException
   *           an LDAPException is thrown if the creation of the
   *                       provided filter fails.
   */
  private static LDAPFilter createNOTFilter(Filter filter)
          throws LDAPException {
  private static LDAPFilter createNOTFilter(Filter filter) throws LDAPException
  {
    return LDAPFilter.createNOTFilter(createFilter(filter));
  }
  /**
   * Returns a new OR search filter with the provided filter components.
   * Returns a new OR search filter with the provided filter
   * components.
   *
   * @param filterSet The filter components for this filter
   *
   * @return a new OR search filter with the provided filter components.
   *
   * @throws LDAPException an LDAPException is thrown if the creation of a
   *                       filter component fails.
   * @param filterSet
   *          The filter components for this filter
   * @return a new OR search filter with the provided filter
   *         components.
   * @throws LDAPException
   *           an LDAPException is thrown if the creation of a filter
   *           component fails.
   */
  private static LDAPFilter createORFilter(FilterSet filterSet)
          throws LDAPException {
      throws LDAPException
  {
    List<JAXBElement<?>> list = filterSet.getFilterGroup();
    ArrayList<RawFilter> filters = new ArrayList<RawFilter>(list.size());
    for(JAXBElement<?> filter : list) {
    for (JAXBElement<?> filter : list)
    {
      filters.add(createFilter(filter));
    }
    return LDAPFilter.createORFilter(filters);
  }
  /**
   * Returns a new Present search filter with the provided information.
   * Returns a new Present search filter with the provided
   * information.
   *
   * @param ad the attribute description for this Present filter.
   *
   * @param ad
   *          the attribute description for this Present filter.
   * @returna new Present search filter with the provided information.
   *
   * @throws LDAPException an LDAPException is thrown if the ASN.1 element
   *                       provided by the attribute description cannot be
   *                       decoded as a raw search filter.
   * @throws LDAPException
   *           an LDAPException is thrown if the ASN.1 element
   *           provided by the attribute description cannot be decoded
   *           as a raw search filter.
   */
  private static LDAPFilter createPresentFilter(AttributeDescription ad)
          throws LDAPException {
    return LDAPFilter.decode(
             new StringBuilder(ad.getName()).append("=*").toString());
      throws LDAPException
  {
    return LDAPFilter.decode(new StringBuilder(ad.getName()).append("=*")
        .toString());
  }
  /**
   * Returns a new Substring search filter with the provided information.
   * Returns a new Substring search filter with the provided
   * information.
   *
   * @param sf the substring filter for this Substring filter.
   *
   * @return a new Substring search filter with the provided information.
   * @param sf
   *          the substring filter for this Substring filter.
   * @return a new Substring search filter with the provided
   *         information.
   */
  private static LDAPFilter createSubstringFilter(SubstringFilter sf) {
  private static LDAPFilter createSubstringFilter(SubstringFilter sf)
  {
    List<String> anys = sf.getAny();
    ArrayList<ByteString> subAnyElements =
                                         new ArrayList<ByteString>(anys.size());
    ArrayList<ByteString> subAnyElements = new ArrayList<ByteString>(anys
        .size());
    for(String s : anys) {
      subAnyElements.add(new ASN1OctetString(s));
    for (String s : anys)
    {
      subAnyElements.add(ByteString.valueOf(s));
    }
    return LDAPFilter.createSubstringFilter(sf.getName(),
                                        new ASN1OctetString(sf.getInitial()),
                                        subAnyElements,
                                        new ASN1OctetString(sf.getFinal()));
    return LDAPFilter.createSubstringFilter(sf.getName(), ByteString.valueOf(sf
        .getInitial()), subAnyElements, ByteString.valueOf(sf.getFinal()));
  }
  /**
   * Returns a new LDAPFilter according to the tag name of the provided element
   * that can be "and", "or", "not", "equalityMatch", "substrings",
   * "greaterOrEqual", "lessOrEqual", "present", "approxMatch",
   * "extensibleMatch".
   * Returns a new LDAPFilter according to the tag name of the
   * provided element that can be "and", "or", "not", "equalityMatch",
   * "substrings", "greaterOrEqual", "lessOrEqual", "present",
   * "approxMatch", "extensibleMatch".
   *
   * @param xmlElement a JAXBElement that contains the name of the filter to
   * @param xmlElement
   *          a JAXBElement that contains the name of the filter to
   *                   create and the associated argument.
   *
   * @return a new LDAPFilter according to the tag name of the provided element.
   *
   * @throws LDAPException an LDAPException is thrown if the creation of the
   * @return a new LDAPFilter according to the tag name of the
   *         provided element.
   * @throws LDAPException
   *           an LDAPException is thrown if the creation of the
   *                       targeted filter fails.
   */
  private static LDAPFilter createFilter(JAXBElement<?> xmlElement)
          throws LDAPException {
      throws LDAPException
  {
    LDAPFilter result = null;
    String filterName = xmlElement.getName().getLocalPart();
    if ( "and".equals(filterName) ) {
    if ("and".equals(filterName))
    {
      // <xsd:element name="and" type="FilterSet"/>
      result = createANDFilter((FilterSet)xmlElement.getValue());
    }
    else if ( "or".equals(filterName) ) {
    else if ("or".equals(filterName))
    {
      // <xsd:element name="or" type="FilterSet"/>
      result = createORFilter((FilterSet)xmlElement.getValue());
    }
    else if ( "not".equals(filterName) ) {
    else if ("not".equals(filterName))
    {
      // <xsd:element name="not" type="Filter"/>
      result = createNOTFilter((Filter)xmlElement.getValue());
    }
    else if ( "equalityMatch".equals(filterName) ) {
      // <xsd:element name="equalityMatch" type="AttributeValueAssertion"/>
      result = createEqualityFilter((AttributeValueAssertion)
                                                         xmlElement.getValue());
    else if ("equalityMatch".equals(filterName))
    {
      // <xsd:element name="equalityMatch"
      // type="AttributeValueAssertion"/>
      result = createEqualityFilter((AttributeValueAssertion) xmlElement
          .getValue());
    }
    else if ( "substrings".equals(filterName) ) {
    else if ("substrings".equals(filterName))
    {
      // <xsd:element name="substrings" type="SubstringFilter"/>
      result = createSubstringFilter((SubstringFilter)xmlElement.getValue());
    }
    else if ( "greaterOrEqual".equals(filterName) ) {
      // <xsd:element name="greaterOrEqual" type="AttributeValueAssertion"/>
      result = createGreaterOrEqualFilter((AttributeValueAssertion)
                                                         xmlElement.getValue());
    else if ("greaterOrEqual".equals(filterName))
    {
      // <xsd:element name="greaterOrEqual"
      // type="AttributeValueAssertion"/>
      result = createGreaterOrEqualFilter((AttributeValueAssertion) xmlElement
          .getValue());
    }
    else if ( "lessOrEqual".equals(filterName) ) {
      // <xsd:element name="lessOrEqual" type="AttributeValueAssertion"/>
      result = createLessOrEqualFilter((AttributeValueAssertion)
                                                         xmlElement.getValue());
    else if ("lessOrEqual".equals(filterName))
    {
      // <xsd:element name="lessOrEqual"
      // type="AttributeValueAssertion"/>
      result = createLessOrEqualFilter((AttributeValueAssertion) xmlElement
          .getValue());
    }
    else if ( "present".equals(filterName) ) {
    else if ("present".equals(filterName))
    {
      // <xsd:element name="present" type="AttributeDescription"/>
      result = createPresentFilter((AttributeDescription)xmlElement.getValue());
      result =
        createPresentFilter((AttributeDescription) xmlElement.getValue());
    }
    else if ( "approxMatch".equals(filterName) ) {
      // <xsd:element name="approxMatch" type="AttributeValueAssertion"/>
      result = createApproximateFilter((AttributeValueAssertion)
                                                         xmlElement.getValue());
    else if ("approxMatch".equals(filterName))
    {
      // <xsd:element name="approxMatch"
      // type="AttributeValueAssertion"/>
      result = createApproximateFilter((AttributeValueAssertion) xmlElement
          .getValue());
    }
    else if ( "extensibleMatch".equals(filterName) ) {
      // <xsd:element name="extensibleMatch" type="MatchingRuleAssertion"/>
      result = createExtensibleFilter((MatchingRuleAssertion)
                                                         xmlElement.getValue());
    else if ("extensibleMatch".equals(filterName))
    {
      // <xsd:element name="extensibleMatch"
      // type="MatchingRuleAssertion"/>
      result = createExtensibleFilter((MatchingRuleAssertion) xmlElement
          .getValue());
    }
    return result;
  }
  /**
   * Returns a new LDAPFilter according to the filter assigned to the provided
   * filter.
   * Returns a new LDAPFilter according to the filter assigned to the
   * provided filter.
   *
   * @param filter a filter that contains the object filter to create.
   *
   * @return a new LDAPFilter according to the filter assigned to the provided
   *         filter.
   *
   * @throws LDAPException an LDAPException is thrown if the creation of the
   * @param filter
   *          a filter that contains the object filter to create.
   * @return a new LDAPFilter according to the filter assigned to the
   *         provided filter.
   * @throws LDAPException
   *           an LDAPException is thrown if the creation of the
   *                       targeted filter fails.
   */
  private static LDAPFilter createFilter(Filter filter)
          throws LDAPException {
  private static LDAPFilter createFilter(Filter filter) throws LDAPException
  {
    LDAPFilter result = null;
    if ( filter.getAnd() != null ) {
    if (filter.getAnd() != null)
    {
      result = createANDFilter(filter.getAnd());
    }
    else if ( filter.getApproxMatch() != null ) {
    else if (filter.getApproxMatch() != null)
    {
      result = createApproximateFilter(filter.getApproxMatch());
    }
    else if ( filter.getEqualityMatch() != null ) {
    else if (filter.getEqualityMatch() != null)
    {
      result = createEqualityFilter(filter.getEqualityMatch());
    }
    else if ( filter.getExtensibleMatch() != null ) {
    else if (filter.getExtensibleMatch() != null)
    {
      result = createExtensibleFilter(filter.getExtensibleMatch());
    }
    else if ( filter.getGreaterOrEqual() != null ) {
    else if (filter.getGreaterOrEqual() != null)
    {
      result = createGreaterOrEqualFilter(filter.getGreaterOrEqual());
    }
    else if ( filter.getLessOrEqual() != null ) {
    else if (filter.getLessOrEqual() != null)
    {
      result = createLessOrEqualFilter(filter.getLessOrEqual());
    }
    else if ( filter.getNot() != null ) {
    else if (filter.getNot() != null)
    {
      result = createNOTFilter(filter.getNot());
    }
    else if ( filter.getOr() != null ) {
    else if (filter.getOr() != null)
    {
      result = createORFilter(filter.getOr());
    }
    else if ( filter.getPresent() != null ) {
    else if (filter.getPresent() != null)
    {
      result = createPresentFilter(filter.getPresent());
    }
    else if ( filter.getSubstrings() != null ) {
    else if (filter.getSubstrings() != null)
    {
      result = createSubstringFilter(filter.getSubstrings());
    }
    return result;
  }
  /**
   * Perform the LDAP SEARCH operation and send the result back to the
   * client.
   *
   * @param  objFactory     The object factory for this operation.
   * @param  searchRequest  The search request for this operation.
   *
   * @param objFactory
   *          The object factory for this operation.
   * @param searchRequest
   *          The search request for this operation.
   * @return  The result of the add operation.
   *
   * @throws  IOException  If an I/O problem occurs.
   *
   * @throws  LDAPException  If an error occurs while interacting with an LDAP
   * @throws IOException
   *           If an I/O problem occurs.
   * @throws LDAPException
   *           If an error occurs while interacting with an LDAP
   *                         element.
   */
  public SearchResponse doSearch(ObjectFactory objFactory,
         SearchRequest searchRequest)
         throws IOException, LDAPException
      SearchRequest searchRequest) throws IOException, LDAPException
  {
    SearchResponse searchResponse = objFactory.createSearchResponse();
    searchResponse.setRequestID(searchRequest.getRequestID());
@@ -394,7 +479,8 @@
    if(scopeStr.equals("singlelevel") || scopeStr.equals("one"))
    {
      scope = SearchScope.SINGLE_LEVEL;
    } else if(scopeStr.equals("baseobject") || scopeStr.equals("base"))
    }
    else if (scopeStr.equals("baseobject") || scopeStr.equals("base"))
    {
      scope = SearchScope.BASE_OBJECT;
    }
@@ -411,16 +497,14 @@
      }
    }
    SearchRequestProtocolOp protocolOp = new SearchRequestProtocolOp(
        new ASN1OctetString(searchRequest.getDn()),
        scope, derefPolicy,
                (int) searchRequest.getSizeLimit(),
        (int) searchRequest.getTimeLimit(),
    SearchRequestProtocolOp protocolOp = new SearchRequestProtocolOp(ByteString
        .valueOf(searchRequest.getDn()), scope, derefPolicy,
        (int) searchRequest.getSizeLimit(), (int) searchRequest.getTimeLimit(),
        searchRequest.isTypesOnly(), filter, attributes);
    try
    {
      LDAPMessage msg = new LDAPMessage(DSMLServlet.nextMessageID(),
                                        protocolOp);
      LDAPMessage msg =
        new LDAPMessage(DSMLServlet.nextMessageID(), protocolOp);
      connection.getLDAPWriter().writeMessage(msg);
      byte opType;
@@ -428,15 +512,14 @@
      {
        int resultCode = 0;
        Message errorMessage = null;
        LDAPMessage responseMessage =
             connection.getLDAPReader().readMessage();
        LDAPMessage responseMessage = connection.getLDAPReader().readMessage();
        opType = responseMessage.getProtocolOpType();
        switch(opType)
        {
          case LDAPConstants.OP_TYPE_SEARCH_RESULT_ENTRY:
            SearchResultEntryProtocolOp searchEntryOp =
              responseMessage.getSearchResultEntryProtocolOp();
          SearchResultEntryProtocolOp searchEntryOp = responseMessage
              .getSearchResultEntryProtocolOp();
            SearchResultEntry entry = objFactory.createSearchResultEntry();
            java.util.List<DsmlAttr> attrList = entry.getAttr();
@@ -450,8 +533,8 @@
              dsmlAttr.setName(nm);
              List<String> dsmlAttrVal = dsmlAttr.getValue();
              ArrayList<ASN1OctetString> vals = attr.getValues();
              for(ASN1OctetString val : vals)
            ArrayList<ByteString> vals = attr.getValues();
            for (ByteString val : vals)
              {
                dsmlAttrVal.add(val.toString());
              }
@@ -463,21 +546,20 @@
            break;
          case LDAPConstants.OP_TYPE_SEARCH_RESULT_REFERENCE:
            SearchResultReferenceProtocolOp searchRefOp =
              responseMessage.getSearchResultReferenceProtocolOp();
            break;
          case LDAPConstants.OP_TYPE_SEARCH_RESULT_DONE:
            SearchResultDoneProtocolOp searchOp =
              responseMessage.getSearchResultDoneProtocolOp();
          SearchResultDoneProtocolOp searchOp = responseMessage
              .getSearchResultDoneProtocolOp();
            resultCode = searchOp.getResultCode();
            errorMessage = searchOp.getErrorMessage();
            LDAPResult result = objFactory.createLDAPResult();
            ResultCode code = objFactory.createResultCode();
            code.setCode(resultCode);
            result.setResultCode(code);
            result.setErrorMessage(
                    errorMessage != null ? errorMessage.toString() : null);
          result.setErrorMessage(errorMessage != null ? errorMessage.toString()
              : null);
            if(searchOp.getMatchedDN() != null)
            {
               result.setMatchedDN(searchOp.getMatchedDN().toString());
@@ -487,9 +569,11 @@
          default:
             throw new RuntimeException("Invalid protocol operation:" + opType);
         }
      } while(opType != LDAPConstants.OP_TYPE_SEARCH_RESULT_DONE);
      }
      while (opType != LDAPConstants.OP_TYPE_SEARCH_RESULT_DONE);
    } catch(ASN1Exception ae)
    }
    catch (ASN1Exception ae)
    {
      ae.printStackTrace();
      throw new IOException(ae.getMessage());
@@ -498,4 +582,3 @@
    return searchResponse;
  }
}
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/ModifyEntryTask.java
@@ -62,16 +62,7 @@
import org.opends.messages.AdminToolMessages;
import org.opends.messages.Message;
import org.opends.server.config.ConfigConstants;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.ByteString;
import org.opends.server.types.ByteStringFactory;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.OpenDsException;
import org.opends.server.types.RDN;
import org.opends.server.types.Schema;
import org.opends.server.types.*;
/**
 * The task that is called when we must modify an entry.
@@ -691,7 +682,7 @@
    Attribute attribute = new BasicAttribute(attrName);
    for (AttributeValue value : values)
    {
      attribute.add(value.getValue().value());
      attribute.add(value.getValue().toByteArray());
    }
    return attribute;
  }
@@ -709,17 +700,17 @@
    ByteString v;
    if (value instanceof String)
    {
      v = ByteStringFactory.create((String)value);
      v = ByteString.valueOf((String)value);
    }
    else if (value instanceof byte[])
    {
      v = ByteStringFactory.create((byte[])value);
      v = ByteString.wrap((byte[])value);
    }
    else
    {
      v = ByteStringFactory.create(String.valueOf(value));
      v = ByteString.valueOf(String.valueOf(value));
    }
    return new AttributeValue(attrType, v);
    return AttributeValues.create(attrType, v);
  }
  /**
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/NewEntryTask.java
@@ -224,7 +224,7 @@
        BasicAttribute a = new BasicAttribute(attrName);
        for (AttributeValue value : values)
        {
          a.add(value.getValueBytes());
          a.add(value.getValue().toByteArray());
        }
        attrs.put(a);
      }
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/Task.java
@@ -54,7 +54,6 @@
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.messages.Message;
import org.opends.server.types.ByteString;
import org.opends.server.types.ByteStringFactory;
import org.opends.server.types.DN;
import org.opends.server.types.Schema;
import org.opends.server.util.Base64;
@@ -473,8 +472,8 @@
          else
          {
            // Get the String value
            ByteString v = ByteStringFactory.create(bytes);
            return v.stringValue();
            ByteString v = ByteString.wrap(bytes);
            return v.toString();
          }
        }
      }
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/AbstractBrowseEntriesPanel.java
@@ -99,12 +99,7 @@
import org.opends.quicksetup.util.UIKeyStore;
import org.opends.quicksetup.util.Utils;
import org.opends.server.protocols.ldap.LDAPFilter;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.LDAPException;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.*;
/**
 * The abstract class used to refactor some code.  The classes that extend this
@@ -821,7 +816,7 @@
                attr.toString().toLowerCase());
          LDAPFilter ldapFilter =
            new LDAPFilter(SearchFilter.createEqualityFilter(
              attrType, new AttributeValue(attrType, s)));
              attrType, AttributeValues.create(attrType, s)));
          returnValue = ldapFilter.toString();
        }
      }
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/JavaPropertiesPanel.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.guitools.controlpanel.ui;
@@ -174,6 +174,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public Message getTitle()
  {
    return INFO_CTRL_PANEL_JAVA_PROPERTIES_TITLE.get();
@@ -182,6 +183,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public Component getPreferredFocusComponent()
  {
    return javaHome;
@@ -190,6 +192,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public boolean requiresScroll()
  {
    return false;
@@ -198,6 +201,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void setInfo(ControlPanelInfo info)
  {
    super.setInfo(info);
@@ -425,6 +429,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void toBeDisplayed(boolean visible)
  {
    if (visible && (firstDisplay || !updatedByUser()))
@@ -557,6 +562,7 @@
      /**
       * {@inheritDoc}
       */
      @Override
      public Void processBackgroundTask() throws Throwable
      {
        String propertiesFile = getPropertiesFile();
@@ -623,6 +629,7 @@
      /**
       * {@inheritDoc}
       */
      @Override
      public void backgroundTaskCompleted(Void returnValue,
          Throwable t)
      {
@@ -701,6 +708,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void okClicked()
  {
    editor.stopCellEditing();
@@ -748,6 +756,7 @@
          new BackgroundTask<Set<String>>()
        {
          private String jvm;
          @Override
          public Set<String> processBackgroundTask() throws Throwable
          {
            Set<String> notWorkingArgs = new HashSet<String>();
@@ -776,6 +785,7 @@
          /**
           * {@inheritDoc}
           */
          @Override
          public void backgroundTaskCompleted(Set<String> returnValue,
              Throwable t)
          {
@@ -949,6 +959,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode()
    {
      return hashCode;
@@ -957,6 +968,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public String toString()
    {
      return toString;
@@ -965,6 +977,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o)
    {
      boolean equals = o == this;
@@ -1055,6 +1068,7 @@
     * Updates the table model contents and sorts its contents depending on the
     * sort options set by the user.
     */
    @Override
    public void forceResort()
    {
      updateDataArray();
@@ -1090,6 +1104,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public String getColumnName(int col) {
      return COLUMN_NAMES[col];
    }
@@ -1110,6 +1125,7 @@
     * @return <CODE>true</CODE> if the sort is ascending and <CODE>false</CODE>
     * otherwise.
     */
    @Override
    public boolean isSortAscending()
    {
      return sortAscending;
@@ -1119,6 +1135,7 @@
     * Sets whether to sort ascending of descending.
     * @param sortAscending whether to sort ascending or descending.
     */
    @Override
    public void setSortAscending(boolean sortAscending)
    {
      this.sortAscending = sortAscending;
@@ -1128,6 +1145,7 @@
     * Returns the column index used to sort.
     * @return the column index used to sort.
     */
    @Override
    public int getSortColumn()
    {
      return sortColumn;
@@ -1137,6 +1155,7 @@
     * Sets the column index used to sort.
     * @param sortColumn column index used to sort..
     */
    @Override
    public void setSortColumn(int sortColumn)
    {
      this.sortColumn = sortColumn;
@@ -1145,6 +1164,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public boolean isCellEditable(int row, int col) {
      if (col == 0)
      {
@@ -1158,6 +1178,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public void setValueAt(Object value, int row, int col)
    {
      dataArray.get(row)[col] = (String)value;
@@ -1248,6 +1269,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public Type getType()
    {
      return Type.JAVA_SETTINGS_UPDATE;
@@ -1256,6 +1278,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public Set<String> getBackends()
    {
      return backendSet;
@@ -1264,6 +1287,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public Message getTaskDescription()
    {
      return INFO_CTRL_PANEL_UPDATE_JAVA_SETTINGS_TASK_DESCRIPTION.get();
@@ -1272,6 +1296,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public boolean canLaunch(Task taskToBeLaunched,
        Collection<Message> incompatibilityReasons)
    {
@@ -1300,6 +1325,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    protected String getCommandLinePath()
    {
      return null;
@@ -1308,6 +1334,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    protected ArrayList<String> getCommandLineArguments()
    {
      return new ArrayList<String>();
@@ -1316,6 +1343,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public void runTask()
    {
      state = State.RUNNING;
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewBaseDNPanel.java
@@ -1293,7 +1293,7 @@
          while (it.hasNext())
          {
            oc.add(it.next().getStringValue());
            oc.add(it.next().getValue().toString());
          }
          attrs.put(oc);
@@ -1306,7 +1306,7 @@
            it = odsAttr.iterator();
            while (it.hasNext())
            {
              attr.add(it.next().getStringValue());
              attr.add(it.next().getValue().toString());
            }
            attrs.put(attr);
@@ -1315,7 +1315,7 @@
              args.add("--index-name");
              AttributeValue value =
                odsAttr.iterator().next();
              args.add(value.getStringValue());
              args.add(value.getValue().toString());
            }
            else if (attrName.equalsIgnoreCase("ds-cfg-index-type"))
            {
@@ -1323,7 +1323,7 @@
              while (it.hasNext())
              {
                args.add("--set");
                args.add("index-type:"+it.next().getStringValue());
                args.add("index-type:"+it.next().getValue().toString());
              }
            }
          }
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewIndexPanel.java
@@ -635,7 +635,7 @@
          indexEntry.getObjectClassAttribute().iterator();
        while (it.hasNext())
        {
          oc.add(it.next().getStringValue());
          oc.add(it.next().getValue().toString());
        }
        attrs.put(oc);
@@ -647,7 +647,7 @@
          it = odsAttr.iterator();
          while (it.hasNext())
          {
            attr.add(it.next().getStringValue());
            attr.add(it.next().getValue().toString());
          }
          attrs.put(attr);
        }
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java
@@ -91,6 +91,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public Message getTitle()
  {
    return INFO_CTRL_PANEL_NEW_VLV_INDEX_TITLE.get();
@@ -99,6 +100,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public Component getPreferredFocusComponent()
  {
    return name;
@@ -129,6 +131,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void okClicked()
  {
    List<Message> errors = checkErrors(true);
@@ -211,6 +214,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public Type getType()
    {
      return Type.NEW_INDEX;
@@ -219,6 +223,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public Set<String> getBackends()
    {
      return backendSet;
@@ -227,6 +232,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public Message getTaskDescription()
    {
      return INFO_CTRL_PANEL_NEW_VLV_INDEX_TASK_DESCRIPTION.get(
@@ -236,6 +242,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public boolean canLaunch(Task taskToBeLaunched,
        Collection<Message> incompatibilityReasons)
    {
@@ -420,6 +427,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    protected String getCommandLinePath()
    {
      return null;
@@ -428,6 +436,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    protected ArrayList<String> getCommandLineArguments()
    {
      return new ArrayList<String>();
@@ -448,6 +457,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public void runTask()
    {
      state = State.RUNNING;
@@ -481,6 +491,7 @@
    /**
     * {@inheritDoc}
     */
    @Override
    public void postOperation()
    {
      if ((lastException == null) && (state == State.FINISHED_SUCCESSFULLY) &&
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/SimplifiedViewEntryPanel.java
@@ -90,15 +90,7 @@
import org.opends.messages.Message;
import org.opends.messages.MessageBuilder;
import org.opends.server.schema.SchemaConstants;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.OpenDsException;
import org.opends.server.types.RDN;
import org.opends.server.types.Schema;
import org.opends.server.types.*;
import org.opends.server.util.Base64;
import org.opends.server.util.LDIFReader;
import org.opends.server.util.ServerConstants;
@@ -1610,7 +1602,7 @@
          String attrName = rdn.getAttributeName(i);
          AttributeValue value = rdn.getAttributeValue(i);
          String sValue = value.getStringValue();
          String sValue = value.getValue().toString();
          Set<String> values = getDisplayedStringValues(attrName);
          if (!values.contains(sValue))
@@ -1632,7 +1624,8 @@
                AttributeType attr = rdn.getAttributeType(i);
                attributeTypes.add(attr);
                attributeNames.add(rdn.getAttributeName(i));
                attributeValues.add(new AttributeValue(attr, firstNonEmpty));
                attributeValues.add(AttributeValues.create(
                    attr, firstNonEmpty));
              }
            }
          }
@@ -1671,7 +1664,8 @@
                  {
                    attributeTypes.add(attr);
                    attributeNames.add(attrName);
                    attributeValues.add(new AttributeValue(attr, (String)o));
                    attributeValues.add(
                        AttributeValues.create(attr, (String)o));
                  }
                  break;
                }
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/TableViewEntryPanel.java
@@ -64,15 +64,7 @@
import org.opends.guitools.controlpanel.ui.renderer.LDAPEntryTableCellRenderer;
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.messages.Message;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.OpenDsException;
import org.opends.server.types.RDN;
import org.opends.server.types.Schema;
import org.opends.server.types.*;
import org.opends.server.util.LDIFReader;
import org.opends.server.util.ServerConstants;
@@ -314,7 +306,7 @@
          String attrName = rdn.getAttributeName(i);
          AttributeValue value = rdn.getAttributeValue(i);
          String sValue = value.getStringValue();
          String sValue = value.getValue().toString();
          Set<String> values = getDisplayedStringValues(attrName);
          if (!values.contains(sValue))
@@ -336,7 +328,8 @@
                AttributeType attr = rdn.getAttributeType(i);
                attributeTypes.add(attr);
                attributeNames.add(rdn.getAttributeName(i));
                attributeValues.add(new AttributeValue(attr, firstNonEmpty));
                attributeValues.add(AttributeValues.create(
                    attr, firstNonEmpty));
              }
            }
          }
@@ -375,7 +368,8 @@
                {
                  attributeTypes.add(attr);
                  attributeNames.add(attrName);
                  attributeValues.add(new AttributeValue(attr, (String)o));
                  attributeValues.add(AttributeValues.create(
                      attr, (String)o));
                }
                break;
              }
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/nodes/BasicNode.java
@@ -389,7 +389,7 @@
          }
          else
          {
            result = rdn.getAttributeValue(0).getStringValue();
            result = rdn.getAttributeValue(0).getValue().toString();
          }
        }
        else {
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/util/Utilities.java
@@ -104,13 +104,7 @@
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.LockFileManager;
import org.opends.server.schema.SchemaConstants;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DN;
import org.opends.server.types.OpenDsException;
import org.opends.server.types.RDN;
import org.opends.server.types.Schema;
import org.opends.server.types.SchemaFileElement;
import org.opends.server.types.*;
import org.opends.server.util.ServerConstants;
import org.opends.server.util.StaticUtils;
@@ -1255,7 +1249,8 @@
  public static String getRDNString(String attrName, String attrValue)
  {
    AttributeType attrType = DirectoryServer.getDefaultAttributeType(attrName);
    AttributeValue value = new AttributeValue(attrType, attrValue);
    AttributeValue value =
        AttributeValues.create(attrType, attrValue);
    RDN rdn = new RDN(attrType, attrName, value);
    return rdn.toString();
  }
opendj-sdk/opends/src/messages/messages/extension.properties
@@ -347,34 +347,6 @@
INFO_FILE_TRUSTMANAGER_UPDATED_PIN_109=The PIN to use to access the \
 file-based trust manager has been updated.  The new value will take effect \
 the next time the trust manager is accessed
SEVERE_ERR_NULL_SECURITY_PROVIDER_READ_ERROR_110=An unexpected error occurred \
 while attempting to read data from the client using the null connection \
 security provider:  %s
SEVERE_ERR_NULL_SECURITY_PROVIDER_WRITE_ERROR_111=An unexpected error \
 occurred while attempting to write data to the client using the null \
 connection security provider:  %s
SEVERE_ERR_TLS_SECURITY_PROVIDER_CANNOT_INITIALIZE_112=An error occurred \
 while attempting to initialize the SSL context for use in the TLS connection \
 security provider:  %s
SEVERE_ERR_TLS_SECURITY_PROVIDER_UNEXPECTED_UNWRAP_STATUS_113=An unexpected \
 status result was returned to the TLS connection security provider when \
 attempting to unwrap encrypted data read from the client:  %s
SEVERE_ERR_TLS_SECURITY_PROVIDER_READ_ERROR_114=An unexpected error occurred \
 while attempting to read data from the client using the TLS connection \
 security provider:  %s
SEVERE_ERR_TLS_SECURITY_PROVIDER_WRITE_NEEDS_UNWRAP_115=An attempt was made \
 to write data to a client through the TLS connection security provider, but \
 the SSL indicated that it was necessary to read data from the client in order \
 to perform the SSL negotiation, but no data was available for reading.  This \
 is an unexpected condition, and it is not possible to continue processing on \
 this client connection without the potential for blocking other client \
 connections, so connection will be closed
SEVERE_ERR_TLS_SECURITY_PROVIDER_UNEXPECTED_WRAP_STATUS_116=An unexpected \
 status result was returned to the TLS connection security provider when \
 attempting to wrap clear-text data for writing to the client:  %s
SEVERE_ERR_TLS_SECURITY_PROVIDER_WRITE_ERROR_117=An unexpected error occurred \
 while attempting to write data to the client using the TLS connection \
 security provider:  %s
MILD_ERR_SEDCM_NO_PEER_CERTIFICATE_118=Could not map the provided certificate \
 chain to a user entry because no peer certificate was available
MILD_ERR_SEDCM_PEER_CERT_NOT_X509_119=Could not map the provided certificate \
opendj-sdk/opends/src/messages/messages/jeb.properties
@@ -215,7 +215,7 @@
NOTICE_JEB_REFERRAL_RESULT_MESSAGE_112=A referral entry %s indicates that the \
 operation must be processed at a different server
INFO_JEB_IMPORT_ENVIRONMENT_CONFIG_119=Database environment properties: %s
SEVERE_ERR_JEB_INCOMPATIBLE_ENTRY_VERSION_126=Entry record with ID %s is not \
SEVERE_ERR_JEB_INCOMPATIBLE_ENTRY_VERSION_126=Entry record is not \
 compatible with this version of the backend database. Entry version: %x
NOTICE_JEB_LOOKTHROUGH_LIMIT_EXCEEDED_127=This search operation has checked the \
 maximum of %d entries for matches
opendj-sdk/opends/src/messages/messages/protocol.properties
@@ -47,118 +47,46 @@
#
# ORDINAL is an integer unique among other ordinals in this file
#
MILD_ERR_ASN1_NULL_ELEMENT_1=Cannot decode the provided byte array as an \
 ASN.1 element because the array was null
MILD_ERR_ASN1_SHORT_ELEMENT_2=Cannot decode the provided byte array as an \
 ASN.1 element because the length of the array (%d bytes) is less than the \
 minimum required for an ASN.1 element (2 bytes)
MILD_ERR_ASN1_INVALID_NUM_LENGTH_BYTES_3=Cannot decode the provided byte \
 array as an ASN.1 element because it contained a multi-byte length with an \
 invalid number of bytes (%d)
MILD_ERR_ASN1_TRUNCATED_LENGTH_4=Cannot decode the provided byte array as an \
 ASN.1 element because it contained a multi-byte length of %d bytes but the \
 array was too short to contain the entire length
MILD_ERR_ASN1_LENGTH_MISMATCH_5=Cannot decode the provided byte array as an \
 ASN.1 element because the decoded value length (%d bytes) does not equal the \
 number of bytes remaining in the provided array (%d)
MILD_ERR_ASN1_ELEMENT_SET_NULL_6=Cannot decode the provided byte array as a \
 set of ASN.1 elements because the array was null
MILD_ERR_ASN1_ELEMENT_SET_NO_LENGTH_7=Cannot decode the provided byte array \
 as a set of ASN.1 elements because the end of the array was reached after \
 having read the BER type but none of the value for an element
MILD_ERR_ASN1_ELEMENT_SET_INVALID_NUM_LENGTH_BYTES_8=Cannot decode the \
 provided byte array as a set of ASN.1 elements because it contained a \
 multi-byte length with an invalid number of bytes (%d)
MILD_ERR_ASN1_ELEMENT_SET_TRUNCATED_LENGTH_9=Cannot decode the provided byte \
 array as a set of ASN.1 elements because it contained a multi-byte length of \
 %d bytes but the array was too short to contain the entire length
MILD_ERR_ASN1_ELEMENT_SET_TRUNCATED_VALUE_10=Cannot decode the provided byte \
 array as a set of ASN.1 elements because the decoded length of an element \
 (%d) is more than the number of bytes remaining (%d)
MILD_ERR_ASN1_BOOLEAN_SET_VALUE_NULL_11=Cannot decode the provided byte array \
 as the value of an ASN.1 Boolean element because the array was null
MILD_ERR_ASN1_BOOLEAN_SET_VALUE_INVALID_LENGTH_12=Cannot decode the provided \
 byte array as the value of an ASN.1 Boolean element because the array did not \
 have a length of exactly one byte (provided length was %d)
MILD_ERR_ASN1_BOOLEAN_DECODE_ELEMENT_NULL_13=Cannot decode the provided ASN.1 \
 element as a Boolean element because the provided element was null
MILD_ERR_ASN1_BOOLEAN_DECODE_ELEMENT_INVALID_LENGTH_14=Cannot decode the \
 provided ASN.1 element as a Boolean element because the length of the element \
 value was not exactly one byte (actual length was %d)
MILD_ERR_ASN1_BOOLEAN_DECODE_ARRAY_NULL_15=Cannot decode the provided byte \
 array as an ASN.1 Boolean element because the array was null
MILD_ERR_ASN1_BOOLEAN_SHORT_ELEMENT_16=Cannot decode the provided byte array \
 as an ASN.1 Boolean element because the length of the array (%d bytes) is \
 less than the minimum required for a Boolean element (3 bytes)
MILD_ERR_ASN1_BOOLEAN_DECODE_ARRAY_INVALID_LENGTH_17=Cannot decode the \
 provided byte array as an ASN.1 Boolean element because the decoded value \
 length was not exactly one byte (decoded length was %d)
MILD_ERR_ASN1_NULL_SET_VALUE_INVALID_LENGTH_18=Cannot decode the provided \
 byte array as the value of an ASN.1 null element because the array did not \
 have a length of exactly zero byte (provided length was %d)
MILD_ERR_ASN1_NULL_DECODE_ELEMENT_NULL_19=Cannot decode the provided ASN.1 \
 element as a null element because the provided element was null
MILD_ERR_ASN1_NULL_DECODE_ELEMENT_INVALID_LENGTH_20=Cannot decode the \
 provided ASN.1 element as a null element because the length of the element \
 value was not exactly zero bytes (actual length was %d)
MILD_ERR_ASN1_NULL_DECODE_ARRAY_NULL_21=Cannot decode the provided byte array \
 as an ASN.1 null element because the array was null
MILD_ERR_ASN1_NULL_DECODE_ARRAY_INVALID_LENGTH_22=Cannot decode the provided \
 byte array as an ASN.1 null element because the decoded value length was not \
 exactly zero bytes (decoded length was %d)
MILD_ERR_ASN1_OCTET_STRING_DECODE_ELEMENT_NULL_23=Cannot decode the provided \
 ASN.1 element as an octet string element because the provided element was \
 null
MILD_ERR_ASN1_OCTET_STRING_DECODE_ARRAY_NULL_24=Cannot decode the provided \
 byte array as an ASN.1 octet string element because the array was null
MILD_ERR_ASN1_INTEGER_SET_VALUE_NULL_25=Cannot decode the provided byte array \
 as the value of an ASN.1 integer element because the array was null
MILD_ERR_ASN1_INTEGER_SET_VALUE_INVALID_LENGTH_26=Cannot decode the provided \
 byte array as the value of an ASN.1 integer element because the array did not \
 have a length between 1 and 4 bytes (provided length was %d)
MILD_ERR_ASN1_INTEGER_DECODE_ELEMENT_NULL_27=Cannot decode the provided ASN.1 \
 element as an integer element because the provided element was null
MILD_ERR_ASN1_INTEGER_DECODE_ELEMENT_INVALID_LENGTH_28=Cannot decode the \
 provided ASN.1 element as an integer element because the length of the \
MILD_ERR_ASN1_TRUCATED_TYPE_BYTE_1=Cannot decode the ASN.1 element because an \
 unexpected end of file was reached while reading the type byte
MILD_ERR_ASN1_TRUNCATED_LENGTH_BYTE_2=Cannot decode the ASN.1 element because \
 an unexpected end of file was reached while reading the first length byte
MILD_ERR_ASN1_INVALID_NUM_LENGTH_BYTES_3=Cannot decode the ASN.1 element \
 because it contained a multi-byte length with an invalid number of bytes (%d)
MILD_ERR_ASN1_TRUNCATED_LENGTH_BYTES_4=Cannot decode the ASN.1 element because \
 an unexpected end of file was reached while reading a multi-byte length of \
 %d bytes
MILD_ERR_ASN1_BOOLEAN_TRUNCATED_VALUE_5=Cannot decode the ASN.1 boolean \
 element of because an unexpected end of file was reached while reading value \
 bytes (%d)
MILD_ERR_ASN1_BOOLEAN_INVALID_LENGTH_6=Cannot decode the ASN.1 \
 boolean element because the decoded value length was not exactly one byte \
 (decoded length was %d)
MILD_ERR_ASN1_NULL_TRUNCATED_VALUE_7=Cannot decode the ASN.1 null \
 element of because an unexpected end of file was reached while reading value \
 bytes (%d)
MILD_ERR_ASN1_NULL_INVALID_LENGTH_8=Cannot decode the ASN.1 null element \
 because the decoded value length was not exactly zero bytes \
 (decoded length was %d)
MILD_ERR_ASN1_OCTET_STRING_TRUNCATED_VALUE_9=Cannot decode the ASN.1 octet \
 string element of because an unexpected end of file was reached while reading \
 value bytes (%d)
MILD_ERR_ASN1_INTEGER_TRUNCATED_VALUE_10=Cannot decode the ASN.1 integer \
 element of because an unexpected end of file was reached while reading \
 value bytes (%d)
MILD_ERR_ASN1_INTEGER_INVALID_LENGTH_11=Cannot decode the \
 provided ASN.1 integer element because the length of the \
 element value was not between one and four bytes (actual length was %d)
MILD_ERR_ASN1_INTEGER_DECODE_ARRAY_NULL_29=Cannot decode the provided byte \
 array as an ASN.1 integer element because the array was null
MILD_ERR_ASN1_INTEGER_SHORT_ELEMENT_30=Cannot decode the provided byte array \
 as an ASN.1 integer element because the length of the array (%d bytes) is \
 less than the minimum required for an integer element (3 bytes)
MILD_ERR_ASN1_INTEGER_DECODE_ARRAY_INVALID_LENGTH_31=Cannot decode the \
 provided byte array as an ASN.1 integer element because the decoded value \
 length was not between 1 and 4 bytes (decoded length was %d)
MILD_ERR_ASN1_ENUMERATED_SET_VALUE_NULL_32=Cannot decode the provided byte \
 array as the value of an ASN.1 enumerated element because the array was null
MILD_ERR_ASN1_ENUMERATED_SET_VALUE_INVALID_LENGTH_33=Cannot decode the \
 provided byte array as the value of an ASN.1 enumerated element because the \
 array did not have a length between 1 and 4 bytes (provided length was %d)
MILD_ERR_ASN1_ENUMERATED_DECODE_ELEMENT_NULL_34=Cannot decode the provided \
 ASN.1 element as an enumerated element because the provided element was null
MILD_ERR_ASN1_ENUMERATED_DECODE_ELEMENT_INVALID_LENGTH_35=Cannot decode the \
 provided ASN.1 element as an enumerated element because the length of the \
 element value was not between one and four bytes (actual length was %d)
MILD_ERR_ASN1_ENUMERATED_DECODE_ARRAY_NULL_36=Cannot decode the provided byte \
 array as an ASN.1 enumerated element because the array was null
MILD_ERR_ASN1_ENUMERATED_SHORT_ELEMENT_37=Cannot decode the provided byte \
 array as an ASN.1 enumerated element because the length of the array (%d \
 bytes) is less than the minimum required for an enumerated element (3 bytes)
MILD_ERR_ASN1_ENUMERATED_DECODE_ARRAY_INVALID_LENGTH_38=Cannot decode the \
 provided byte array as an ASN.1 enumerated element because the decoded value \
 length was not between 1 and 4 bytes (decoded length was %d)
MILD_ERR_ASN1_SEQUENCE_SET_VALUE_NULL_39=Cannot decode the provided byte \
 array as the value of an ASN.1 sequence element because the array was null
MILD_ERR_ASN1_SEQUENCE_DECODE_ELEMENT_NULL_40=Cannot decode the provided \
 ASN.1 element as a sequence element because the provided element was null
MILD_ERR_ASN1_SEQUENCE_DECODE_ARRAY_NULL_41=Cannot decode the provided byte \
 array as an ASN.1 sequence element because the array was null
MILD_ERR_ASN1_SET_SET_VALUE_NULL_42=Cannot decode the provided byte array as \
 the value of an ASN.1 set element because the array was null
MILD_ERR_ASN1_SET_DECODE_ELEMENT_NULL_43=Cannot decode the provided ASN.1 \
 element as a set element because the provided element was null
MILD_ERR_ASN1_SET_DECODE_ARRAY_NULL_44=Cannot decode the provided byte array \
 as an ASN.1 set element because the array was null
MILD_ERR_ASN1_SEQUENCE_READ_NOT_STARTED_12=Cannot decode the end of the ASN.1 \
 sequence or set because the start of the sequence was not read
MILD_ERR_ASN1_SEQUENCE_READ_NOT_ENDED_13=Cannot decode the end of the ASN.1 \
 sequence or set because %d bytes are not read from the sequence of %d bytes \
 in length
MILD_ERR_ASN1_SKIP_TRUNCATED_VALUE_14=Cannot skip the ASN.1 element of because \
 an unexpected end of file was reached while reading value bytes (%d)
MILD_ERR_ASN1_SEQUENCE_SET_TRUNCATED_VALUE_15=Cannot decode the ASN.1 sequence \
 or set element of because an unexpected end of file was reached while reading \
 value bytes (%d)
MILD_ERR_LDAP_MESSAGE_DECODE_NULL_45=Cannot decode the provided ASN.1 \
 sequence as an LDAP message because the sequence was null
MILD_ERR_LDAP_MESSAGE_DECODE_INVALID_ELEMENT_COUNT_46=Cannot decode the \
@@ -1465,4 +1393,13 @@
 Please check the configuration attributes
SEVERE_ERR_SNMP_CONNHANDLER_NO_VALID_TRAP_DESTINATIONS_1466=No valid trap \
 destinations has been found. No trap will be sent
SEVERE_ERR_ASN1_READ_ERROR_1500=An error occured while accessing the \
 underlying data source: %s
SEVERE_ERR_ASN1_EOF_ERROR_1501=An unexpected end of file reached while trying \
 to read %d bytes from the underlying data source
SEVERE_ERR_ASN1_INVALID_STATE_1502=Invalid reader state: %d
SEVERE_ERR_SUBTREE_DELETE_INVALID_CONTROL_VALUE_1503=Cannot decode the provided \
 subtree delete control because it contains a value
 SEVERE_ERR_CONNHANDLER_SSL_CANNOT_INITIALIZE_1504=An error occurred \
 while attempting to initialize the SSL context for use in the LDAP \
 Connection Handler:  %s
opendj-sdk/opends/src/messages/src/org/opends/messages/MessageBuilder.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 *      Copyright 2007-2009 Sun Microsystems, Inc.
 */
package org.opends.messages;
@@ -270,20 +270,21 @@
   * @return Message raw message representing builder content
   */
  public Message toMessage() {
    if(messages.isEmpty())
    {
      return Message.EMPTY;
    }
    StringBuffer fmtString = new StringBuffer();
    for (int i = 0; i < messages.size(); i++) {
      fmtString.append("%s");
    }
    if (messages.isEmpty()) {
      return Message.raw(fmtString, messages.toArray());
    } else {
      // Inherit the category and severity of the first message.
      MessageDescriptor md = messages.get(0).getDescriptor();
      return Message.raw(md.getCategory(), md.getSeverity(), fmtString,
          messages.toArray());
    }
  }
  /**
   * Returns the length of the string representation of this builder
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/installer/ui/SecurityOptionsDialog.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.installer.ui;
@@ -129,6 +129,7 @@
    addWindowListener(new WindowAdapter()
    {
      @Override
      public void windowClosing(WindowEvent e)
      {
        cancelClicked();
@@ -664,6 +665,7 @@
  {
    BackgroundTask worker = new BackgroundTask()
    {
      @Override
      public Object processBackgroundTask()
      {
        ArrayList<Message> errorMsgs = new ArrayList<Message>();
@@ -675,6 +677,7 @@
        return errorMsgs;
      }
      @Override
      public void backgroundTaskCompleted(Object returnValue,
          Throwable throwable)
      {
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/CertificateDialog.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2008-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.ui;
@@ -142,6 +142,7 @@
    addWindowListener(new WindowAdapter()
    {
      @Override
      public void windowClosing(WindowEvent e)
      {
        doNotAccept();
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/ui/UIFactory.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.quicksetup.ui;
@@ -1287,6 +1287,7 @@
      col.setHeaderRenderer(headerRenderer);
    }
    MouseAdapter listMouseListener = new MouseAdapter() {
      @Override
      public void mouseClicked(MouseEvent e) {
        TableColumnModel columnModel = table.getColumnModel();
        int viewColumn = columnModel.getColumnIndexAtX(e.getX());
@@ -1754,6 +1755,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public Component getTableCellRendererComponent(JTable table, Object value,
      boolean isSelected, boolean hasFocus, int row, int column) {
    setText((String)value);
@@ -1818,6 +1820,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void setText(String text)
  {
    // Scroll can be null in constructor
@@ -1841,6 +1844,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void scrollRectToVisible(Rectangle rect)
  {
    if (!ignoreScrollToVisible)
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/InProcessServerController.java
@@ -42,7 +42,6 @@
import org.opends.server.loggers.AccessLogger;
import org.opends.server.types.Modification;
import org.opends.server.types.ResultCode;
import org.opends.server.types.ByteStringFactory;
import org.opends.server.types.ByteString;
import org.opends.server.types.InitializationException;
import org.opends.server.types.Attribute;
@@ -60,7 +59,6 @@
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.core.ModifyOperation;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.AddOperation;
@@ -411,7 +409,7 @@
    InternalClientConnection cc =
            InternalClientConnection.getRootConnection();
    ByteString dnByteString =
            ByteStringFactory.create(
        ByteString.valueOf(
                    cre.getDN().toString());
    ResultCode rc;
    switch (cre.getChangeOperationType()) {
@@ -467,8 +465,8 @@
          // can ignore this add.
          boolean ignore = true;
          for (RawAttribute attr : rawAttrs) {
            ArrayList<ASN1OctetString> values = attr.getValues();
            for (ASN1OctetString value : values) {
            ArrayList<ByteString> values = attr.getValues();
            for (ByteString value : values) {
              CompareOperation compOp =
                cc.processCompare(dnByteString, attr.getAttributeType(), value);
              if (ResultCode.ASSERTION_FAILED.equals(compOp.getResultCode())) {
opendj-sdk/opends/src/server/org/opends/server/admin/ACIPropertyDefinition.java
@@ -30,8 +30,8 @@
import org.opends.server.authorization.dseecompat.Aci;
import org.opends.server.authorization.dseecompat.AciException;
import org.opends.server.types.DN;
import org.opends.server.types.ByteString;
import static org.opends.server.util.Validator.ensureNotNull;
import org.opends.server.protocols.asn1.ASN1OctetString;
import java.util.EnumSet;
@@ -116,7 +116,7 @@
    ensureNotNull(value);
    try {
      return Aci.decode(new ASN1OctetString(value), DN.NULL_DN);
      return Aci.decode(ByteString.valueOf(value), DN.NULL_DN);
    } catch (AciException e) {
      // TODO: it would be nice to throw the cause.
      throw new IllegalPropertyValueStringException(this, value);
opendj-sdk/opends/src/server/org/opends/server/admin/AdministrationConnector.java
@@ -73,11 +73,12 @@
/**
 * This class is a wrapper on top of LDAPConnectionHandler to manage
 * the administration connector, which is an LDAPConnectionHandler with specific
 * (limited) configuration properties.
 * the administration connector, which is an LDAPConnectionHandler
 * with specific (limited) configuration properties.
 */
public final class AdministrationConnector
  implements ConfigurationChangeListener<AdministrationConnectorCfg> {
public final class AdministrationConnector implements
    ConfigurationChangeListener<AdministrationConnectorCfg>
{
  /**
   * Default Administration Connector port.
@@ -94,39 +95,63 @@
  // The tracer object for the debug logger.
  private static final DebugTracer TRACER = getTracer();
  private LDAPConnectionHandler adminConnectionHandler;
  private AdministrationConnectorCfg config;  //
  // Predefined values for Administration Connector configuration
  //
  private static final String ADMIN_CLASS_NAME =
    "org.opends.server.protocols.ldap.LDAPConnectionHandler";
  private static final boolean ADMIN_ALLOW_LDAP_V2 = true;
  private static final boolean ADMIN_ALLOW_START_TLS = false;
  private static final SortedSet<AddressMask> ADMIN_ALLOWED_CLIENT =
    new TreeSet<AddressMask>();
  private static final SortedSet<AddressMask> ADMIN_DENIED_CLIENT =
    new TreeSet<AddressMask>();
  private static final boolean ADMIN_ENABLED = true;
  private static final boolean ADMIN_KEEP_STATS = true;
  private static final boolean ADMIN_USE_SSL = true;
  private static final int ADMIN_ACCEPT_BACKLOG = 128;
  private static final boolean ADMIN_ALLOW_TCP_REUSE_ADDRESS = true;
  private static final long ADMIN_MAX_BLOCKED_WRITE_TIME_LIMIT = 120000; // 2mn
  private static final int ADMIN_MAX_REQUEST_SIZE = 5000000; // 5 Mb
  private static final int ADMIN_NUM_REQUEST_HANDLERS = 1;
  private static final boolean ADMIN_SEND_REJECTION_NOTICE = true;
  private static final boolean ADMIN_USE_TCP_KEEP_ALIVE = true;
  private static final boolean ADMIN_USE_TCP_NO_DELAY = true;
  private static final SSLClientAuthPolicy ADMIN_SSL_CLIENT_AUTH_POLICY =
    SSLClientAuthPolicy.DISABLED;
  private static final SortedSet<String> ADMIN_SSL_CIPHER_SUITE =
    new TreeSet<String>();
  private static final SortedSet<String> ADMIN_SSL_PROTOCOL =
    new TreeSet<String>();
  /**
   * Initializes this administration connector provider based on the
   * information in the provided administration connector configuration.
   * information in the provided administration connector
   * configuration.
   *
   * @param configuration
   *          The connection handler configuration that contains the
@@ -141,8 +166,9 @@
   *           related to the server configuration.
   */
  public void initializeAdministrationConnector(
    AdministrationConnectorCfg configuration)
    throws ConfigException, InitializationException {
      AdministrationConnectorCfg configuration) throws ConfigException,
      InitializationException
  {
    this.config = configuration;
@@ -152,364 +178,495 @@
    createSelfSignedCertifIfNeeded();
    // Administration Connector uses the LDAP connection handler implementation
    adminConnectionHandler =
      new LDAPConnectionHandler(new SynchronousStrategy(), FRIENDLY_NAME);
    adminConnectionHandler.
      initializeConnectionHandler(ldapConnectionHandlerCfg);
    // Administration Connector uses the LDAP connection handler
    // implementation
    adminConnectionHandler = new LDAPConnectionHandler(
        new SynchronousStrategy(), FRIENDLY_NAME);
    adminConnectionHandler
        .initializeConnectionHandler(ldapConnectionHandlerCfg);
    adminConnectionHandler.setAdminConnectionHandler();
    // Register this as a change listener.
    config.addChangeListener(this);
  }
  /**
   * Create an instance of the administration connector.
   */
  public AdministrationConnector() {
  public AdministrationConnector()
  {
    // Do nothing.
  }
  /**
   * Retrieves the connection handler linked to this administration connector.
   * Retrieves the connection handler linked to this administration
   * connector.
   *
   * @return The connection handler linked to this administration connector.
   * @return The connection handler linked to this administration
   *         connector.
   */
  public LDAPConnectionHandler getConnectionHandler() {
  public LDAPConnectionHandler getConnectionHandler()
  {
    return adminConnectionHandler;
  }
  /**
   * {@inheritDoc}
   */
  public boolean isConfigurationChangeAcceptable(
    AdministrationConnectorCfg configuration,
    List<Message> unacceptableReasons) {
    LDAPConnectionHandlerCfg cfg =
      new FakeLDAPConnectionHandlerCfg(configuration);
    return adminConnectionHandler.isConfigurationAcceptable(
      cfg, unacceptableReasons);
      List<Message> unacceptableReasons)
  {
    LDAPConnectionHandlerCfg cfg = new FakeLDAPConnectionHandlerCfg(
        configuration);
    return adminConnectionHandler.isConfigurationAcceptable(cfg,
        unacceptableReasons);
  }
  /**
   * {@inheritDoc}
   */
  public ConfigChangeResult applyConfigurationChange(
    AdministrationConnectorCfg configuration) {
    return new ConfigChangeResult(
      ResultCode.SUCCESS, true, new ArrayList<Message>());
      AdministrationConnectorCfg configuration)
  {
    return new ConfigChangeResult(ResultCode.SUCCESS, true,
        new ArrayList<Message>());
  }
  /**
   * This private class implements a fake LDAP connection Handler configuration.
   * This allows to re-use the LDAPConnectionHandler as it is.
   *
   * This private class implements a fake LDAP connection Handler
   * configuration. This allows to re-use the LDAPConnectionHandler as
   * it is.
   */
  private static class FakeLDAPConnectionHandlerCfg
    implements LDAPConnectionHandlerCfg {
  private static class FakeLDAPConnectionHandlerCfg implements
      LDAPConnectionHandlerCfg
  {
    private final AdministrationConnectorCfg config;
    public FakeLDAPConnectionHandlerCfg(AdministrationConnectorCfg config) {
    public FakeLDAPConnectionHandlerCfg(AdministrationConnectorCfg config)
    {
      this.config = config;
    }
    /**
     * {@inheritDoc}
     */
    public Class<? extends LDAPConnectionHandlerCfg> configurationClass() {
    public Class<? extends LDAPConnectionHandlerCfg> configurationClass()
    {
      return LDAPConnectionHandlerCfg.class;
    }
    /**
     * {@inheritDoc}
     */
    public void addLDAPChangeListener(
      ConfigurationChangeListener<LDAPConnectionHandlerCfg> listener) {
        ConfigurationChangeListener<LDAPConnectionHandlerCfg> listener)
    {
      // do nothing. change listener already added.
    }
    /**
     * {@inheritDoc}
     */
    public void removeLDAPChangeListener(
      ConfigurationChangeListener<LDAPConnectionHandlerCfg> listener) {
        ConfigurationChangeListener<LDAPConnectionHandlerCfg> listener)
    {
      // do nothing. change listener already added.
    }
    /**
     * {@inheritDoc}
     */
    public int getAcceptBacklog() {
    public int getAcceptBacklog()
    {
      return ADMIN_ACCEPT_BACKLOG;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isAllowLDAPV2() {
    public boolean isAllowLDAPV2()
    {
      return ADMIN_ALLOW_LDAP_V2;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isAllowStartTLS() {
    public boolean isAllowStartTLS()
    {
      return ADMIN_ALLOW_START_TLS;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isAllowTCPReuseAddress() {
    public boolean isAllowTCPReuseAddress()
    {
      return ADMIN_ALLOW_TCP_REUSE_ADDRESS;
    }
    /**
     * {@inheritDoc}
     */
    public String getJavaClass() {
    public String getJavaClass()
    {
      return ADMIN_CLASS_NAME;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isKeepStats() {
    public boolean isKeepStats()
    {
      return ADMIN_KEEP_STATS;
    }
    /**
     * {@inheritDoc}
     */
    public String getKeyManagerProvider() {
    public String getKeyManagerProvider()
    {
      return config.getKeyManagerProvider();
    }
    /**
     * {@inheritDoc}
     */
    public DN getKeyManagerProviderDN() {
    public DN getKeyManagerProviderDN()
    {
      return config.getKeyManagerProviderDN();
    }
    /**
     * {@inheritDoc}
     */
    public SortedSet<InetAddress> getListenAddress() {
    public SortedSet<InetAddress> getListenAddress()
    {
      return config.getListenAddress();
    }
    /**
     * {@inheritDoc}
     */
    public int getListenPort() {
    public int getListenPort()
    {
      return config.getListenPort();
    }
    /**
     * {@inheritDoc}
     */
    public long getMaxBlockedWriteTimeLimit() {
    public long getMaxBlockedWriteTimeLimit()
    {
      return ADMIN_MAX_BLOCKED_WRITE_TIME_LIMIT;
    }
    /**
     * {@inheritDoc}
     */
    public long getMaxRequestSize() {
    public long getMaxRequestSize()
    {
      return ADMIN_MAX_REQUEST_SIZE;
    }
    /**
     * {@inheritDoc}
     */
    public int getNumRequestHandlers() {
    public int getNumRequestHandlers()
    {
      return ADMIN_NUM_REQUEST_HANDLERS;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isSendRejectionNotice() {
    public boolean isSendRejectionNotice()
    {
      return ADMIN_SEND_REJECTION_NOTICE;
    }
    /**
     * {@inheritDoc}
     */
    public String getSSLCertNickname() {
    public String getSSLCertNickname()
    {
      return config.getSSLCertNickname();
    }
    /**
     * {@inheritDoc}
     */
    public SortedSet<String> getSSLCipherSuite() {
    public SortedSet<String> getSSLCipherSuite()
    {
      return ADMIN_SSL_CIPHER_SUITE;
    }
    /**
     * {@inheritDoc}
     */
    public SSLClientAuthPolicy getSSLClientAuthPolicy() {
    public SSLClientAuthPolicy getSSLClientAuthPolicy()
    {
      return ADMIN_SSL_CLIENT_AUTH_POLICY;
    }
    /**
     * {@inheritDoc}
     */
    public SortedSet<String> getSSLProtocol() {
    public SortedSet<String> getSSLProtocol()
    {
      return ADMIN_SSL_PROTOCOL;
    }
    /**
     * {@inheritDoc}
     */
    public String getTrustManagerProvider() {
    public String getTrustManagerProvider()
    {
      return config.getTrustManagerProvider();
    }
    /**
     * {@inheritDoc}
     */
    public DN getTrustManagerProviderDN() {
    public DN getTrustManagerProviderDN()
    {
      return config.getTrustManagerProviderDN();
    }
    /**
     * {@inheritDoc}
     */
    public boolean isUseSSL() {
    public boolean isUseSSL()
    {
      return ADMIN_USE_SSL;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isUseTCPKeepAlive() {
      return ADMIN_USE_TCP_KEEP_ALIVE;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isUseTCPNoDelay() {
    public boolean isUseTCPKeepAlive()
    {
      return ADMIN_USE_TCP_KEEP_ALIVE;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isUseTCPNoDelay()
    {
      return ADMIN_USE_TCP_NO_DELAY;
    }
    /**
     * {@inheritDoc}
     */
    public void addChangeListener(
      ConfigurationChangeListener<ConnectionHandlerCfg> listener) {
        ConfigurationChangeListener<ConnectionHandlerCfg> listener)
    {
      // do nothing. change listener already added.
    }
    /**
     * {@inheritDoc}
     */
    public void removeChangeListener(
      ConfigurationChangeListener<ConnectionHandlerCfg> listener) {
        ConfigurationChangeListener<ConnectionHandlerCfg> listener)
    {
      // do nothing. change listener already added.
    }
    /**
     * {@inheritDoc}
     */
    public SortedSet<AddressMask> getAllowedClient() {
    public SortedSet<AddressMask> getAllowedClient()
    {
      return ADMIN_ALLOWED_CLIENT;
    }
    /**
     * {@inheritDoc}
     */
    public SortedSet<AddressMask> getDeniedClient() {
    public SortedSet<AddressMask> getDeniedClient()
    {
      return ADMIN_DENIED_CLIENT;
    }
    /**
     * {@inheritDoc}
     */
    public boolean isEnabled() {
      return ADMIN_ENABLED;
    }
    /**
     * {@inheritDoc}
     */
    public DN dn() {
    public boolean isEnabled()
    {
      return ADMIN_ENABLED;
    }
    /**
     * {@inheritDoc}
     */
    public DN dn()
    {
      return config.dn();
    }
  }
  /**
   * Creates a self-signed JKS certificate if needed.
   */
  private void createSelfSignedCertifIfNeeded()
    throws InitializationException {
  private void createSelfSignedCertifIfNeeded() throws InitializationException
  {
    try {
    try
    {
      // Check if certificate generation is needed
      String certAlias = config.getSSLCertNickname();
      KeyManagerProviderCfg keyMgrConfig =
        getAdminConnectorKeyManagerConfig(config.getKeyManagerProvider());
      TrustManagerProviderCfg trustMgrConfig =
        getAdminConnectorTrustManagerConfig(config.getTrustManagerProvider());
      if (!(keyMgrConfig instanceof FileBasedKeyManagerProviderCfg) ||
        !(trustMgrConfig instanceof FileBasedTrustManagerProviderCfg)) {
      if (!(keyMgrConfig instanceof FileBasedKeyManagerProviderCfg)
          || !(trustMgrConfig instanceof FileBasedTrustManagerProviderCfg))
      {
        // The default config has been changed, nothing to do
        return;
      }
      FileBasedKeyManagerProviderCfg fbKeyManagerConfig =
        (FileBasedKeyManagerProviderCfg) keyMgrConfig;
      String keystorePath =
        getFullPath(fbKeyManagerConfig.getKeyStoreFile());
      String keystorePath = getFullPath(fbKeyManagerConfig.getKeyStoreFile());
      FileBasedTrustManagerProviderCfg fbTrustManagerConfig =
        (FileBasedTrustManagerProviderCfg) trustMgrConfig;
      String truststorePath =
        getFullPath(fbTrustManagerConfig.getTrustStoreFile());
      String truststorePath = getFullPath(fbTrustManagerConfig
          .getTrustStoreFile());
      String pinFilePath = getFullPath(fbKeyManagerConfig.getKeyStorePinFile());
      // Check that either we do not have any file,
      // or we have the 3 required files (keystore, truststore, pin file)
      // or we have the 3 required files (keystore, truststore, pin
      // file)
      boolean keystore = false;
      boolean truststore = false;
      boolean pinFile = false;
      int nbFiles = 0;
      if (new File(keystorePath).exists()) {
      if (new File(keystorePath).exists())
      {
        keystore = true;
        nbFiles++;
      }
      if (new File(truststorePath).exists()) {
      if (new File(truststorePath).exists())
      {
        truststore = true;
        nbFiles++;
      }
      if (new File(pinFilePath).exists()) {
      if (new File(pinFilePath).exists())
      {
        pinFile = true;
        nbFiles++;
      }
      if (nbFiles == 3) {
      if (nbFiles == 3)
      {
        // nothing to do
        return;
      }
      if (nbFiles != 0) {
      if (nbFiles != 0)
      {
        // 1 or 2 files are missing : error
        String err = "";
        if (!keystore) {
        if (!keystore)
        {
          err += keystorePath + " ";
        }
        if (!truststore) {
        if (!truststore)
        {
          err += truststorePath + " ";
        }
        if (!pinFile) {
        if (!pinFile)
        {
          err += pinFilePath + " ";
        }
        Message message =
          ERR_ADMIN_CERTIFICATE_GENERATION_MISSING_FILES.get(err);
        Message message = ERR_ADMIN_CERTIFICATE_GENERATION_MISSING_FILES
            .get(err);
        logError(message);
        throw new InitializationException(message);
      }
@@ -519,30 +676,28 @@
      // Generate a self-signed certificate
      CertificateManager certManager = new CertificateManager(
        getFullPath(fbKeyManagerConfig.getKeyStoreFile()),
        fbKeyManagerConfig.getKeyStoreType(),
        pwd);
      String subjectDN = "cn=" +
        Rdn.escapeValue(InetAddress.getLocalHost().getHostName()) +
        ",O=" + FRIENDLY_NAME + " Self-Signed Certificate";
      certManager.generateSelfSignedCertificate(
        certAlias, subjectDN, ADMIN_CERT_VALIDITY);
          getFullPath(fbKeyManagerConfig.getKeyStoreFile()), fbKeyManagerConfig
              .getKeyStoreType(), pwd);
      String subjectDN = "cn="
          + Rdn.escapeValue(InetAddress.getLocalHost().getHostName()) + ",O="
          + FRIENDLY_NAME + " Self-Signed Certificate";
      certManager.generateSelfSignedCertificate(certAlias, subjectDN,
          ADMIN_CERT_VALIDITY);
      // Export the certificate
      String tempCertPath = getFullPath("config" + File.separator +
        "admin-cert.txt");
      SetupUtils.exportCertificate(certManager, certAlias,
        tempCertPath);
      String tempCertPath = getFullPath("config" + File.separator
          + "admin-cert.txt");
      SetupUtils.exportCertificate(certManager, certAlias, tempCertPath);
      // Create a new trust store and import the server certificate into it
      CertificateManager trustManager = new CertificateManager(
        truststorePath,
        CertificateManager.KEY_STORE_TYPE_JKS,
        pwd);
      // Create a new trust store and import the server certificate
      // into it
      CertificateManager trustManager = new CertificateManager(truststorePath,
          CertificateManager.KEY_STORE_TYPE_JKS, pwd);
      trustManager.addCertificate(certAlias, new File(tempCertPath));
      // Generate a password file
      if (!new File(pinFilePath).exists()) {
      if (!new File(pinFilePath).exists())
      {
        FileWriter file = new FileWriter(pinFilePath);
        PrintWriter out = new PrintWriter(file);
        out.println(pwd);
@@ -552,16 +707,21 @@
      }
      // Change the password file permission if possible
      if (FilePermission.canSetPermissions()) {
        try {
      if (FilePermission.canSetPermissions())
      {
        try
        {
          if (!FilePermission.setPermissions(new File(pinFilePath),
            new FilePermission(0600))) {
              new FilePermission(0600)))
          {
            // Log a warning that the permissions were not set.
            Message message =
              WARN_ADMIN_SET_PERMISSIONS_FAILED.get(pinFilePath);
            Message message = WARN_ADMIN_SET_PERMISSIONS_FAILED
                .get(pinFilePath);
            ErrorLogger.logError(message);
          }
        } catch (DirectoryException e) {
        }
        catch (DirectoryException e)
        {
          // Log a warning that the permissions were not set.
          Message message = WARN_ADMIN_SET_PERMISSIONS_FAILED.get(pinFilePath);
          ErrorLogger.logError(message);
@@ -571,21 +731,32 @@
      // Delete the exported certificate
      File f = new File(tempCertPath);
      f.delete();
    } catch (ConfigException e) {
    }
    catch (ConfigException e)
    {
      handleCertifExceptions(e);
    } catch (KeyStoreException e) {
    }
    catch (KeyStoreException e)
    {
      handleCertifExceptions(e);
    } catch (IOException e) {
    }
    catch (IOException e)
    {
      handleCertifExceptions(e);
    } catch (CertificateEncodingException e) {
    }
    catch (CertificateEncodingException e)
    {
      handleCertifExceptions(e);
    }
  }
  private void handleCertifExceptions(Exception e) throws
    InitializationException {
    if (debugEnabled()) {
  private void handleCertifExceptions(Exception e)
      throws InitializationException
  {
    if (debugEnabled())
    {
      TRACER.debugCaught(DebugLogLevel.ERROR, e);
    }
    Message message = ERR_ADMIN_CERTIFICATE_GENERATION.get(e.getMessage());
@@ -593,23 +764,31 @@
    throw new InitializationException(message);
  }
  private KeyManagerProviderCfg getAdminConnectorKeyManagerConfig(String name)
    throws ConfigException {
      throws ConfigException
  {
    RootCfg root = ServerManagementContext.getInstance().getRootConfiguration();
    return root.getKeyManagerProvider(name);
  }
  private TrustManagerProviderCfg getAdminConnectorTrustManagerConfig(
    String name)
    throws ConfigException {
    RootCfg root =
      ServerManagementContext.getInstance().getRootConfiguration();
      String name) throws ConfigException
  {
    RootCfg root = ServerManagementContext.getInstance().getRootConfiguration();
    return root.getTrustManagerProvider(name);
  }
  private static String getFullPath(String path) {
  private static String getFullPath(String path)
  {
    File file = new File(path);
    if (!file.isAbsolute()) {
    if (!file.isAbsolute())
    {
      path = DirectoryServer.getInstanceRoot() + File.separator + path;
    }
opendj-sdk/opends/src/server/org/opends/server/admin/AdministrationDataSync.java
@@ -27,12 +27,12 @@
package org.opends.server.admin;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.ldap.LDAPFilter;
@@ -40,6 +40,7 @@
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Attributes;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.DereferencePolicy;
import org.opends.server.types.DirectoryException;
@@ -52,10 +53,11 @@
import org.opends.server.types.SearchScope;
/**
 * Check if information found in "cn=admin data" is coherent with
 * cn=config. If and inconsistancy is detected, we log a warning message
 * and update "cn=admin data"
 * cn=config. If and inconsistency is detected, we log a warning
 * message and update "cn=admin data"
 */
public final class AdministrationDataSync
{
@@ -66,25 +68,31 @@
  private InternalClientConnection internalConnection;
  /**
   * The attribute name used to store the port.
   * TODO Use the default one.
   * The attribute name used to store the port. TODO Use the default
   * one.
   */
  private static final String LDAP_PORT = "ds-cfg-listen-port";
  /**
   * Create an object that will syncrhonize configuration and the admin data.
   * Create an object that will syncrhonize configuration and the
   * admin data.
   *
   * @param internalConnection The root connection.
   * @param internalConnection
   *          The root connection.
   */
  public AdministrationDataSync(InternalClientConnection internalConnection)
  {
    this.internalConnection = internalConnection ;
  }
  /**
   * Check if information found in "cn=admin data" is coherent with
   * cn=config. If and inconsistancy is detected, we log a warning message
   * and update "cn=admin data"
   * cn=config. If and inconsistancy is detected, we log a warning
   * message and update "cn=admin data"
   */
  public void synchronize()
  {
@@ -92,9 +100,11 @@
    checkAdminConnector();
  }
  /**
   * Check if the admin connector is in sync. The desynchronization could
   * occurs after the upgrade from 1.0.
   * Check if the admin connector is in sync. The desynchronization
   * could occurs after the upgrade from 1.0.
   */
  private void checkAdminConnector()
  {
@@ -107,8 +117,8 @@
    }
    // Get the admin port
    String adminPort =
      getAttr("cn=Administration Connector,cn=config", LDAP_PORT);
    String adminPort = getAttr("cn=Administration Connector,cn=config",
        LDAP_PORT);
    if (adminPort == null)
    {
      // best effort.
@@ -118,14 +128,14 @@
    LinkedList<Modification> mods = new LinkedList<Modification>();
    // adminport
    String attName = "adminport";
    AttributeType attrType =
    DirectoryServer.getAttributeType(attName.toLowerCase());
    AttributeType attrType = DirectoryServer.getAttributeType(attName
        .toLowerCase());
    if (attrType == null)
    {
      attrType = DirectoryServer.getDefaultAttributeType(attName.toLowerCase());
    }
    mods.add(new Modification(ModificationType.REPLACE, Attributes
        .create(attrType, adminPort)));
    mods.add(new Modification(ModificationType.REPLACE, Attributes.create(
        attrType, adminPort)));
    // adminEnabled
    attName = "adminEnabled";
@@ -134,16 +144,18 @@
    {
      attrType = DirectoryServer.getDefaultAttributeType(attName.toLowerCase());
    }
    mods.add(new Modification(ModificationType.REPLACE, Attributes
        .create(attrType, "true")));
    mods.add(new Modification(ModificationType.REPLACE, Attributes.create(
        attrType, "true")));
    // Process modification
    internalConnection.processModify(serverEntryDN,mods);
  }
  /**
   * Look for the DN of the local register server.
   * Assumption: default Connection Handler naming is used.
   * Look for the DN of the local register server. Assumption: default
   * Connection Handler naming is used.
   *
   * @return The DN of the local register server or null.
   */
@@ -152,15 +164,15 @@
    DN returnDN = null;
    // Get the LDAP and LDAPS port
    String ldapPort =
      getAttr("cn=LDAP Connection Handler,cn=Connection Handlers,cn=config",
    String ldapPort = getAttr(
        "cn=LDAP Connection Handler,cn=Connection Handlers,cn=config",
          LDAP_PORT);
    String ldapsPort =
      getAttr("cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config",
    String ldapsPort = getAttr(
        "cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config",
          LDAP_PORT);
    boolean ldapsPortEnable = false;
    String val =
      getAttr("cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config",
    String val = getAttr(
        "cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config",
          "ds-cfg-enabled");
    if (val != null)
    {
@@ -211,8 +223,8 @@
            {
              // Check if one of the port match
              attrName = "ldapport";
              AttributeType portType =
                DirectoryServer.getAttributeType(attrName);
              AttributeType portType = DirectoryServer
                  .getAttributeType(attrName);
              if (portType == null)
              {
                portType = DirectoryServer.getDefaultAttributeType(attrName);
@@ -255,7 +267,8 @@
        }
      }
    } catch (DirectoryException e)
    }
    catch (DirectoryException e)
    {
      // never happens because the filter is always valid.
      return null;
@@ -263,17 +276,21 @@
    return returnDN;
  }
  /**
   * get an attribute from and entry.
   * @param DN the DN of the entry.
   * @param attrName the attribute name.
   * @return The Administration connector port.
   * Gets an attribute value from an entry.
   *
   * @param DN
   *          The DN of the entry.
   * @param attrName
   *          The attribute name.
   * @return The attribute value or {@code null} if the value could
   *         not be retrieved.
   */
  private String getAttr(String baseDN, String attrName)
  {
    String value = null  ;
    //
    // prepare the ldap search
    // Prepare the ldap search
    LDAPFilter filter;
    try
    {
@@ -287,14 +304,11 @@
      return null;
    }
    ASN1OctetString asn1BaseDn = new ASN1OctetString(baseDN);
    LinkedHashSet<String> attributes = new LinkedHashSet<String>(1);
    attributes.add(attrName);
    InternalSearchOperation search = internalConnection.processSearch(
        asn1BaseDn,
        SearchScope.BASE_OBJECT,
        DereferencePolicy.DEREF_ALWAYS, 0, 0, false,
        filter,attributes);
        ByteString.valueOf(baseDN), SearchScope.BASE_OBJECT,
        DereferencePolicy.DEREF_ALWAYS, 0, 0, false, filter, attributes);
    if ((search.getResultCode() != ResultCode.SUCCESS))
    {
@@ -305,6 +319,7 @@
    }
    SearchResultEntry adminConnectorEntry = null;
    /*
     * Read the port from the PORT attribute
     */
@@ -331,8 +346,7 @@
    }
    // Get the attribute value
    value = attrs.get(0).iterator().next().getStringValue();
    return value;
    return attrs.get(0).iterator().next().toString();
  }
}
opendj-sdk/opends/src/server/org/opends/server/admin/ManagedObjectPath.java
@@ -39,12 +39,7 @@
import org.opends.server.admin.std.meta.RootCfgDefn;
import org.opends.server.admin.std.server.RootCfg;
import org.opends.server.core.DirectoryServer;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.RDN;
import org.opends.server.types.*;
/**
@@ -162,7 +157,7 @@
      String type = profile.getRelationChildRDNType(r);
      AttributeType atype = DirectoryServer.getAttributeType(
          type.toLowerCase(), true);
      AttributeValue avalue = new AttributeValue(atype, name);
      AttributeValue avalue = AttributeValues.create(atype, name);
      dn = dn.concat(RDN.create(atype, avalue));
    }
@@ -182,7 +177,7 @@
      String type = profile.getRelationChildRDNType(r);
      AttributeType atype = DirectoryServer.getAttributeType(
          type.toLowerCase(), true);
      AttributeValue avalue = new AttributeValue(atype, d.getName());
      AttributeValue avalue = AttributeValues.create(atype, d.getName());
      dn = dn.concat(RDN.create(atype, avalue));
    }
opendj-sdk/opends/src/server/org/opends/server/admin/Reference.java
@@ -104,7 +104,7 @@
          + s + "\"");
    }
    String name = av.getStringValue();
    String name = av.getValue().toString();
    // Check that the DN was valid.
    DN expected = p.child(rd, name).toDN();
opendj-sdk/opends/src/server/org/opends/server/admin/server/ConfigAddListenerAdaptor.java
@@ -216,7 +216,7 @@
      MessageBuilder unacceptableReason) {
    DN dn = configEntry.getDN();
    AttributeValue av = dn.getRDN().getAttributeValue(0);
    String name = av.getStringValue().trim();
    String name = av.getValue().toString().trim();
    try {
      ManagedObjectPath<?, ? extends S> childPath;
opendj-sdk/opends/src/server/org/opends/server/admin/server/ConfigDeleteListenerAdaptor.java
@@ -217,7 +217,7 @@
      MessageBuilder unacceptableReason) {
    DN dn = configEntry.getDN();
    AttributeValue av = dn.getRDN().getAttributeValue(0);
    String name = av.getStringValue().trim();
    String name = av.getValue().toString().trim();
    try {
      ManagedObjectPath<?, ? extends S> childPath;
opendj-sdk/opends/src/server/org/opends/server/admin/server/ServerManagementContext.java
@@ -352,7 +352,7 @@
     */
    public static <PD> PD decode(PropertyDefinition<PD> pd,
        AttributeValue value) throws IllegalPropertyValueStringException {
      String s = value.getStringValue();
      String s = value.getValue().toString();
      return pd.castValue(pd.accept(new ValueDecoder(), s));
    }
@@ -664,7 +664,7 @@
    for (DN child : children) {
      // Assume that RDNs are single-valued and can be trimmed.
      AttributeValue av = child.getRDN().getAttributeValue(0);
      names.add(av.getStringValue().trim());
      names.add(av.getValue().toString().trim());
    }
    return names.toArray(new String[names.size()]);
@@ -716,7 +716,7 @@
    for (DN child : children) {
      // Assume that RDNs are single-valued and can be trimmed.
      AttributeValue av = child.getRDN().getAttributeValue(0);
      names.add(av.getStringValue().trim());
      names.add(av.toString().trim());
    }
    return names.toArray(new String[names.size()]);
opendj-sdk/opends/src/server/org/opends/server/api/AccessControlHandler.java
@@ -22,13 +22,14 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.api;
import org.opends.messages.Message;
import java.util.List;
import org.opends.server.admin.std.server.AccessControlHandlerCfg;
@@ -45,8 +46,9 @@
 * when making the determination, including any request controls that
 * might have been provided.
 *
 * @param  <T>  The type of access control configuration handled by
 *              this access control provider implementation.
 * @param <T>
 *          The type of access control configuration handled by this
 *          access control provider implementation.
 */
@org.opends.server.types.PublicAPI(
     stability=org.opends.server.types.StabilityLevel.VOLATILE,
@@ -60,18 +62,15 @@
   * Initializes the access control handler implementation based on
   * the information in the provided configuration entry.
   *
   * @param  configuration  The configuration object that contains the
   *                        information to use to initialize this
   *                        access control handler.
   *
   * @throws  ConfigException  If an unrecoverable problem arises in
   *                           the process of performing the
   *                           initialization.
   *
   * @throws  InitializationException  If a problem occurs during
   *                                   initialization that is not
   *                                   related to the server
   *                                   configuration.
   * @param configuration
   *          The configuration object that contains the information
   *          to use to initialize this access control handler.
   * @throws ConfigException
   *           If an unrecoverable problem arises in the process of
   *           performing the initialization.
   * @throws InitializationException
   *           If a problem occurs during initialization that is not
   *           related to the server configuration.
   */
  public abstract void initializeAccessControlHandler(T configuration)
@@ -84,22 +83,20 @@
   * this access control handler.  It should be possible to call this
   * method on an uninitialized access control handler instance in
   * order to determine whether the handler would be able to use the
   * provided configuration.
   * <BR><BR>
   * provided configuration. <BR>
   * <BR>
   * Note that implementations which use a subclass of the provided
   * configuration class will likely need to cast the configuration
   * to the appropriate subclass type.
   * configuration class will likely need to cast the configuration to
   * the appropriate subclass type.
   *
   * @param  configuration        The access control handler
   *                              configuration for which to make the
   *                              determination.
   * @param  unacceptableReasons  A list that may be used to hold the
   *                              reasons that the provided
   *                              configuration is not acceptable.
   *
   * @param configuration
   *          The access control handler configuration for which to
   *          make the determination.
   * @param unacceptableReasons
   *          A list that may be used to hold the reasons that the
   *          provided configuration is not acceptable.
   * @return  {@code true} if the provided configuration is acceptable
   *          for this access control handler, or {@code false} if
   *          not.
   *         for this access control handler, or {@code false} if not.
   */
  public boolean isConfigurationAcceptable(
                      AccessControlHandlerCfg configuration,
@@ -128,29 +125,27 @@
   * the access control configuration.  This method should not alter
   * the provided add operation in any way.
   *
   * @param  addOperation  The operation for which to make the
   *                       determination.
   *
   * @param addOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(LocalBackendAddOperation
                                         addOperation);
  public abstract boolean isAllowed(
      LocalBackendAddOperation addOperation);
  /**
   * Indicates whether the provided control is allowed based on
   * the access control configuration and the specified
   * operation. This method should not alter the provided
   * operation in any way.
   * Indicates whether the provided control is allowed based on the
   * access control configuration and the specified operation. This
   * method should not alter the provided operation in any way.
   *
   * @param  dn  A DN that can be used in the access determination.
   *
   * @param  op  The operation to use in the
   *                       determination.
   *
   * @param control The control for which to make the determination.
   *
   * @param dn
   *          A DN that can be used in the access determination.
   * @param op
   *          The operation to use in the determination.
   * @param control
   *          The control for which to make the determination.
   * @return  {@code true} if the control should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
@@ -164,94 +159,88 @@
   * the access control configuration.  This method should not alter
   * the provided bind operation in any way.
   *
   * @param  bindOperation  The operation for which to make the
   *                        determination.
   *
   * @param bindOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(LocalBackendBindOperation
                                         bindOperation);
  public abstract boolean isAllowed(
      LocalBackendBindOperation bindOperation);
  /**
   * Indicates whether the provided compare operation is allowed based
   * on the access control configuration.  This method should not
   * alter the provided compare operation in any way.
   * on the access control configuration. This method should not alter
   * the provided compare operation in any way.
   *
   * @param  compareOperation  The operation for which to make the
   *                           determination.
   *
   * @param compareOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(LocalBackendCompareOperation
      compareOperation);
  public abstract boolean isAllowed(
      LocalBackendCompareOperation compareOperation);
  /**
   * Indicates whether the provided delete operation is allowed based
   * on the access control configuration.  This method should not
   * alter the provided delete operation in any way.
   * on the access control configuration. This method should not alter
   * the provided delete operation in any way.
   *
   * @param  deleteOperation  The operation for which to make the
   *                          determination.
   *
   * @param deleteOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(LocalBackendDeleteOperation
                                         deleteOperation);
  public abstract boolean isAllowed(
      LocalBackendDeleteOperation deleteOperation);
  /**
   * Indicates whether the provided extended operation is allowed
   * based on the access control configuration.  This method should
   * not alter the provided extended operation in any way.
   * based on the access control configuration. This method should not
   * alter the provided extended operation in any way.
   *
   * @param  extendedOperation  The operation for which to make the
   *                            determination.
   *
   * @param extendedOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(ExtendedOperation
                                         extendedOperation);
  public abstract boolean isAllowed(
      ExtendedOperation extendedOperation);
  /**
   * Indicates whether the provided modify operation is allowed based
   * on the access control configuration.  This method should not
   * alter the provided modify operation in any way.
   * on the access control configuration. This method should not alter
   * the provided modify operation in any way.
   *
   * @param  modifyOperation  The operation for which to make the
   *                          determination.
   *
   * @param modifyOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(LocalBackendModifyOperation
                                         modifyOperation);
  public abstract boolean isAllowed(
      LocalBackendModifyOperation modifyOperation);
  /**
   * Indicates whether the provided modify DN operation is allowed
   * based on the access control configuration.  This method should
   * not alter the provided modify DN operation in any way.
   * based on the access control configuration. This method should not
   * alter the provided modify DN operation in any way.
   *
   * @param  modifyDNOperation  The operation for which to make the
   *                            determination.
   *
   * @param modifyDNOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(LocalBackendModifyDNOperation
                                         modifyDNOperation);
  public abstract boolean isAllowed(
      LocalBackendModifyDNOperation modifyDNOperation);
@@ -263,14 +252,13 @@
   * whether matching search result entries or search result
   * references may be allowed.
   *
   * @param  searchOperation  The operation for which to make the
   *                          determination.
   *
   * @param searchOperation
   *          The operation for which to make the determination.
   * @return  {@code true} if the operation should be allowed by the
   *          access control configuration, or {@code false} if not.
   */
  public abstract boolean isAllowed(LocalBackendSearchOperation
                                         searchOperation);
  public abstract boolean isAllowed(
      LocalBackendSearchOperation searchOperation);
@@ -279,11 +267,12 @@
   * the client. Implementations <b>must not under any
   * circumstances</b> modify the search entry in any way.
   *
   * @param  searchOperation  The search operation with which the
   *                          provided entry is associated.
   * @param  searchEntry      The search result entry for which to
   *                          make the determination.
   *
   * @param searchOperation
   *          The search operation with which the provided entry is
   *          associated.
   * @param searchEntry
   *          The search result entry for which to make the
   *          determination.
   * @return  {@code true} if the access control configuration allows
   *          the entry to be returned to the client, or {@code false}
   *          if not.
@@ -298,16 +287,16 @@
   * contains any attributes or values that the client is not
   * permitted to access.
   *
   * @param searchOperation The search operation with which the
   *                        provided entry is associated.
   * @param searchEntry     The search result entry to be filtered.
   *
   * @param searchOperation
   *          The search operation with which the provided entry is
   *          associated.
   * @param searchEntry
   *          The search result entry to be filtered.
   * @return  Returns the entry with filtered attributes and values
   *          removed.
   */
  public abstract SearchResultEntry
                       filterEntry(SearchOperation searchOperation,
                                   SearchResultEntry searchEntry);
  public abstract SearchResultEntry filterEntry(
      SearchOperation searchOperation, SearchResultEntry searchEntry);
@@ -315,38 +304,40 @@
   * Indicates whether the provided search result reference may be
   * sent to the client based on the access control configuration.
   *
   * @param  dn         A DN that can be used in the access
   * @param dn
   *          A DN that can be used in the access determination.
   * @param searchOperation
   *          The search operation with which the provided reference
   *          is associated.
   * @param searchReference
   *          The search result reference for which to make the
   *                    determination.
   *
   * @param  searchOperation  The search operation with which the
   *                          provided reference is associated.
   * @param  searchReference  The search result reference for which to
   *                          make the determination.
   *
   * @return  {@code true} if the access control configuration allows
   *          the reference to be returned to the client, or
   *          {@code false} if not.
   *         the reference to be returned to the client, or {@code
   *         false} if not.
   */
  public abstract boolean maySend(DN dn,
                             SearchOperation searchOperation,
                             SearchResultReference searchReference);
  /**
   * Indicates if the specified proxy user entry can proxy, or act on
   * the behalf of the specified proxied user entry. The operation
   * parameter is used in the evaluation.
   *
   * @param proxyUser The entry to use as the proxy user.
   * @param proxiedUser The entry to be proxied by the proxy user.
   * @param operation The operation to use in the evaluation.
   *
   * @param proxyUser
   *          The entry to use as the proxy user.
   * @param proxiedUser
   *          The entry to be proxied by the proxy user.
   * @param operation
   *          The operation to use in the evaluation.
   * @return  {@code true} if the access control configuration allows
   *          the proxy user to proxy the proxied user, or
   *          {@code false} if not.
   *         the proxy user to proxy the proxied user, or {@code
   *         false} if not.
   */
  public abstract boolean mayProxy(Entry proxyUser,
                                   Entry proxiedUser,
  public abstract boolean mayProxy(Entry proxyUser, Entry proxiedUser,
                                   Operation operation);
}
opendj-sdk/opends/src/server/org/opends/server/api/ApproximateMatchingRule.java
@@ -28,9 +28,8 @@
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.ByteSequence;
/**
@@ -58,8 +57,8 @@
   * @return  {@code true} if the provided values are approximately
   *          equal, or {@code false} if not.
   */
  public abstract boolean approximatelyMatch(ByteString value1,
                                             ByteString value2);
  public abstract boolean approximatelyMatch(ByteSequence value1,
                                             ByteSequence value2);
@@ -82,8 +81,8 @@
   *          if it does not match, or {@code UNDEFINED} if the result
   *          is undefined.
   */
  public ConditionResult valuesMatch(ByteString attributeValue,
                                     ByteString assertionValue)
  public ConditionResult valuesMatch(ByteSequence attributeValue,
                                     ByteSequence assertionValue)
  {
    if (approximatelyMatch(attributeValue, assertionValue))
    {
opendj-sdk/opends/src/server/org/opends/server/api/AttributeSyntax.java
@@ -33,8 +33,8 @@
import org.opends.server.admin.std.server.AttributeSyntaxCfg;
import org.opends.server.config.ConfigException;
import org.opends.server.types.ByteString;
import org.opends.server.types.InitializationException;
import org.opends.server.types.ByteSequence;
import org.opends.messages.MessageBuilder;
@@ -209,7 +209,7 @@
   * @return  {@code true} if the provided value is acceptable for use
   *          with this syntax, or {@code false} if not.
   */
  public abstract boolean valueIsAcceptable(ByteString value,
  public abstract boolean valueIsAcceptable(ByteSequence value,
                               MessageBuilder invalidReason);
opendj-sdk/opends/src/server/org/opends/server/api/ClientConnection.java
@@ -448,45 +448,6 @@
  public abstract boolean isSecure();
  /**
   * Retrieves the connection security provider for this client
   * connection.
   *
   * @return  The connection security provider for this client
   *          connection.
   */
  public abstract ConnectionSecurityProvider
                       getConnectionSecurityProvider();
  /**
   * Specifies the connection security provider for this client
   * connection.
   *
   * @param  securityProvider  The connection security provider to use
   *                           for communication on this client
   *                           connection.
   */
  public abstract void setConnectionSecurityProvider(
                            ConnectionSecurityProvider
                                 securityProvider);
  /**
   * Retrieves the human-readable name of the security mechanism that
   * is used to protect communication with this client.
   *
   * @return  The human-readable name of the security mechanism that
   *          is used to protect communication with this client, or
   *          {@code null} if no security is in place.
   */
  public abstract String getSecurityMechanism();
  /**
   * Retrieves a {@code Selector} that may be used to ensure that
   * write  operations complete in a timely manner, or terminate the
@@ -1333,7 +1294,7 @@
      {
        for (AttributeValue v : a)
        {
          String privName = toLowerCase(v.getStringValue());
          String privName = toLowerCase(v.getValue().toString());
          // If the name of the privilege is prefixed with a minus
          // sign, then we will take away that privilege from the
@@ -1836,5 +1797,12 @@
  {
    return 0L;
  }
  /**
   * Return the Security Strength Factor of a client connection.
   *
   * @return An integer representing the SSF value of a connection.
   */
  public abstract int getSSF();
}
opendj-sdk/opends/src/server/org/opends/server/api/CompressedSchema.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2009 Sun Microsystems, Inc.
 */
package org.opends.server.api;
@@ -30,10 +30,7 @@
import java.util.Map;
import org.opends.server.types.Attribute;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.*;
/**
@@ -52,27 +49,26 @@
   * the same set had been previously encoded, then the cached value
   * will be used.  Otherwise, a new value will be created.
   *
   * @param  entryBuffer   The buffer to encode the object classes to.
   * @param  objectClasses  The set of object classes for which to
   *                        retrieve the corresponding byte array
   *                        token.
   *
   * @return  A byte array containing the identifier assigned to the
   *          object class set.
   *
   * @throws  DirectoryException  If a problem occurs while attempting
   *                              to determine the appropriate
   *                              identifier.
   */
  public abstract byte[]
         encodeObjectClasses(Map<ObjectClass,String> objectClasses)
  public abstract void
         encodeObjectClasses(ByteStringBuilder entryBuffer,
                             Map<ObjectClass,String> objectClasses)
         throws DirectoryException;
  /**
   * Decodes an object class set from the provided byte array.
   * Decodes an object class set from the provided byte string.
   *
   * @param  encodedObjectClasses  The byte array containing the
   * @param  entryBuffer         The byte string containing the
   *                               object class set identifier.
   *
   * @return  The decoded object class set.
@@ -81,7 +77,7 @@
   *                              decoded as an object class set.
   */
  public abstract Map<ObjectClass,String>
         decodeObjectClasses(byte[] encodedObjectClasses)
         decodeObjectClasses(ByteSequenceReader entryBuffer)
         throws DirectoryException;
@@ -90,36 +86,32 @@
   * Encodes the information in the provided attribute to a byte
   * array.
   *
   * @param  entryBuffer The buffer to encode the attribute to.
   * @param  attribute  The attribute to be encoded.
   *
   * @return  An encoded representation of the provided attribute.
   *
   * @throws  DirectoryException  If a problem occurs while attempting
   *                              to determine the appropriate
   *                              identifier.
   */
  public abstract byte[] encodeAttribute(Attribute attribute)
  public abstract void encodeAttribute(ByteStringBuilder entryBuffer,
                                       Attribute attribute)
         throws DirectoryException;
  /**
   * Decodes the contents of the provided array as an attribute.
   * Decodes the contents of the provided array as an attribute at the
   * current position.
   *
   * @param  encodedEntry  The byte array containing the encoded
   * @param  entryBuffer   The byte array containing the encoded
   *                       entry.
   * @param  startPos      The position within the array of the first
   *                       byte for the attribute to decode.
   * @param  length        The number of bytes contained in the
   *                       encoded attribute.
   *
   * @return  The decoded attribute.
   *
   * @throws  DirectoryException  If the attribute could not be
   *                              decoded properly for some reason.
   */
  public abstract Attribute decodeAttribute(byte[] encodedEntry,
                                            int startPos, int length)
          throws DirectoryException;
  public abstract Attribute decodeAttribute(
      ByteSequenceReader entryBuffer) throws DirectoryException;
}
opendj-sdk/opends/src/server/org/opends/server/api/ConnectionSecurityProvider.java
File was deleted
opendj-sdk/opends/src/server/org/opends/server/api/DebugLogPublisher.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2008 Sun Microsystems, Inc.
 *      Copyright 2009 Sun Microsystems, Inc.
 */
package org.opends.server.api;
import org.opends.messages.Message;
@@ -595,7 +595,8 @@
   * @param  settings        The current trace settings in effect.
   * @param  signature       The method signature.
   * @param  sourceLocation  The location of the method in the source.
   * @param  element         The protocol element to dump.
   * @param  decodedForm     The string reprentation of the protocol
   *                         element.
   * @param  stackTrace      The stack trace at the time the protocol
   *                         element is logged or null if its not
   *                         available.
@@ -604,7 +605,7 @@
                                            TraceSettings settings,
                                            String signature,
                                            String sourceLocation,
                                            ProtocolElement element,
                                            String decodedForm,
                                      StackTraceElement[] stackTrace);
  /**
opendj-sdk/opends/src/server/org/opends/server/api/DirectoryThread.java
@@ -34,9 +34,6 @@
import org.opends.server.backends.task.Task;
import org.opends.server.core.DirectoryServer;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
/**
opendj-sdk/opends/src/server/org/opends/server/api/EqualityMatchingRule.java
@@ -28,13 +28,7 @@
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.DebugLogLevel;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.types.*;
@@ -51,11 +45,6 @@
public abstract class EqualityMatchingRule extends MatchingRule
{
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
  /**
   * Indicates whether the two provided normalized values are equal to
   * each other.
   *
@@ -67,10 +56,10 @@
   * @return  {@code true} if the provided values are equal, or
   *          {@code false} if not.
   */
  public abstract boolean areEqual(ByteString value1,
                                   ByteString value2);
  public boolean areEqual(ByteSequence value1, ByteSequence value2)
  {
    return value1.equals(value2);
  }
  /**
   * Indicates whether the provided attribute value should be
@@ -90,8 +79,9 @@
   *          a match for the provided assertion value, or
   *          {@code false} if not.
   */
  public ConditionResult valuesMatch(ByteString attributeValue,
                                     ByteString assertionValue)
  @Override
  public ConditionResult valuesMatch(ByteSequence attributeValue,
                                     ByteSequence assertionValue)
  {
    if (areEqual(attributeValue, assertionValue))
    {
@@ -122,33 +112,9 @@
   * @return  The hash code generated for the provided attribute
   *          value.
   */
  public int generateHashCode(AttributeValue attributeValue)
  public int generateHashCode(ByteSequence attributeValue)
  {
    try
    {
      return attributeValue.getNormalizedValue().hashCode();
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      try
      {
        return attributeValue.getValue().hashCode();
      }
      catch (Exception e2)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e2);
        }
        return 0;
      }
    }
    return attributeValue.hashCode();
  }
}
opendj-sdk/opends/src/server/org/opends/server/api/ExtensibleIndexer.java
@@ -26,14 +26,19 @@
 */
package org.opends.server.api;
import java.util.Map;
import java.util.Set;
import org.opends.server.types.AttributeValue;
/**
 * This class is  registered with a Backend  and it provides call-
 * backs for indexing attribute values. An index implementation will
 * use this interface to create the keys for an attribute value.
 * This class is registered with a Backend and it provides call- backs
 * for indexing attribute values. An index implementation will use
 * this interface to create the keys for an attribute value.
 */
@org.opends.server.types.PublicAPI(
     stability=org.opends.server.types.StabilityLevel.VOLATILE,
@@ -47,46 +52,57 @@
   * appended with the identifier returned from
   * {@link #getExtensibleIndexID()} will be used as the index
   * database name.
   *
   * @return  The name of the index for this indexer.
   */
  public abstract String getPreferredIndexName();
  /**
   * Returns an index identifier associated with this indexer. An
   * identifier should be selected based on the matching rule type.
   * A unique identifier will map to  a unique index database in
   * the backend implementation. If multiple matching rules
   * need to share the index database, the corresponding indexers
   * should always use the same identifier.
   * @return index ID A String containing the ID associated with
   *                          this indexer.
   * identifier should be selected based on the matching rule type. A
   * unique identifier will map to a unique index database in the
   * backend implementation. If multiple matching rules need to share
   * the index database, the corresponding indexers should always use
   * the same identifier.
   *
   * @return index ID A String containing the ID associated with this
   *         indexer.
   */
  public abstract String getExtensibleIndexID();
  /**
   * Generates the set of index keys for an attribute.
   * @param value The attribute value  for which  keys are required.
   * @param keys The set into which the generated keys will be
   *                          inserted.
   *
   * @param value
   *          The attribute value for which keys are required.
   * @param keys
   *          The set into which the generated keys will be inserted.
   */
  public abstract void getKeys(AttributeValue value,
                                                  Set<byte[]> keys);
  /**
   * Generates a map of index keys and a boolean flag indicating
   * whether the corresponding key will be inserted or deleted.
   * @param value The attribute for which keys are required.
   * @param modifiedKeys A map containing the keys and a boolean.
   *              Keys corresponding to the boolean value <code>true
   *              </code> should be inserted and <code>false</code>
   *              should be deleted.
   * @param insert <code>true</code> if generated keys should
   *            be inserted or <code>false</code> otherwise.
   *
   * @param value
   *          The attribute for which keys are required.
   * @param modifiedKeys
   *          A map containing the keys and a boolean. Keys
   *          corresponding to the boolean value <code>true
   *              </code>
   *          should be inserted and <code>false</code> should be
   *          deleted.
   * @param insert
   *          <code>true</code> if generated keys should be inserted
   *          or <code>false</code> otherwise.
   */
  public abstract void getKeys(AttributeValue value,
                                  Map<byte[], Boolean> modifiedKeys,
                                  Boolean insert);
      Map<byte[], Boolean> modifiedKeys, Boolean insert);
}
opendj-sdk/opends/src/server/org/opends/server/api/ExtensibleMatchingRule.java
@@ -26,12 +26,16 @@
 */
package org.opends.server.api;
import java.util.Collection;
import org.opends.server.types.ByteString;
import org.opends.server.types.ByteSequence;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.IndexConfig;
/**
 * This class defines the set of methods and structures that must be
 * implemented by a Directory Server module that implements an
@@ -47,30 +51,34 @@
  /**
  * Returns a collection of extensible indexers associated with this
  * matching rule.
  * @param config The index configuration to be used by this
  *                      matching rule.
  * @return ExtensibleIndexer associated with this matching rule.
   *
   * @param config
   *          The index configuration to be used by this matching
   *          rule.
   * @return The collection of extensible indexers associated with
   *         this matching rule.
  */
  public  abstract Collection<ExtensibleIndexer> getIndexers(
          IndexConfig config);
  /**
   * Queries the index using factory of type T and returns
   * a query of type T for the provided assertion value.
   * @param  <T>  The type of IndexQueryFactory.
   * @param  assertionValue  An assertion value which needs to be
   *                                               queried.
   * @param factory  An IndexQueryFactory which will be used for
   *                                creating  queries.
   * @return T  The generated index query.
   * @throws DirectoryException  If an  error occurs while generating
   *                the query.
   * Returns an index query appropriate for the provided attribute
   * value assertion.
   *
   * @param <T>
   *          The type of index query created by the {@code factory}.
   * @param assertionValue
   *          The attribute value assertion.
   * @param factory
   *          The index query factory which should be used to
   *          construct the index query.
   * @return The index query appropriate for the provided attribute
   *         value assertion.
   * @throws DirectoryException
   *           If an error occurs while generating the index query.
   */
  public  abstract <T> T createIndexQuery(
                   ByteString assertionValue,
                   IndexQueryFactory<T> factory)
                                          throws DirectoryException;
  public abstract <T> T createIndexQuery(ByteSequence assertionValue,
      IndexQueryFactory<T> factory) throws DirectoryException;
}
opendj-sdk/opends/src/server/org/opends/server/api/IndexQueryFactory.java
@@ -26,15 +26,22 @@
 */
package org.opends.server.api;
import java.util.Collection;
import org.opends.server.types.ByteSequence;
/**
 * This class acts as a factory for creating index queries. This
 * A factory for creating arbitrarily complex index queries. This
 * interface is implemented by the underlying backend implementation
 * and passed to extensible matching rules so that they can construct
 * arbitrarily complex index queries.
 *
 * @param  <T>  The type of Results  returned by the factory.
 * @param <T>
 *          The type of query created by this factory.
 */
@org.opends.server.types.PublicAPI(
     stability=org.opends.server.types.StabilityLevel.VOLATILE,
@@ -45,20 +52,24 @@
{
  /**
   * Returns a query requesting an index record matching the
   * provided key.
   * @param indexID An identifier of the index type.
   * @param key A byte array containing the key.
   * Returns a query requesting an index record matching the provided
   * key.
   *
   * @param indexID
   *          An identifier of the index type.
   * @param key
   *          A byte sequence containing the key.
   * @return A query requesting the index record matching the key.
   */
  T createExactMatchQuery(String indexID,byte[] key);
  T createExactMatchQuery(String indexID, ByteSequence key);
  /**
   * Returns a query requesting all  index records. A backend
   * implementation may choose to return all or no records as
   * part of the optimization.
   * implementation may choose to return all or no records as part of
   * the optimization.
   *
   * @return A query requesting all index records.
   */
  T createMatchAllQuery();
@@ -66,53 +77,59 @@
  /**
   * Rreturns a query requesting all index records in the specified
   * Returns a query requesting all index records in the specified
   * range.
   * @param indexID An identifier of the index type.
   * @param lower  The lower bound of the range.   A 0 length byte
   *                      array indicates  no lower bound and the
   *                      range will start from the smallest key.
   * @param upper The upper bound of the range. A 0 length byte array
   *                      indicates no upper bound and the range will
   *                      end at  the largest key.
   * @param lowerIncluded true if a key exactly matching the lower
   *                       bound is included in the range, false if
   *                       only keys strictly greater than the lower
   *                       bound are included.This value is ignored if
   *                       the lower bound is not specified.
   * @param upperIncluded true if a key exactly matching the upper
   *                      bound is included in the range, false if
   *                      only keys strictly less than the upper
   *                      bound are included. This value is ignored if
   *                      the upper bound is not specified.
   *
   * @param indexID
   *          An identifier of the index type.
   * @param lower
   *          The lower bound of the range. A 0 length byte array
   *          indicates no lower bound and the range will start from
   *          the smallest key.
   * @param upper
   *          The upper bound of the range. A 0 length byte array
   *          indicates no upper bound and the range will end at the
   *          largest key.
   * @param lowerIncluded
   *          true if a key exactly matching the lower bound is
   *          included in the range, false if only keys strictly
   *          greater than the lower bound are included.This value
   *          is ignored if the lower bound is not specified.
   * @param upperIncluded
   *          true if a key exactly matching the upper bound is
   *          included in the range, false if only keys strictly
   *          less than the upper bound are included. This value is
   *          ignored if the upper bound is not specified.
   * @return A query requesting all index records in the specified
   * range.
   */
  T createRangeMatchQuery(
                              String indexID,
                              byte[]  lower,
                              byte[] upper,
                              boolean lowerIncluded,
  T createRangeMatchQuery(String indexID, ByteSequence lower,
      ByteSequence upper, boolean lowerIncluded,
                              boolean upperIncluded);
  /**
   * Returns a query requesting  intersection from a Collection of
   * Returns a query which returns the intersection of a collection of
   * sub-queries.
   *@param  subquery  A Collection of sub-queries.
   *@return A query requesting intersection of  the records.
   *
   * @param subquery
   *          A collection of sub-queries.
   * @return A query which returns the intersection of a collection of
   *         sub-queries.
   */
  T createIntersectionQuery(Collection<T> subquery);
  /**
   * Returns a query requesting union from a Collection of
   * Returns a query which combines the results of a collection of
   * sub-queries.
   * @param  subquery  A Collection of sub-queries.
   * @return A query requesting union of the records.
   *
   * @param subquery
   *          A collection of sub-queries.
   * @return A query which combines the results of a collection of
   *         sub-queries.
   */
  T createUnionQuery(Collection<T> subquery);
}
opendj-sdk/opends/src/server/org/opends/server/api/MatchingRule.java
@@ -26,7 +26,11 @@
 */
package org.opends.server.api;
import java.util.Collection;
import org.opends.server.types.ByteSequence;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.DirectoryException;
@@ -78,15 +82,14 @@
   * which is best suite for efficiently performing matching
   * operations on that value.
   *
   * @param  value  The assertion value to be normalized.
   *
   * @param value
   *          The assertion value to be normalized.
   * @return  The normalized version of the provided value.
   *
   * @throws  DirectoryException  If the provided value is invalid
   *                              according to the associated
   *                              attribute syntax.
   * @throws DirectoryException
   *           If the provided value is invalid according to the
   *           associated attribute syntax.
   */
  public ByteString normalizeAssertionValue(ByteString value)
  public ByteString normalizeAssertionValue(ByteSequence value)
         throws DirectoryException
  {
    // Default implementation is to use attribute value normalization.
@@ -139,11 +142,11 @@
  /**
   * Indicates whether this matching rule is declared "OBSOLETE".
   * The default implementation will always return {@code false}.  If
   * that is not acceptable for a particular matching rule
   * implementation, then it should override this method and perform
   * the appropriate processing to return the correct value.
   * Indicates whether this matching rule is declared "OBSOLETE". The
   * default implementation will always return {@code false}. If that
   * is not acceptable for a particular matching rule implementation,
   * then it should override this method and perform the appropriate
   * processing to return the correct value.
   *
   * @return  {@code true} if this matching rule is declared
   *          "OBSOLETE", or {@code false} if not.
@@ -157,18 +160,17 @@
  /**
   * Retrieves the normalized form of the provided value, which is
   * best suite for efficiently performing matching operations on that
   * value.
   * best suite for efficiently performing matching operations on
   * that value.
   *
   * @param  value  The value to be normalized.
   *
   * @param value
   *          The value to be normalized.
   * @return  The normalized version of the provided value.
   *
   * @throws  DirectoryException  If the provided value is invalid
   *                              according to the associated
   *                              attribute syntax.
   * @throws DirectoryException
   *           If the provided value is invalid according to the
   *           associated attribute syntax.
   */
  public abstract ByteString normalizeValue(ByteString value)
  public abstract ByteString normalizeValue(ByteSequence value)
         throws DirectoryException;
@@ -180,21 +182,19 @@
   * should define more specific methods that are appropriate to the
   * matching rule type.
   *
   * @param  attributeValue  The attribute value in a form that has
   *                         been normalized according to this
   *                         matching rule.
   * @param  assertionValue  The assertion value in a form that has
   *                         been normalized according to this
   *                         matching rule.
   *
   * @param attributeValue
   *          The attribute value in a form that has been normalized
   *          according to this matching rule.
   * @param assertionValue
   *          The assertion value in a form that has been normalized
   *          according to this matching rule.
   * @return  {@code TRUE} if the attribute value should be considered
   *          a match for the provided assertion value, {@code FALSE}
   *          if it does not match, or {@code UNDEFINED} if the result
   *          is undefined.
   */
  public abstract ConditionResult
                       valuesMatch(ByteString attributeValue,
                                   ByteString assertionValue);
  public abstract ConditionResult valuesMatch(
      ByteSequence attributeValue, ByteSequence assertionValue);
@@ -204,6 +204,7 @@
   *
   * @return  The hash code for this matching rule.
   */
  @Override
  public final int hashCode()
  {
    int hashCode = 0;
@@ -225,11 +226,12 @@
   * rule.  The provided object will be considered equal to this
   * matching rule only if it is a matching rule with the same OID.
   *
   * @param  o  The object for which to make the determination.
   *
   * @param o
   *          The object for which to make the determination.
   * @return  {@code true} if the provided object is equal to this
   *          matching rule, or {@code false} if it is not.
   */
  @Override
  public final boolean equals(Object o)
  {
    if (o == null)
@@ -259,6 +261,7 @@
   * @return  A string representation of this matching rule in the
   *          format defined in RFC 2252.
   */
  @Override
  public final String toString()
  {
    StringBuilder buffer = new StringBuilder();
@@ -272,8 +275,8 @@
   * Appends a string representation of this matching rule in the
   * format defined in RFC 2252 to the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be
   *                 appended.
   * @param buffer
   *          The buffer to which the information should be appended.
   */
  public final void toString(StringBuilder buffer)
  {
@@ -302,4 +305,3 @@
    buffer.append(" )");
  }
}
opendj-sdk/opends/src/server/org/opends/server/api/OrderingMatchingRule.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.api;
@@ -31,9 +31,8 @@
import java.io.Serializable;
import java.util.Comparator;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.ByteSequence;
/**
@@ -76,8 +75,8 @@
   *          ascending order, or zero if there is no difference
   *          between the values with regard to ordering.
   */
  public abstract int compareValues(ByteString value1,
                                    ByteString value2);
  public abstract int compareValues(ByteSequence value1,
                                    ByteSequence value2);
@@ -103,8 +102,8 @@
   *          a match for the provided assertion value, or
   *          {@code false} if not.
   */
  public ConditionResult valuesMatch(ByteString attributeValue,
                                     ByteString assertionValue)
  public ConditionResult valuesMatch(ByteSequence attributeValue,
                                     ByteSequence assertionValue)
  {
    return ConditionResult.UNDEFINED;
  }
opendj-sdk/opends/src/server/org/opends/server/api/PasswordGenerator.java
@@ -33,11 +33,7 @@
import org.opends.server.admin.std.server.PasswordGeneratorCfg;
import org.opends.server.config.ConfigException;
import org.opends.server.types.ByteString;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.InitializationException;
import org.opends.server.types.*;
/**
opendj-sdk/opends/src/server/org/opends/server/api/PasswordStorageScheme.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.api;
import org.opends.messages.Message;
@@ -33,10 +33,7 @@
import org.opends.server.admin.std.server.PasswordStorageSchemeCfg;
import org.opends.server.config.ConfigException;
import org.opends.server.types.ByteString;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.InitializationException;
import org.opends.server.types.*;
/**
@@ -151,7 +148,7 @@
   * @throws  DirectoryException  If a problem occurs while
   *                              processing.
   */
  public abstract ByteString encodePassword(ByteString plaintext)
  public abstract ByteString encodePassword(ByteSequence plaintext)
         throws DirectoryException;
@@ -170,7 +167,7 @@
   *                              processing.
   */
  public abstract ByteString encodePasswordWithScheme(
                                  ByteString plaintext)
                                  ByteSequence plaintext)
         throws DirectoryException;
@@ -190,8 +187,8 @@
   *          the provided stored password, or {@code false} if not.
   */
  public abstract boolean passwordMatches(
                               ByteString plaintextPassword,
                               ByteString storedPassword);
                               ByteSequence plaintextPassword,
                               ByteSequence storedPassword);
@@ -242,8 +239,8 @@
   *                              support the authentication password
   *                              syntax.
   */
  public abstract ByteString encodeAuthPassword(ByteString plaintext)
         throws DirectoryException;
  public abstract ByteString encodeAuthPassword(
      ByteSequence plaintext) throws DirectoryException;
@@ -268,7 +265,7 @@
   *          password syntax.
   */
  public abstract boolean authPasswordMatches(
                               ByteString plaintextPassword,
                               ByteSequence plaintextPassword,
                               String authInfo, String authValue);
@@ -301,7 +298,7 @@
   *                              stored password.
   */
  public abstract ByteString getPlaintextValue(
                                  ByteString storedPassword)
                                  ByteSequence storedPassword)
         throws DirectoryException;
opendj-sdk/opends/src/server/org/opends/server/api/PasswordValidator.java
@@ -34,10 +34,7 @@
import org.opends.server.admin.std.server.PasswordValidatorCfg;
import org.opends.server.config.ConfigException;
import org.opends.server.types.ByteString;
import org.opends.server.types.Entry;
import org.opends.server.types.InitializationException;
import org.opends.server.types.Operation;
import org.opends.server.types.*;
import org.opends.messages.MessageBuilder;
opendj-sdk/opends/src/server/org/opends/server/api/SubstringMatchingRule.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.api;
@@ -30,10 +30,7 @@
import java.util.List;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.*;
/**
@@ -60,8 +57,8 @@
   *                              not acceptable according to the
   *                              associated syntax.
   */
  public abstract ByteString normalizeSubstring(ByteString substring)
         throws DirectoryException;
  public abstract ByteString normalizeSubstring(
      ByteSequence substring) throws DirectoryException;
@@ -86,11 +83,97 @@
   * @return  {@code true} if the provided value does match the given
   *          substring components, or {@code false} if not.
   */
  public abstract boolean valueMatchesSubstring(
                               ByteString value,
                               ByteString subInitial,
                               List<ByteString> subAnyElements,
                               ByteString subFinal);
  public boolean valueMatchesSubstring(ByteSequence value,
                                    ByteSequence subInitial,
                                    List<ByteSequence> subAnyElements,
                                    ByteSequence subFinal)
  {
    int valueLength = value.length();
    int pos = 0;
    if (subInitial != null)
    {
      int initialLength = subInitial.length();
      if (initialLength > valueLength)
      {
        return false;
      }
      for (; pos < initialLength; pos++)
      {
        if (subInitial.byteAt(pos) != value.byteAt(pos))
        {
          return false;
        }
      }
    }
    if ((subAnyElements != null) && (! subAnyElements.isEmpty()))
    {
      for (ByteSequence element : subAnyElements)
      {
        int anyLength = element.length();
        if(anyLength == 0)
            continue;
        int end = valueLength - anyLength;
        boolean match = false;
        for (; pos <= end; pos++)
        {
          if (element.byteAt(0) == value.byteAt(pos))
          {
            boolean subMatch = true;
            for (int i=1; i < anyLength; i++)
            {
              if (element.byteAt(i) != value.byteAt(pos+i))
              {
                subMatch = false;
                break;
              }
            }
            if (subMatch)
            {
              match = subMatch;
              break;
            }
          }
        }
        if (match)
        {
          pos += anyLength;
        }
        else
        {
          return false;
        }
      }
    }
    if (subFinal != null)
    {
      int finalLength = subFinal.length();
      if ((valueLength - finalLength) < pos)
      {
        return false;
      }
      pos = valueLength - finalLength;
      for (int i=0; i < finalLength; i++,pos++)
      {
        if (subFinal.byteAt(i) != value.byteAt(pos))
        {
          return false;
        }
      }
    }
    return true;
  }
@@ -116,8 +199,9 @@
   *          a match for the provided assertion value, or
   *          {@code false} if not.
   */
  public ConditionResult valuesMatch(ByteString attributeValue,
                                     ByteString assertionValue)
  @Override
  public ConditionResult valuesMatch(ByteSequence attributeValue,
                                     ByteSequence assertionValue)
  {
    return ConditionResult.UNDEFINED;
  }
opendj-sdk/opends/src/server/org/opends/server/api/VirtualAttributeProvider.java
@@ -37,13 +37,7 @@
import org.opends.server.admin.std.server.VirtualAttributeCfg;
import org.opends.server.config.ConfigException;
import org.opends.server.core.SearchOperation;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.Entry;
import org.opends.server.types.InitializationException;
import org.opends.server.types.VirtualAttributeRule;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -317,7 +311,7 @@
    }
    ArrayList<ByteString> normalizedSubAny;
    ArrayList<ByteSequence> normalizedSubAny;
    if (subAny == null)
    {
      normalizedSubAny = null;
@@ -325,7 +319,7 @@
    else
    {
      normalizedSubAny =
           new ArrayList<ByteString>(subAny.size());
           new ArrayList<ByteSequence>(subAny.size());
      for (ByteString subAnyElement : subAny)
      {
        try
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/Aci.java
@@ -28,8 +28,8 @@
package org.opends.server.authorization.dseecompat;
import org.opends.messages.Message;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.ByteSequence;
import static org.opends.messages.AccessControlMessages.*;
import static org.opends.server.util.StaticUtils.isDigit;
@@ -362,9 +362,9 @@
     * @return  Returns a decoded ACI representing the string argument.
     * @throws AciException If the parsing of the ACI string fails.
     */
    public static Aci decode (ByteString byteString, DN dn)
    public static Aci decode (ByteSequence byteString, DN dn)
    throws AciException {
        String input=byteString.stringValue();
        String input=byteString.toString();
        //Perform a quick pattern check against the string to catch any
        //obvious syntax errors.
        if (!Pattern.matches(aciRegex, input)) {
@@ -387,7 +387,7 @@
     * @return A string representation of the ACI.
     */
    public String toString() {
        return new String(aciString);
        return aciString;
    }
    /**
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciContainer.java
@@ -27,22 +27,22 @@
package org.opends.server.authorization.dseecompat;
import org.opends.server.protocols.ldap.LDAPClientConnection;
import org.opends.server.types.*;
import org.opends.server.api.ClientConnection;
import org.opends.server.api.Group;
import org.opends.server.core.AddOperationBasis;
import org.opends.server.api.ConnectionSecurityProvider;
import org.opends.server.core.SearchOperation;
import org.opends.server.extensions.TLSConnectionSecurityProvider;
import org.opends.server.types.Operation;
import java.net.InetAddress;
import java.security.cert.Certificate;
import java.util.LinkedList;
import java.util.List;
import java.util.HashMap;
import static org.opends.server.authorization.dseecompat.Aci.*;
import static org.opends.server.authorization.dseecompat.AciHandler.*;
import org.opends.server.controls.GetEffectiveRights;
import org.opends.server.controls.GetEffectiveRightsRequestControl;
import static org.opends.server.util.ServerConstants.OID_GET_EFFECTIVE_RIGHTS;
/**
@@ -287,8 +287,8 @@
      if(operation instanceof SearchOperation && (rights == ACI_READ)) {
        //Checks if a geteffectiverights control was sent and
        //sets up the structures needed.
        GetEffectiveRights getEffectiveRightsControl =
              (GetEffectiveRights)
        GetEffectiveRightsRequestControl getEffectiveRightsControl =
              (GetEffectiveRightsRequestControl)
                      operation.getAttachment(OID_GET_EFFECTIVE_RIGHTS);
        if(getEffectiveRightsControl != null) {
          hasGetEffectiveRightsControl=true;
@@ -835,16 +835,15 @@
             */
            if (authInfo.hasAuthenticationType(AuthenticationType.SASL) &&
                 authInfo.hasSASLMechanism(saslMech)) {
              ConnectionSecurityProvider provider =
                    clientConnection.getConnectionSecurityProvider();
              if (provider instanceof TLSConnectionSecurityProvider) {
                TLSConnectionSecurityProvider tlsProvider =
                      (TLSConnectionSecurityProvider) provider;
                 if (tlsProvider.getClientCertificateChain() != null) {
                if(clientConnection instanceof LDAPClientConnection) {
                    LDAPClientConnection lc =
                                       (LDAPClientConnection) clientConnection;
                    Certificate[] certChain = lc.getClientCertificateChain();
                    if(certChain.length != 0)
                   matched = EnumEvalResult.TRUE;
                 }
              }
            }
          } else {
            // A particular SASL mechanism.
            if (authInfo.hasAuthenticationType(AuthenticationType.SASL) &&
@@ -985,6 +984,6 @@
   * {@inheritDoc}
   */
  public int getCurrentSSF() {
      return clientConnection.getConnectionSecurityProvider().getSSF();
      return clientConnection.getSSF();
  }
}
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciEffectiveRights.java
@@ -29,7 +29,6 @@
import static org.opends.server.authorization.dseecompat.Aci.*;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.*;
import java.util.LinkedHashSet;
@@ -326,15 +325,15 @@
      //Write right is more complicated. Create a dummy value and set that as
      //the attribute's value. Call the special writeRightsString method, rather
      //than rightsString.
      AttributeValue val=new AttributeValue(a, "dum###Val");
      AttributeValue val= AttributeValues.create(a, "dum###Val");
      container.setCurrentAttributeValue(val);
      evalInfo.append(attributeLevelWriteRights(container, handler, skipCheck));
      addAttrLevelRightsInfo(container, mask, a, retEntry, "write");
      evalInfo.append(',');
      //Perform both selfwrite_add and selfwrite_delete and append results.
      ByteString clientDNStr=
              new ASN1OctetString(container.getClientDN().toString());
      AttributeValue val1=new AttributeValue(a, clientDNStr);
      AttributeValue val1=
          AttributeValues.create(a,
              container.getClientDN().toString());
      if(!specificAttr)
        container.setCurrentAttributeType(dnAttributeType);
      container.setCurrentAttributeValue(val1);
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -47,9 +47,10 @@
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.ldap.LDAPControl;
import org.opends.server.types.*;
import org.opends.server.workflowelement.localbackend.*;
import org.opends.server.controls.GetEffectiveRights;
import org.opends.server.controls.GetEffectiveRightsRequestControl;
import org.opends.server.backends.jeb.EntryContainer;
@@ -568,7 +569,8 @@
           (isAttributeDN(container.getCurrentAttributeType())))  {
          String DNString=null;
          try {
           DNString  =  container.getCurrentAttributeValue().getStringValue();
            DNString =
                container.getCurrentAttributeValue().getValue().toString();
            DN tmpDN = DN.decode(DNString);
            //Have a valid DN, compare to clientDN to see if the ACI_SELF
            //right should be set.
@@ -911,7 +913,8 @@
           DirectoryServer.getAttributeType(baseName)) == null)
           attributeType = DirectoryServer.getDefaultAttributeType(baseName);
       AttributeValue attributeValue =
           new AttributeValue(attributeType, operation.getAssertionValue());
           AttributeValues.create(attributeType,
               operation.getAssertionValue());
       operationContainer.setCurrentAttributeType(attributeType);
       operationContainer.setCurrentAttributeValue(attributeValue);
       return isAllowed(operationContainer, operation);
@@ -1186,12 +1189,20 @@
      op.setAttachment(ORIG_AUTH_ENTRY, op.getAuthorizationEntry());
    else if(control.getOID().equals(OID_GET_EFFECTIVE_RIGHTS)) {
      try {
        GetEffectiveRights getEffectiveRightsControl =
                GetEffectiveRights.decodeControl(control);
        GetEffectiveRightsRequestControl getEffectiveRightsControl;
        if(control instanceof LDAPControl)
        {
          getEffectiveRightsControl = GetEffectiveRightsRequestControl.DECODER
              .decode(control.isCritical(), ((LDAPControl) control).getValue());
        }
        else
        {
          getEffectiveRightsControl = (GetEffectiveRightsRequestControl)control;
        }
        op.setAttachment(OID_GET_EFFECTIVE_RIGHTS, getEffectiveRightsControl);
      } catch  (LDAPException le)  {
      } catch  (DirectoryException de)  {
        Message message =
            WARN_ACI_SYNTAX_DECODE_EFFECTIVERIGHTS_FAIL.get(le.getMessage());
            WARN_ACI_SYNTAX_DECODE_EFFECTIVERIGHTS_FAIL.get(de.getMessage());
        logError(message);
        ret=false;
      }
@@ -1231,7 +1242,7 @@
      // Load the values, a bind rule might want to evaluate them.
      for (String URLString : URLStrings) {
        builder.add(new AttributeValue(refAttrType, URLString));
        builder.add(AttributeValues.create(refAttrType, URLString));
      }
      e.addAttribute(builder.toAttribute(),null);
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciList.java
@@ -394,7 +394,7 @@
        for(Aci aci : hashEntry.getValue()) {
          try {
             Aci newAci =
               Aci.decode(ByteStringFactory.create(aci.toString()), relocateDN);
               Aci.decode(ByteString.valueOf(aci.toString()), relocateDN);
             acis.add(newAci);
          } catch (AciException ex) {
            //This should never happen since only a copy of the
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/AciListenerManager.java
@@ -39,6 +39,7 @@
import org.opends.server.types.operation.PostResponseModifyDNOperation;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.ldap.LDAPControl;
import static org.opends.server.loggers.ErrorLogger.logError;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -240,10 +241,11 @@
      //Add manageDsaIT control so any ACIs in referral entries will be
      //picked up.
      ArrayList<Control> controls = new ArrayList<Control>(1);
      controls.add(new Control(OID_MANAGE_DSAIT_CONTROL, true));
      controls.add(new LDAPControl(OID_MANAGE_DSAIT_CONTROL, true));
      //Add group membership control to let a backend look for it and
      //decide if it would abort searches.
      controls.add(new Control(OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE ,false));
      controls.add(new LDAPControl(
          OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE ,false));
      for (DN baseDN : backend.getBaseDNs()) {
        try {
          if (! backend.entryExists(baseDN))  {
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/GroupDN.java
@@ -148,7 +148,7 @@
        List<Attribute> attrs = e.getAttribute(attributeType);
        for(AttributeValue v : attrs.get(0)) {
            try {
                DN groupDN=DN.decode(v.getStringValue());
                DN groupDN=DN.decode(v.getValue().toString());
                if(suffixDN != null &&
                   !groupDN.isDescendantOf(suffixDN))
                        continue;
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/PatternDN.java
@@ -31,7 +31,6 @@
import org.opends.server.types.*;
import static org.opends.messages.SchemaMessages.*;
import static org.opends.messages.AccessControlMessages.*;
import org.opends.server.protocols.asn1.ASN1OctetString;
import static org.opends.server.util.StaticUtils.isDigit;
import static org.opends.server.util.StaticUtils.isHexDigit;
import static org.opends.server.util.StaticUtils.hexStringToByteArray;
@@ -448,7 +447,7 @@
      if (pos >= length)
      {
        ArrayList<ByteString> arrayList = new ArrayList<ByteString>(1);
        arrayList.add(new ASN1OctetString());
        arrayList.add(ByteString.empty());
        rdnComponents.add(new PatternRDN(name, arrayList, dnString));
        break;
      }
@@ -583,7 +582,7 @@
        if (pos >= length)
        {
          ArrayList<ByteString> arrayList = new ArrayList<ByteString>(1);
          arrayList.add(new ASN1OctetString());
          arrayList.add(ByteString.empty());
          rdn.addValue(name, arrayList, dnString);
          rdnComponents.add(rdn);
          break;
@@ -1198,7 +1197,7 @@
      try
      {
        byte[] bytes = hexStringToByteArray(hexString.toString());
        attributeValues.add(new ASN1OctetString(bytes));
        attributeValues.add(ByteString.wrap(bytes));
        return pos;
      }
      catch (Exception e)
@@ -1262,7 +1261,7 @@
        }
      }
      attributeValues.add(new ASN1OctetString(valueString.toString()));
      attributeValues.add(ByteString.valueOf(valueString.toString()));
      return pos;
    }
@@ -1281,7 +1280,7 @@
      else if (c == '*')
      {
        escaped = false;
        attributeValues.add(new ASN1OctetString(valueString.toString()));
        attributeValues.add(ByteString.valueOf(valueString.toString()));
      }
      else
      {
@@ -1379,7 +1378,7 @@
            throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
                                         message);
          }
          attributeValues.add(new ASN1OctetString(valueString.toString()));
          attributeValues.add(ByteString.valueOf(valueString.toString()));
          valueString = new StringBuilder();
          hexChars = new StringBuilder();
        }
@@ -1412,7 +1411,7 @@
      }
      attributeValues.add(new ASN1OctetString(valueString.toString()));
      attributeValues.add(ByteString.valueOf(valueString.toString()));
      return pos;
    }
  }
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/PatternRDN.java
@@ -273,13 +273,13 @@
        // Handle this just like a substring filter.
        ByteString subInitial = pattern.get(0);
        if (subInitial.value().length == 0)
        if (subInitial.length() == 0)
        {
          subInitial = null;
        }
        ByteString subFinal = pattern.get(pattern.size() - 1);
        if (subFinal.value().length == 0)
        if (subFinal.length() == 0)
        {
          subFinal = null;
        }
@@ -308,7 +308,8 @@
      }
      else
      {
        ByteString thisNormValue = type.normalize(pattern.get(0));
        ByteString thisNormValue =
            type.getEqualityMatchingRule().normalizeValue(pattern.get(0));
        ByteString thatNormValue = value.getNormalizedValue();
        EqualityMatchingRule mr = type.getEqualityMatchingRule();
        return mr.areEqual(thisNormValue, thatNormValue);
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/UserAttr.java
@@ -221,7 +221,7 @@
                        filter, null);
        LinkedList<SearchResultEntry> result = op.getSearchEntries();
        if (!result.isEmpty()) {
            AttributeValue val=new AttributeValue(attrType, attrVal);
            AttributeValue val= AttributeValues.create(attrType, attrVal);
            SearchResultEntry resultEntry = result.getFirst();
            if(resultEntry.hasValue(attrType, null, val)) {
                Entry e=evalCtx.getResourceEntry();
@@ -284,7 +284,7 @@
        if(!attrs.isEmpty()) {
            for(Attribute a : attrs) {
                for(AttributeValue v : a) {
                    String urlStr=v.getStringValue();
                    String urlStr=v.getValue().toString();
                    LDAPURL url;
                    try {
                       url=LDAPURL.decode(urlStr, true);
opendj-sdk/opends/src/server/org/opends/server/authorization/dseecompat/UserDN.java
@@ -361,7 +361,7 @@
        List<Attribute> attrs =  e.getAttribute(attrType);
        for(AttributeValue v : attrs.get(0)) {
            try {
                DN dn=DN.decode(v.getStringValue());
                DN dn=DN.decode(v.getValue().toString());
                if(dn.equals(clientDN)) {
                    matched=EnumEvalResult.TRUE;
                    break;
opendj-sdk/opends/src/server/org/opends/server/backends/BackupBackend.java
@@ -44,32 +44,7 @@
import org.opends.server.core.ModifyDNOperation;
import org.opends.server.core.SearchOperation;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.Attributes;
import org.opends.server.types.BackupConfig;
import org.opends.server.types.BackupDirectory;
import org.opends.server.types.BackupInfo;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.ConfigChangeResult;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.IndexType;
import org.opends.server.types.InitializationException;
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.LDIFImportResult;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.RDN;
import org.opends.server.types.RestoreConfig;
import org.opends.server.types.ResultCode;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.SearchScope;
import org.opends.server.types.*;
import org.opends.server.schema.BooleanSyntax;
import org.opends.server.schema.GeneralizedTimeSyntax;
import org.opends.server.util.Validator;
@@ -446,7 +421,7 @@
          {
            BackupDirectory backupDirectory =
                BackupDirectory.readBackupDirectoryDescriptor(
                    v.getStringValue());
                    v.getValue().toString());
            count += backupDirectory.getBackups().keySet().size();
          }
          catch (Exception e)
@@ -555,7 +530,8 @@
    try
    {
      backupDirectory =
           BackupDirectory.readBackupDirectoryDescriptor(v.getStringValue());
           BackupDirectory.readBackupDirectoryDescriptor(
               v.getValue().toString());
    }
    catch (ConfigException ce)
    {
@@ -602,7 +578,7 @@
    t = DirectoryServer.getAttributeType(ATTR_BACKUP_BACKEND_DN, true);
    attrList = new ArrayList<Attribute>(1);
    attrList.add(Attributes.create(t, new AttributeValue(t,
    attrList.add(Attributes.create(t, AttributeValues.create(t,
        backupDirectory.getConfigEntryDN().toString())));
    userAttrs.put(t, attrList);
@@ -637,7 +613,7 @@
          .valueOf(entryDN));
      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
    }
    String backupID = idValue.getStringValue();
    String backupID = idValue.getValue().toString();
    // Next, get the backup directory from the parent DN.
    DN parentDN = entryDN.getParentDNInSuffix();
@@ -659,7 +635,7 @@
    BackupDirectory backupDirectory;
    try {
      backupDirectory = BackupDirectory.readBackupDirectoryDescriptor(v
          .getStringValue());
          .getValue().toString());
    } catch (ConfigException ce) {
      if (debugEnabled()) {
        TRACER.debugCaught(DebugLogLevel.ERROR, ce);
@@ -716,7 +692,7 @@
    if (backupDate != null) {
      t = DirectoryServer.getAttributeType(ATTR_BACKUP_DATE, true);
      attrList = new ArrayList<Attribute>(1);
      attrList.add(Attributes.create(t, new AttributeValue(t,
      attrList.add(Attributes.create(t, AttributeValues.create(t,
          GeneralizedTimeSyntax.format(backupDate))));
      userAttrs.put(t, attrList);
    }
@@ -744,7 +720,7 @@
      t = DirectoryServer.getAttributeType(ATTR_BACKUP_DEPENDENCY, true);
      AttributeBuilder builder = new AttributeBuilder(t);
      for (String s : dependencies) {
        builder.add(new AttributeValue(t, s));
        builder.add(AttributeValues.create(t, s));
      }
      attrList = new ArrayList<Attribute>(1);
      attrList.add(builder.toAttribute());
@@ -755,8 +731,9 @@
    if (signedHash != null) {
      t = DirectoryServer.getAttributeType(ATTR_BACKUP_SIGNED_HASH, true);
      attrList = new ArrayList<Attribute>(1);
      attrList.add(Attributes.create(t, new AttributeValue(t,
          new ASN1OctetString(signedHash))));
      attrList.add(Attributes.create(t,
          AttributeValues.create(t,
              ByteString.wrap(signedHash))));
      userAttrs.put(t, attrList);
    }
@@ -764,8 +741,9 @@
    if (unsignedHash != null) {
      t = DirectoryServer.getAttributeType(ATTR_BACKUP_UNSIGNED_HASH, true);
      attrList = new ArrayList<Attribute>(1);
      attrList.add(Attributes.create(t, new AttributeValue(t,
          new ASN1OctetString(unsignedHash))));
      attrList.add(Attributes.create(t,
          AttributeValues.create(t,
              ByteString.wrap(unsignedHash))));
      userAttrs.put(t, attrList);
    }
@@ -774,7 +752,7 @@
      for (Map.Entry<String, String> e : properties.entrySet()) {
        t = DirectoryServer.getAttributeType(toLowerCase(e.getKey()), true);
        attrList = new ArrayList<Attribute>(1);
        attrList.add(Attributes.create(t, new AttributeValue(
        attrList.add(Attributes.create(t, AttributeValues.create(
            t, e.getValue())));
        userAttrs.put(t, attrList);
      }
@@ -919,7 +897,7 @@
                {
                  BackupDirectory backupDirectory =
                       BackupDirectory.readBackupDirectoryDescriptor(
                            v.getStringValue());
                            v.getValue().toString());
                  AttributeType idType =
                       DirectoryServer.getAttributeType(ATTR_BACKUP_ID,
                                                        true);
@@ -976,7 +954,7 @@
            {
              BackupDirectory backupDirectory =
                   BackupDirectory.readBackupDirectoryDescriptor(
                        v.getStringValue());
                        v.getValue().toString());
              AttributeType idType =
                   DirectoryServer.getAttributeType(ATTR_BACKUP_ID,
                                                    true);
@@ -1238,7 +1216,7 @@
                               String rdnStringValue)
  {
    AttributeValue attrValue =
         new AttributeValue(rdnAttrType, rdnStringValue);
        AttributeValues.create(rdnAttrType, rdnStringValue);
    return parentDN.concat(RDN.create(rdnAttrType, attrValue));
  }
opendj-sdk/opends/src/server/org/opends/server/backends/LDIFBackend.java
@@ -44,6 +44,7 @@
import org.opends.server.api.AlertGenerator;
import org.opends.server.api.Backend;
import org.opends.server.config.ConfigException;
import org.opends.server.controls.SubtreeDeleteControl;
import org.opends.server.core.AddOperation;
import org.opends.server.core.DeleteOperation;
import org.opends.server.core.DirectoryServer;
@@ -106,7 +107,7 @@
  private DN[] baseDNs;
  // The mapping between parent DNs and their immediate children.
  private HashMap<DN,HashSet<DN>> childDNs;
  private final HashMap<DN,HashSet<DN>> childDNs;
  // The base DNs for this backend, in a hash set.
  private HashSet<DN> baseDNSet;
@@ -121,10 +122,10 @@
  private LDIFBackendCfg currentConfig;
  // The mapping between entry DNs and the corresponding entries.
  private LinkedHashMap<DN,Entry> entryMap;
  private final LinkedHashMap<DN,Entry> entryMap;
  // A read-write lock used to protect access to this backend.
  private ReentrantReadWriteLock backendLock;
  private final ReentrantReadWriteLock backendLock;
  // The path to the LDIF file containing the data for this backend.
  private String ldifFilePath;
@@ -733,13 +734,12 @@
      else
      {
        boolean subtreeDelete = false;
        for (Control c : deleteOperation.getRequestControls())
        {
          if (c.getOID().equals(OID_SUBTREE_DELETE_CONTROL))
        if (deleteOperation != null
            && deleteOperation
                .getRequestControl(SubtreeDeleteControl.DECODER) != null)
          {
            subtreeDelete = true;
            break;
          }
        }
        if (! subtreeDelete)
@@ -1579,6 +1579,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void preloadEntryCache() throws UnsupportedOperationException {
    throw new UnsupportedOperationException("Operation not supported.");
  }
opendj-sdk/opends/src/server/org/opends/server/backends/MemoryBackend.java
@@ -39,6 +39,7 @@
import org.opends.server.admin.std.server.MemoryBackendCfg;
import org.opends.server.api.Backend;
import org.opends.server.config.ConfigException;
import org.opends.server.controls.SubtreeDeleteControl;
import org.opends.server.core.AddOperation;
import org.opends.server.core.DeleteOperation;
import org.opends.server.core.DirectoryServer;
@@ -475,16 +476,13 @@
    // Check to see if the entry contains a subtree delete control.
    boolean subtreeDelete = false;
    if (deleteOperation != null)
    {
      for (Control c : deleteOperation.getRequestControls())
      {
        if (c.getOID().equals(OID_SUBTREE_DELETE_CONTROL))
    if (deleteOperation != null
        && deleteOperation
            .getRequestControl(SubtreeDeleteControl.DECODER) != null)
        {
          subtreeDelete = true;
        }
      }
    }
    HashSet<DN> children = childDNs.get(entryDN);
    if (subtreeDelete)
@@ -989,6 +987,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void preloadEntryCache() throws UnsupportedOperationException {
    throw new UnsupportedOperationException("Operation not supported.");
  }
opendj-sdk/opends/src/server/org/opends/server/backends/MonitorBackend.java
@@ -432,7 +432,7 @@
    // Get the RDN value and see if it matches the instance name for one of
    // the directory server monitor providers.
    String rdnValue = entryRDN.getAttributeValue(0).getStringValue();
    String rdnValue = entryRDN.getAttributeValue(0).getValue().toString();
    MonitorProvider<? extends MonitorProviderCfg> monitorProvider =
         DirectoryServer.getMonitorProvider(rdnValue.toLowerCase());
    if (monitorProvider == null)
@@ -1295,6 +1295,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void preloadEntryCache() throws UnsupportedOperationException {
    throw new UnsupportedOperationException("Operation not supported.");
  }
opendj-sdk/opends/src/server/org/opends/server/backends/NullBackend.java
@@ -31,7 +31,6 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import org.opends.messages.Category;
import org.opends.messages.Message;
@@ -48,19 +47,16 @@
import org.opends.server.core.ModifyDNOperation;
import org.opends.server.core.SearchOperation;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.AttributeType;
import org.opends.server.types.BackupConfig;
import org.opends.server.types.BackupDirectory;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.Control;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.IndexType;
import org.opends.server.types.InitializationException;
import org.opends.server.types.LDAPException;
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.LDIFImportResult;
@@ -80,34 +76,29 @@
/**
 * This class implements /dev/null like backend for development and testing.
 *
 * The following behaviors of this backend implementation should be noted:
 *
 * * All read operations return success but no data.
 *
 * * All write operations return success but do nothing.
 *
 * * Bind operations fail with invalid credentials.
 *
 * * Compare operations are only possible on objectclass and return true
 *   for the following objeclasses only: top, nullbackendobject,
 * This class implements /dev/null like backend for development and
 * testing. The following behaviors of this backend implementation
 * should be noted:
 * <ul>
 * <li>All read operations return success but no data.
 * <li>All write operations return success but do nothing.
 * <li>Bind operations fail with invalid credentials.
 * <li>Compare operations are only possible on objectclass and return
 * true for the following objeclasses only: top, nullbackendobject,
 *   extensibleobject. Otherwise comparison result is false or comparison
 *   fails altogether.
 *
 * * Controls are supported although this implementation does not provide
 *   any specific emulation for controls. Generally known request controls
 *   are accepted and default response controls returned where applicable.
 *
 * * Searches within this backend are always considered indexed.
 *
 * * Backend Import is supported by iterating over ldif reader on a single
 *   thread and issuing add operations which essentially do nothing at all.
 *
 * * Backend Export is supported but does nothing producing an empty ldif.
 *
 * * Backend Backup and Restore are not supported.
 *
 * <li>Controls are supported although this implementation does not
 * provide any specific emulation for controls. Generally known request
 * controls are accepted and default response controls returned where
 * applicable.
 * <li>Searches within this backend are always considered indexed.
 * <li>Backend Import is supported by iterating over ldif reader on a
 * single thread and issuing add operations which essentially do nothing
 * at all.
 * <li>Backend Export is supported but does nothing producing an empty
 * ldif.
 * <li>Backend Backup and Restore are not supported.
 * </ul>
 * This backend implementation is for development and testing only, does
 * not represent a complete and stable API, should be considered private
 * and subject to change without notice.
@@ -405,34 +396,14 @@
  public void search(SearchOperation searchOperation)
         throws DirectoryException
  {
    List<Control> controls = searchOperation.getRequestControls();
    PagedResultsControl pageRequest = null;
    if (controls != null) {
      for (Control control : controls) {
        if (control.getOID().equals(OID_PAGED_RESULTS_CONTROL)) {
          // Ignore all but the first paged results control.
          if (pageRequest == null) {
            try {
              pageRequest = new PagedResultsControl(control.isCritical(),
                control.getValue());
            } catch (LDAPException e) {
              if (debugEnabled()) {
                TRACER.debugCaught(DebugLogLevel.ERROR, e);
              }
              throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                e.getMessageObject(), e);
            }
          }
        }
      }
    }
    PagedResultsControl pageRequest =
        searchOperation.getRequestControl(PagedResultsControl.DECODER);
    if (pageRequest != null) {
      // Indicate no more pages.
      PagedResultsControl control;
      control = new PagedResultsControl(pageRequest.isCritical(), 0,
        new ASN1OctetString());
      control =
          new PagedResultsControl(pageRequest.isCritical(), 0, null);
      searchOperation.getResponseControls().add(control);
    }
@@ -659,6 +630,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void preloadEntryCache() throws UnsupportedOperationException {
    throw new UnsupportedOperationException("Operation not supported.");
  }
opendj-sdk/opends/src/server/org/opends/server/backends/RootDSEBackend.java
@@ -54,7 +54,6 @@
import org.opends.server.core.WorkflowTopologyNode;
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.*;
import org.opends.server.util.LDIFWriter;
import org.opends.server.util.Validator;
@@ -838,7 +837,7 @@
    AttributeBuilder builder = new AttributeBuilder(type, name);
    for (DN dn : values) {
      builder.add(
          new AttributeValue(type, new ASN1OctetString(dn.toString())));
          AttributeValues.create(type, dn.toString()));
    }
    return builder.toAttribute();
@@ -871,7 +870,7 @@
    AttributeBuilder builder = new AttributeBuilder(type, name);
    builder.setInitialCapacity(values.size());
    for (String s : values) {
      builder.add(new AttributeValue(type, new ASN1OctetString(s)));
      builder.add(AttributeValues.create(type, s));
    }
    return builder.toAttribute();
opendj-sdk/opends/src/server/org/opends/server/backends/SchemaBackend.java
@@ -74,7 +74,6 @@
import org.opends.server.core.SearchOperation;
import org.opends.server.loggers.ErrorLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.schema.AttributeTypeSyntax;
import org.opends.server.schema.DITContentRuleSyntax;
import org.opends.server.schema.DITStructureRuleSyntax;
@@ -301,9 +300,11 @@
    cfg.getBaseDN().toArray(baseDNs);
    this.baseDNs = baseDNs;
    creatorsName  = new AttributeValue(creatorsNameType, baseDNs[0].toString());
    creatorsName  = AttributeValues.create(
        creatorsNameType, baseDNs[0].toString());
    modifiersName =
         new AttributeValue(modifiersNameType, baseDNs[0].toString());
        AttributeValues.create(
            modifiersNameType, baseDNs[0].toString());
    long createTime = DirectoryServer.getSchema().getOldestModificationTime();
    createTimestamp =
@@ -715,8 +716,9 @@
              value.getValue(), schema, false);
          attrType = DirectoryServer.getAttributeType(attrType.getOID());
          newValueSet.add(new AttributeValue(attributeTypesType, attrType
              .getDefinitionWithFileName()));
          newValueSet.add(
              AttributeValues.create(attributeTypesType,
                  attrType.getDefinitionWithFileName()));
        }
        catch (DirectoryException e)
        {
@@ -741,8 +743,8 @@
          // add it to the valueset.
          String strippedStr = v.toString().replaceFirst(
              stripMinUpperBoundRegEx, "");
          ASN1OctetString s = new ASN1OctetString(strippedStr);
          AttributeValue strippedVal = new AttributeValue(s, s);
          ByteString s = ByteString.valueOf(strippedStr);
          AttributeValue strippedVal = AttributeValues.create(s, s);
          builder.add(strippedVal);
        }
        else
@@ -787,8 +789,8 @@
          ObjectClass oc = ObjectClassSyntax.decodeObjectClass(
              value.getValue(), schema, false);
          oc = DirectoryServer.getObjectClass(oc.getOID());
          newValueSet.add(new AttributeValue(objectClassesType, oc
              .getDefinitionWithFileName()));
          newValueSet.add(AttributeValues.create(
              objectClassesType, oc.getDefinitionWithFileName()));
        }
        catch (DirectoryException e)
        {
@@ -1123,7 +1125,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_ATTRTYPE.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1150,7 +1152,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_OBJECTCLASS.
                    get(v.getStringValue(), de.getMessageObject());
                    get(v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1177,7 +1179,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_NAME_FORM.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1204,7 +1206,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_DCR.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1231,7 +1233,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_DSR.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1258,7 +1260,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_MR_USE.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1305,7 +1307,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_ATTRTYPE.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1333,7 +1335,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_OBJECTCLASS.
                    get(v.getStringValue(), de.getMessageObject());
                    get(v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1360,7 +1362,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_NAME_FORM.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1387,7 +1389,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_DCR.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1415,7 +1417,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_DSR.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1443,7 +1445,7 @@
                }
                Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_MR_USE.get(
                    v.getStringValue(), de.getMessageObject());
                    v.getValue().toString(), de.getMessageObject());
                throw new DirectoryException(
                               ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                               de);
@@ -1496,7 +1498,8 @@
      authzDN = DN.nullDN();
    }
    modifiersName = new AttributeValue(modifiersNameType, authzDN.toString());
    modifiersName = AttributeValues.create(
        modifiersNameType, authzDN.toString());
    modifyTimestamp = GeneralizedTimeSyntax.createGeneralizedTimeValue(
                           System.currentTimeMillis());
  }
@@ -1797,7 +1800,7 @@
          }
          Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_ATTRTYPE.get(
              v.getStringValue(), de.getMessageObject());
              v.getValue().toString(), de.getMessageObject());
          throw new DirectoryException(
                         ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                         de);
@@ -2123,7 +2126,7 @@
          }
          Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_OBJECTCLASS.get(
              v.getStringValue(), de.getMessageObject());
              v.getValue().toString(), de.getMessageObject());
          throw new DirectoryException(
                         ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                         de);
@@ -2428,7 +2431,7 @@
          }
          Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_NAME_FORM.get(
              v.getStringValue(), de.getMessageObject());
              v.getValue().toString(), de.getMessageObject());
          throw new DirectoryException(
                         ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                         de);
@@ -2959,7 +2962,7 @@
          }
          Message message = ERR_SCHEMA_MODIFY_CANNOT_DECODE_DSR.get(
              v.getStringValue(), de.getMessageObject());
              v.getValue().toString(), de.getMessageObject());
          throw new DirectoryException(
                         ResultCode.INVALID_ATTRIBUTE_SYNTAX, message,
                         de);
@@ -3331,7 +3334,8 @@
    {
      if (schemaFile.equals(nf.getSchemaFile()))
      {
        values.add(new AttributeValue(nameFormsType, nf.getDefinition()));
        values.add(AttributeValues.create(
            nameFormsType, nf.getDefinition()));
      }
    }
@@ -3353,7 +3357,7 @@
    {
      if (schemaFile.equals(dcr.getSchemaFile()))
      {
        values.add(new AttributeValue(ditContentRulesType,
        values.add(AttributeValues.create(ditContentRulesType,
                                      dcr.getDefinition()));
      }
    }
@@ -3400,7 +3404,7 @@
    {
      if (schemaFile.equals(mru.getSchemaFile()))
      {
        values.add(new AttributeValue(matchingRuleUsesType,
        values.add(AttributeValues.create(matchingRuleUsesType,
                                      mru.getDefinition()));
      }
    }
@@ -3483,7 +3487,7 @@
                              addedTypes, depth+1);
    }
    values.add(new AttributeValue(attributeTypesType,
    values.add(AttributeValues.create(attributeTypesType,
                                  attributeType.getDefinition()));
    addedTypes.add(attributeType);
  }
@@ -3534,7 +3538,7 @@
                                 addedClasses, depth+1);
    }
    values.add(new AttributeValue(objectClassesType,
    values.add(AttributeValues.create(objectClassesType,
                                  objectClass.getDefinition()));
    addedClasses.add(objectClass);
  }
@@ -3585,7 +3589,7 @@
      }
    }
    values.add(new AttributeValue(ditStructureRulesType,
    values.add(AttributeValues.create(ditStructureRulesType,
                                  ditStructureRule.getDefinition()));
    addedDSRs.add(ditStructureRule);
  }
opendj-sdk/opends/src/server/org/opends/server/backends/TrustStoreBackend.java
@@ -75,33 +75,7 @@
import org.opends.server.core.SearchOperation;
import org.opends.server.loggers.ErrorLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.Attributes;
import org.opends.server.types.BackupConfig;
import org.opends.server.types.BackupDirectory;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.ConfigChangeResult;
import org.opends.server.types.DN;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.FilePermission;
import org.opends.server.types.IndexType;
import org.opends.server.types.InitializationException;
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.LDIFImportResult;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.RDN;
import org.opends.server.types.RestoreConfig;
import org.opends.server.types.ResultCode;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.SearchScope;
import org.opends.server.types.*;
import org.opends.server.util.CertificateManager;
import org.opends.server.util.Validator;
@@ -581,7 +555,7 @@
                                   baseDN, null);
    }
    String certAlias = v.getStringValue();
    String certAlias = v.getValue().toString();
    ByteString certValue;
    try
    {
@@ -592,7 +566,7 @@
            String.valueOf(entryDN), certAlias);
        throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, message);
      }
      certValue = new ASN1OctetString(cert.getEncoded());
      certValue = ByteString.wrap(cert.getEncoded());
    }
    catch (Exception e)
    {
@@ -630,7 +604,7 @@
        true);
    AttributeBuilder builder = new AttributeBuilder(t);
    builder.setOption("binary");
    builder.add(new AttributeValue(t, certValue));
    builder.add(AttributeValues.create(t, certValue));
    attrList = new ArrayList<Attribute>(1);
    attrList.add(builder.toAttribute());
    userAttrs.put(t, attrList);
@@ -1370,7 +1344,7 @@
                               String rdnStringValue)
  {
    AttributeValue attrValue =
         new AttributeValue(rdnAttrType, rdnStringValue);
        AttributeValues.create(rdnAttrType, rdnStringValue);
    return parentDN.concat(RDN.create(rdnAttrType, attrValue));
  }
@@ -1575,7 +1549,7 @@
      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message,
                                   baseDN, null);
    }
    String certAlias = v.getStringValue();
    String certAlias = v.getValue().toString();
    try
    {
@@ -1642,7 +1616,7 @@
               DirectoryServer.getServerErrorResultCode(), message);
        }
        byte[] certBytes = i.next().getValueBytes();
        ByteString certBytes = i.next().getValue();
        if (i.hasNext())
        {
@@ -1665,7 +1639,7 @@
                 new FileOutputStream(tempFile.getPath(), false);
            try
            {
              outputStream.write(certBytes);
              certBytes.copyTo(outputStream);
            }
            finally
            {
@@ -1713,7 +1687,7 @@
      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message,
                                   baseDN, null);
    }
    String certAlias = v.getStringValue();
    String certAlias = v.getValue().toString();
    try
    {
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ApproximateIndexer.java
@@ -165,7 +165,7 @@
        try
        {
          byte[] keyBytes =
               approximateRule.normalizeValue(value.getValue()).value();
               approximateRule.normalizeValue(value.getValue()).toByteArray();
          keys.add(keyBytes);
        }
@@ -201,7 +201,7 @@
        try
        {
          byte[] keyBytes =
              approximateRule.normalizeValue(value.getValue()).value();
              approximateRule.normalizeValue(value.getValue()).toByteArray();
          Boolean cInsert = modifiedKeys.get(keyBytes);
          if(cInsert == null)
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/AttributeIndex.java
@@ -34,7 +34,6 @@
import org.opends.server.api.SubstringMatchingRule;
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.api.ApproximateMatchingRule;
import org.opends.server.protocols.asn1.ASN1OctetString;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -797,7 +796,7 @@
    {
      int len = Math.min(substrLength, remain);
      keyBytes = makeSubstringKey(value, i, len);
      set.add(new ASN1OctetString(keyBytes));
      set.add(ByteString.wrap(keyBytes));
    }
    return set;
@@ -947,7 +946,7 @@
    {
      // Make a key from the normalized assertion value.
      byte[] keyBytes =
           equalityFilter.getAssertionValue().getNormalizedValue().value();
          equalityFilter.getAssertionValue().getNormalizedValue().toByteArray();
      DatabaseEntry key = new DatabaseEntry(keyBytes);
      if(debugBuffer != null)
@@ -1026,7 +1025,7 @@
      OrderingMatchingRule orderingRule =
           filter.getAttributeType().getOrderingMatchingRule();
      byte[] lower = orderingRule.normalizeValue(
           filter.getAssertionValue().getValue()).value();
           filter.getAssertionValue().getValue()).toByteArray();
      // Set the upper bound to 0 to search all keys greater then the lower
      // bound.
@@ -1082,7 +1081,7 @@
      OrderingMatchingRule orderingRule =
           filter.getAttributeType().getOrderingMatchingRule();
      byte[] upper = orderingRule.normalizeValue(
           filter.getAssertionValue().getValue()).value();
           filter.getAssertionValue().getValue()).toByteArray();
      if(debugBuffer != null)
      {
@@ -1133,7 +1132,7 @@
        {
          ByteString normValue =
               matchRule.normalizeSubstring(filter.getSubInitialElement());
          byte[] normBytes = normValue.value();
          byte[] normBytes = normValue.toByteArray();
          EntryIDSet list = matchInitialSubstring(normBytes);
          results.retainAll(list);
@@ -1178,7 +1177,7 @@
      {
        // Normalize the substring according to the substring matching rule.
        ByteString normValue = matchRule.normalizeSubstring(element);
        byte[] normBytes = normValue.value();
        byte[] normBytes = normValue.toByteArray();
        // Get the candidate entry IDs from the index.
        EntryIDSet list = matchSubstring(normBytes);
@@ -1240,10 +1239,12 @@
           getAttributeType().getOrderingMatchingRule();
      // Set the lower bound for a range search.
      byte[] lower = orderingRule.normalizeValue(lowerValue.getValue()).value();
      byte[] lower =
          orderingRule.normalizeValue(lowerValue.getValue()).toByteArray();
      // Set the upper bound for a range search.
      byte[] upper = orderingRule.normalizeValue(upperValue.getValue()).value();
      byte[] upper =
          orderingRule.normalizeValue(upperValue.getValue()).toByteArray();
      // Read the range: lower <= keys <= upper.
      return orderingIndex.readRange(lower, upper, true, true);
@@ -1329,7 +1330,7 @@
      // Make a key from the normalized assertion value.
      byte[] keyBytes =
           approximateMatchingRule.normalizeValue(
               approximateFilter.getAssertionValue().getValue()).value();
               approximateFilter.getAssertionValue().getValue()).toByteArray();
      DatabaseEntry key = new DatabaseEntry(keyBytes);
      if(debugBuffer != null)
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/DN2URI.java
@@ -33,20 +33,7 @@
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.SearchOperation;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.LDAPURL;
import org.opends.server.types.Modification;
import org.opends.server.types.ResultCode;
import org.opends.server.types.SearchResultReference;
import org.opends.server.types.SearchScope;
import org.opends.server.types.*;
import org.opends.server.util.StaticUtils;
import java.io.UnsupportedEncodingException;
@@ -315,7 +302,7 @@
            {
              for (AttributeValue v : a)
              {
                insert(txn, entryDN, v.getStringValue());
                insert(txn, entryDN, v.getValue().toString());
              }
            }
            break;
@@ -329,7 +316,7 @@
            {
              for (AttributeValue v : a)
              {
                delete(txn, entryDN, v.getStringValue());
                delete(txn, entryDN, v.getValue().toString());
              }
            }
            break;
@@ -344,7 +331,7 @@
            {
              for (AttributeValue v : a)
              {
                insert(txn, entryDN, v.getStringValue());
                insert(txn, entryDN, v.getValue().toString());
              }
            }
            break;
@@ -679,7 +666,7 @@
          }
          // We have found a subordinate referral.
          DN dn = DN.decode(new ASN1OctetString(key.getData()));
          DN dn = DN.decode(ByteString.wrap(key.getData()));
          // Make sure the referral is within scope.
          if (searchOp.getScope() == SearchScope.SINGLE_LEVEL)
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryCachePreloader.java
@@ -51,6 +51,7 @@
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.Entry;
import org.opends.server.types.ByteString;
import static org.opends.server.util.StaticUtils.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import static org.opends.server.loggers.ErrorLogger.logError;
@@ -291,7 +292,7 @@
          long entryID =
            JebFormat.entryIDFromDatabase(preloadEntry.entryIDBytes);
          Entry entry =
            JebFormat.entryFromDatabase(preloadEntry.entryBytes,
            ID2Entry.entryFromDatabase(ByteString.wrap(preloadEntry.entryBytes),
            jeb.getRootContainer().getCompressedSchema());
          try {
            // Even if the entry does not end up in the cache its still
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryContainer.java
@@ -38,11 +38,11 @@
import org.opends.server.core.ModifyOperation;
import org.opends.server.core.ModifyDNOperation;
import org.opends.server.core.SearchOperation;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.controls.PagedResultsControl;
import org.opends.server.controls.ServerSideSortRequestControl;
import org.opends.server.controls.ServerSideSortResponseControl;
import org.opends.server.controls.SubtreeDeleteControl;
import org.opends.server.controls.VLVRequestControl;
import org.opends.server.types.*;
import org.opends.server.util.StaticUtils;
@@ -59,7 +59,6 @@
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import static org.opends.server.loggers.ErrorLogger.logError;
import static org.opends.server.util.ServerConstants.*;
import org.opends.server.admin.std.server.LocalDBBackendCfg;
import org.opends.server.admin.std.server.LocalDBIndexCfg;
import org.opends.server.admin.std.server.LocalDBVLVIndexCfg;
@@ -130,17 +129,17 @@
  /**
   * The backend to which this entry entryContainer belongs.
   */
  private Backend backend;
  private final Backend backend;
  /**
   * The root container in which this entryContainer belongs.
   */
  private RootContainer rootContainer;
  private final RootContainer rootContainer;
  /**
   * The baseDN this entry container is responsible for.
   */
  private DN baseDN;
  private final DN baseDN;
  /**
   * The backend configuration.
@@ -150,7 +149,7 @@
  /**
   * The JE database environment.
   */
  private Environment env;
  private final Environment env;
  /**
   * The DN database maps a normalized DN string to an entry ID (8 bytes).
@@ -185,12 +184,12 @@
  /**
   * The set of attribute indexes.
   */
  private HashMap<AttributeType, AttributeIndex> attrIndexMap;
  private final HashMap<AttributeType, AttributeIndex> attrIndexMap;
  /**
   * The set of VLV indexes.
   */
  private HashMap<String, VLVIndex> vlvIndexMap;
  private final HashMap<String, VLVIndex> vlvIndexMap;
  private String databasePrefix;
  /**
@@ -862,92 +861,17 @@
    DN baseDN = searchOperation.getBaseDN();
    SearchScope searchScope = searchOperation.getScope();
    List<Control> controls = searchOperation.getRequestControls();
    PagedResultsControl pageRequest = null;
    ServerSideSortRequestControl sortRequest = null;
    VLVRequestControl vlvRequest = null;
    if (controls != null)
    {
      for (Control control : controls)
      {
        if (control.getOID().equals(OID_PAGED_RESULTS_CONTROL))
        {
          // Ignore all but the first paged results control.
          if (pageRequest == null)
          {
            try
            {
              pageRequest = new PagedResultsControl(control.isCritical(),
                                                    control.getValue());
            }
            catch (LDAPException e)
            {
              if (debugEnabled())
              {
                TRACER.debugCaught(DebugLogLevel.ERROR, e);
              }
              throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                                           e.getMessageObject(), e);
            }
    PagedResultsControl pageRequest = searchOperation
    .getRequestControl(PagedResultsControl.DECODER);
    ServerSideSortRequestControl sortRequest = searchOperation
    .getRequestControl(ServerSideSortRequestControl.DECODER);
    VLVRequestControl vlvRequest = searchOperation
    .getRequestControl(VLVRequestControl.DECODER);
            if (vlvRequest != null)
    if (vlvRequest != null && pageRequest != null)
            {
              Message message =
                  ERR_JEB_SEARCH_CANNOT_MIX_PAGEDRESULTS_AND_VLV.get();
              throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
                                           message);
            }
          }
        }
        else if (control.getOID().equals(OID_SERVER_SIDE_SORT_REQUEST_CONTROL))
        {
          // Ignore all but the first sort request control.
          if (sortRequest == null)
          {
            try
            {
              sortRequest = ServerSideSortRequestControl.decodeControl(control);
            }
            catch (LDAPException e)
            {
              if (debugEnabled())
              {
                TRACER.debugCaught(DebugLogLevel.ERROR, e);
              }
              throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                                           e.getMessageObject(), e);
            }
          }
        }
        else if (control.getOID().equals(OID_VLV_REQUEST_CONTROL))
        {
          // Ignore all but the first VLV request control.
          if (vlvRequest == null)
          {
            try
            {
              vlvRequest = VLVRequestControl.decodeControl(control);
            }
            catch (LDAPException e)
            {
              if (debugEnabled())
              {
                TRACER.debugCaught(DebugLogLevel.ERROR, e);
              }
              throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                                           e.getMessageObject(), e);
            }
            if (pageRequest != null)
            {
              Message message =
                  ERR_JEB_SEARCH_CANNOT_MIX_PAGEDRESULTS_AND_VLV.get();
              throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
                                           message);
            }
          }
        }
      }
      Message message = ERR_JEB_SEARCH_CANNOT_MIX_PAGEDRESULTS_AND_VLV.get();
      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
    }
    // Handle client abandon of paged results.
@@ -956,8 +880,7 @@
      if (pageRequest.getSize() == 0)
      {
        PagedResultsControl control;
        control = new PagedResultsControl(pageRequest.isCritical(), 0,
                                          new ASN1OctetString());
        control = new PagedResultsControl(pageRequest.isCritical(), 0, null);
        searchOperation.getResponseControls().add(control);
        return;
      }
@@ -1006,8 +929,7 @@
      {
        // Indicate no more pages.
        PagedResultsControl control;
        control = new PagedResultsControl(pageRequest.isCritical(), 0,
                                          new ASN1OctetString());
        control = new PagedResultsControl(pageRequest.isCritical(), 0, null);
        searchOperation.getResponseControls().add(control);
      }
@@ -1230,7 +1152,7 @@
    // The base entry must already have been processed if this is
    // a request for the next page in paged results.  So we skip
    // the base entry processing if the cookie is set.
    if (pageRequest == null || pageRequest.getCookie().value().length == 0)
    if (pageRequest == null || pageRequest.getCookie().length() == 0)
    {
      // Fetch the base entry.
      Entry baseEntry = null;
@@ -1284,7 +1206,7 @@
            // Indicate no more pages.
            PagedResultsControl control;
            control = new PagedResultsControl(pageRequest.isCritical(), 0,
                                              new ASN1OctetString());
                null);
            searchOperation.getResponseControls().add(control);
          }
        }
@@ -1312,7 +1234,7 @@
    // Set the starting value.
    byte[] begin;
    if (pageRequest != null && pageRequest.getCookie().value().length != 0)
    if (pageRequest != null && pageRequest.getCookie().length() != 0)
    {
      // The cookie contains the DN of the next entry to be returned.
      try
@@ -1326,7 +1248,7 @@
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        String str = StaticUtils.bytesToHex(pageRequest.getCookie().value());
        String str = pageRequest.getCookie().toHex();
        Message msg = ERR_JEB_INVALID_PAGED_RESULTS_COOKIE.get(str);
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
                                     msg, e);
@@ -1377,7 +1299,7 @@
          // We have found a subordinate entry.
          EntryID entryID = new EntryID(data);
          DN dn = DN.decode(new ASN1OctetString(key.getData()));
          DN dn = DN.decode(ByteString.wrap(key.getData()));
          boolean isInScope = true;
          if (searchScope == SearchScope.SINGLE_LEVEL)
@@ -1425,7 +1347,7 @@
                  {
                    // The current page is full.
                    // Set the cookie to remember where we were.
                    ASN1OctetString cookie = new ASN1OctetString(key.getData());
                    ByteString cookie = ByteString.wrap(key.getData());
                    PagedResultsControl control;
                    control = new PagedResultsControl(pageRequest.isCritical(),
                                                      0, cookie);
@@ -1468,8 +1390,7 @@
    {
      // Indicate no more pages.
      PagedResultsControl control;
      control = new PagedResultsControl(pageRequest.isCritical(), 0,
                                        new ASN1OctetString());
      control = new PagedResultsControl(pageRequest.isCritical(), 0, null);
      searchOperation.getResponseControls().add(control);
    }
@@ -1511,12 +1432,12 @@
    // Set the starting value.
    EntryID begin = null;
    if (pageRequest != null && pageRequest.getCookie().value().length != 0)
    if (pageRequest != null && pageRequest.getCookie().length() != 0)
    {
      // The cookie contains the ID of the next entry to be returned.
      try
      {
        begin = new EntryID(new DatabaseEntry(pageRequest.getCookie().value()));
        begin = new EntryID(pageRequest.getCookie().toLong());
      }
      catch (Exception e)
      {
@@ -1524,7 +1445,7 @@
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        String str = StaticUtils.bytesToHex(pageRequest.getCookie().value());
        String str = pageRequest.getCookie().toHex();
        Message msg = ERR_JEB_INVALID_PAGED_RESULTS_COOKIE.get(str);
        throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM,
                                     msg, e);
@@ -1652,7 +1573,7 @@
                    // The current page is full.
                    // Set the cookie to remember where we were.
                    byte[] cookieBytes = id.getDatabaseEntry().getData();
                    ASN1OctetString cookie = new ASN1OctetString(cookieBytes);
                    ByteString cookie = ByteString.wrap(cookieBytes);
                    PagedResultsControl control;
                    control = new PagedResultsControl(pageRequest.isCritical(),
                                                      0, cookie);
@@ -1727,8 +1648,7 @@
    {
      // Indicate no more pages.
      PagedResultsControl control;
      control = new PagedResultsControl(pageRequest.isCritical(), 0,
                                        new ASN1OctetString());
      control = new PagedResultsControl(pageRequest.isCritical(), 0, null);
      searchOperation.getResponseControls().add(control);
    }
@@ -1926,20 +1846,12 @@
      // Determine whether this is a subtree delete.
      boolean isSubtreeDelete = false;
      if(deleteOperation != null)
      {
        List<Control> controls = deleteOperation.getRequestControls();
        if (controls != null)
        {
          for (Control control : controls)
          {
            if (control.getOID().equals(OID_SUBTREE_DELETE_CONTROL))
      if (deleteOperation != null
          && deleteOperation
              .getRequestControl(SubtreeDeleteControl.DECODER) != null)
            {
              isSubtreeDelete = true;
            }
          }
        }
      }
      /*
      * We will iterate backwards through a range of the dn2id keys to
@@ -2020,7 +1932,7 @@
          * we have been deleting from the bottom of the tree upwards.
          */
          EntryID entryID = new EntryID(data);
          DN subordinateDN = DN.decode(new ASN1OctetString(key.getData()));
          DN subordinateDN = DN.decode(ByteString.wrap(key.getData()));
          deleteEntry(txn, indexBuffer, true, entryDN, subordinateDN, entryID);
          subordinateEntriesDeleted++;
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EntryIDSetSorter.java
@@ -39,14 +39,7 @@
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.SearchOperation;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.ResultCode;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.SearchScope;
import org.opends.server.types.SortOrder;
import org.opends.server.types.*;
import static org.opends.messages.JebMessages.*;
import static org.opends.server.util.StaticUtils.*;
@@ -206,8 +199,9 @@
      }
      else
      {
        AttributeValue assertionValue = new
             AttributeValue(sortOrder.getSortKeys()[0].getAttributeType(),
        AttributeValue assertionValue =
            AttributeValues.create(
                sortOrder.getSortKeys()[0].getAttributeType(),
                            vlvRequest.getGreaterThanOrEqualAssertion());
        boolean targetFound     = false;
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/EqualityIndexer.java
@@ -172,7 +172,7 @@
      {
        try
        {
          byte[] keyBytes = value.getNormalizedValue().value();
          byte[] keyBytes = value.getNormalizedValue().toByteArray();
          keys.add(keyBytes);
        }
@@ -207,7 +207,7 @@
      {
        try
        {
          byte[] keyBytes = value.getNormalizedValue().value();
          byte[] keyBytes = value.getNormalizedValue().toByteArray();
          Boolean cInsert = modifiedKeys.get(keyBytes);
          if(cInsert == null)
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ExportJob.java
@@ -34,16 +34,13 @@
import com.sleepycat.je.LockMode;
import com.sleepycat.je.OperationStatus;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.util.LDIFException;
import org.opends.server.util.StaticUtils;
import java.io.IOException;
import java.util.*;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.server.loggers.ErrorLogger.logError;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -238,7 +235,7 @@
        Entry entry = null;
        try
        {
          entry = JebFormat.entryFromDatabase(data.getData(),
          entry = ID2Entry.entryFromDatabase(ByteString.wrap(data.getData()),
                       entryContainer.getRootContainer().getCompressedSchema());
        }
        catch (Exception e)
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/ID2Entry.java
@@ -33,9 +33,16 @@
import com.sleepycat.je.*;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.*;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.protocols.asn1.ASN1;
import org.opends.server.protocols.asn1.ASN1Reader;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.api.CompressedSchema;
import java.io.IOException;
import java.util.zip.DataFormatException;
/**
 * Represents the database containing the LDAP entries. The database key is
@@ -54,6 +61,139 @@
   */
  private DataConfig dataConfig;
  private static ThreadLocal<EntryCoder> entryCodingBuffers =
      new ThreadLocal<EntryCoder>();
  /**
   * A cached set of ByteStringBuilder buffers and ASN1Writer used to encode
   * entries.
   */
  private static class EntryCoder
  {
    ByteStringBuilder encodedBuffer;
    private ByteStringBuilder entryBuffer;
    private ByteStringBuilder compressedEntryBuffer;
    private ASN1Writer writer;
    private EntryCoder()
    {
      encodedBuffer = new ByteStringBuilder();
      entryBuffer = new ByteStringBuilder();
      compressedEntryBuffer = new ByteStringBuilder();
      writer = ASN1.getWriter(encodedBuffer);
    }
    private Entry decode(ByteString bytes, CompressedSchema compressedSchema)
        throws DirectoryException,ASN1Exception,LDAPException,
        DataFormatException, IOException
    {
      // Get the format version.
      byte formatVersion = bytes.byteAt(0);
      if(formatVersion != JebFormat.FORMAT_VERSION)
      {
        Message message =
            ERR_JEB_INCOMPATIBLE_ENTRY_VERSION.get(formatVersion);
        throw new ASN1Exception(message);
      }
      // Read the ASN1 sequence.
      ASN1Reader reader = ASN1.getReader(bytes.subSequence(1, bytes.length()));
      reader.readStartSequence();
      // See if it was compressed.
      int uncompressedSize = (int)reader.readInteger();
      if(uncompressedSize > 0)
      {
        // We will use the cached buffers to avoid allocations.
        // Reset the buffers;
        entryBuffer.clear();
        compressedEntryBuffer.clear();
        // It was compressed.
        reader.readOctetString(compressedEntryBuffer);
        CryptoManager cryptoManager = DirectoryServer.getCryptoManager();
        // TODO: Should handle the case where uncompress returns < 0
        compressedEntryBuffer.uncompress(entryBuffer, cryptoManager,
            uncompressedSize);
        // Since we are used the cached buffers (ByteStringBuilders),
        // the decoded attribute values will not refer back to the
        // original buffer.
        return Entry.decode(entryBuffer.asReader(), compressedSchema);
      }
      else
      {
        // Since we don't have to do any decompression, we can just decode
        // the entry off the
        ByteString encodedEntry = reader.readOctetString();
        return Entry.decode(encodedEntry.asReader(), compressedSchema);
      }
    }
    private ByteString encodeCopy(Entry entry, DataConfig dataConfig)
        throws DirectoryException
    {
      encodeVolatile(entry, dataConfig);
      return encodedBuffer.toByteString();
    }
    private DatabaseEntry encodeInternal(Entry entry, DataConfig dataConfig)
        throws DirectoryException
    {
      encodeVolatile(entry, dataConfig);
      return new DatabaseEntry(encodedBuffer.getBackingArray(), 0,
          encodedBuffer.length());
    }
    private void encodeVolatile(Entry entry, DataConfig dataConfig)
        throws DirectoryException
    {
      // Reset the buffers;
      encodedBuffer.clear();
      entryBuffer.clear();
      compressedEntryBuffer.clear();
      // Encode the entry for later use.
      entry.encode(entryBuffer, dataConfig.getEntryEncodeConfig());
      // First write the DB format version byte.
      encodedBuffer.append(JebFormat.FORMAT_VERSION);
      try
      {
        // Then start the ASN1 sequence.
        writer.writeStartSequence(JebFormat.TAG_DATABASE_ENTRY);
        // Do optional compression.
        CryptoManager cryptoManager = DirectoryServer.getCryptoManager();
        if (dataConfig.isCompressed() && cryptoManager != null &&
            entryBuffer.compress(compressedEntryBuffer, cryptoManager))
        {
          // Compression needed and successful.
          writer.writeInteger(entryBuffer.length());
          writer.writeOctetString(compressedEntryBuffer);
        }
        else
        {
          writer.writeInteger(0);
          writer.writeOctetString(entryBuffer);
        }
        writer.writeEndSequence();
      }
      catch(IOException ioe)
      {
        // TODO: This should never happen with byte buffer.
        if(debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, ioe);
        }
      }
    }
  }
  /**
   * Create a new ID2Entry object.
   *
@@ -96,20 +236,75 @@
  }
  /**
   * Convert an entry to its database format.
   * Decodes an entry from its database representation.
   * <p>
   * An entry on disk is ASN1 encoded in this format:
   *
   * @param entry The LDAP entry to be converted.
   * @return The database entry.
   * <pre>
   * DatabaseEntry ::= [APPLICATION 0] IMPLICIT SEQUENCE {
   *  uncompressedSize      INTEGER,      -- A zero value means not compressed.
   *  dataBytes             OCTET STRING  -- Optionally compressed encoding of
   *                                         the data bytes.
   * }
   *
   * ID2EntryValue ::= DatabaseEntry
   *  -- Where dataBytes contains an encoding of DirectoryServerEntry.
   *
   * DirectoryServerEntry ::= [APPLICATION 1] IMPLICIT SEQUENCE {
   *  dn                      LDAPDN,
   *  objectClasses           SET OF LDAPString,
   *  userAttributes          AttributeList,
   *  operationalAttributes   AttributeList
   * }
   * </pre>
   *
   * @param bytes A byte array containing the encoded database value.
   * @param compressedSchema The compressed schema manager to use when decoding.
   * @return The decoded entry.
   * @throws ASN1Exception If the data is not in the expected ASN.1 encoding
   * format.
   * @throws LDAPException If the data is not in the expected ASN.1 encoding
   * format.
   * @throws DataFormatException If an error occurs while trying to decompress
   * compressed data.
   * @throws DirectoryException If a Directory Server error occurs.
   * @throws IOException if an error occurs while reading the ASN1 sequence.
   */
  static public Entry entryFromDatabase(ByteString bytes,
                                        CompressedSchema compressedSchema)
      throws DirectoryException,ASN1Exception,LDAPException,
      DataFormatException,IOException
  {
    EntryCoder coder = entryCodingBuffers.get();
    if(coder == null)
    {
      coder = new EntryCoder();
      entryCodingBuffers.set(coder);
    }
    return coder.decode(bytes, compressedSchema);
  }
  /**
   * Encodes an entry to the raw database format, with optional compression.
   *
   * @param entry The entry to encode.
   * @param dataConfig Compression and cryptographic options.
   * @return A ByteSTring containing the encoded database value.
   *
   * @throws  DirectoryException  If a problem occurs while attempting to encode
   *                              the entry.
   */
  public DatabaseEntry entryData(Entry entry)
  static public ByteString entryToDatabase(Entry entry, DataConfig dataConfig)
          throws DirectoryException
  {
    byte[] entryBytes;
    entryBytes = JebFormat.entryToDatabase(entry, dataConfig);
    return new DatabaseEntry(entryBytes);
    EntryCoder coder = entryCodingBuffers.get();
    if(coder == null)
    {
      coder = new EntryCoder();
      entryCodingBuffers.set(coder);
    }
    return coder.encodeCopy(entry, dataConfig);
  }
  /**
@@ -128,7 +323,13 @@
       throws DatabaseException, DirectoryException
  {
    DatabaseEntry key = id.getDatabaseEntry();
    DatabaseEntry data = entryData(entry);
    EntryCoder coder = entryCodingBuffers.get();
    if(coder == null)
    {
      coder = new EntryCoder();
      entryCodingBuffers.set(coder);
    }
    DatabaseEntry data = coder.encodeInternal(entry, dataConfig);
    OperationStatus status;
    status = insert(txn, key, data);
@@ -154,7 +355,13 @@
       throws DatabaseException, DirectoryException
  {
    DatabaseEntry key = id.getDatabaseEntry();
    DatabaseEntry data = entryData(entry);
    EntryCoder coder = entryCodingBuffers.get();
    if(coder == null)
    {
      coder = new EntryCoder();
      entryCodingBuffers.set(coder);
    }
    DatabaseEntry data = coder.encodeInternal(entry, dataConfig);
    OperationStatus status;
    status = put(txn, key, data);
@@ -231,20 +438,12 @@
      return null;
    }
    byte[] entryBytes = data.getData();
    byte entryVersion = JebFormat.getEntryVersion(entryBytes);
    //Try to decode the entry based on the version number. On later versions,
    //a case could be written to upgrade entries if it is not the current
    //version
    Entry entry = null;
    switch(entryVersion)
    {
      case JebFormat.FORMAT_VERSION :
        try
        {
          entry = JebFormat.entryFromDatabase(entryBytes,
      Entry entry = entryFromDatabase(ByteString.wrap(data.getData()),
                       entryContainer.getRootContainer().getCompressedSchema());
      entry.processVirtualAttributes();
      return entry;
        }
        catch (Exception e)
        {
@@ -252,23 +451,6 @@
          throw new DirectoryException(
              DirectoryServer.getServerErrorResultCode(), message);
        }
        break;
      //case 0x00                     :
      //  Call upgrade method? Call 0x00 decode method?
      default   :
        Message message =
            ERR_JEB_INCOMPATIBLE_ENTRY_VERSION.get(id.toString(), entryVersion);
        throw new DirectoryException(
              DirectoryServer.getServerErrorResultCode(), message);
    }
    if (entry != null)
    {
      entry.processVirtualAttributes();
    }
    return entry;
  }
  /**
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexQuery.java
@@ -25,13 +25,15 @@
 *      Copyright 2009 Sun Microsystems, Inc.
 */
package org.opends.server.backends.jeb;
import java.util.Collection;
import static org.opends.server.backends.jeb.IndexFilter.*;
/**
 * This class represents a JE Backend Query.
 */
@@ -44,6 +46,7 @@
{
  /**
  * Evaluates the index query and returns the EntryIDSet.
   *
  * @return The EntryIDSet as a result of evaulation of this query.
  */
  public abstract EntryIDSet evaluate();
@@ -51,9 +54,11 @@
   /**
    * Creates an IntersectionIndexQuery object from a collection of IndexQuery
    * objects.
    * @param subIndexQueries A collection of IndexQuery objects.
   * Creates an IntersectionIndexQuery object from a collection of
   * IndexQuery objects.
   *
   * @param subIndexQueries
   *          A collection of IndexQuery objects.
    * @return An IntersectionIndexQuery object.
    */
   public static IndexQuery createIntersectionIndexQuery(
@@ -67,7 +72,9 @@
   /**
    * Creates a union IndexQuery object from a collection of IndexQuery
    * objects.
    * @param subIndexQueries Collection of IndexQuery objects.
   *
   * @param subIndexQueries
   *          Collection of IndexQuery objects.
    * @return A UnionIndexQuery object.
    */
   public static IndexQuery createUnionIndexQuery(
@@ -80,23 +87,23 @@
   /**
    * Creates an empty IndexQuery object.
   *
    * @return A NullIndexQuery object.
    */
   public static IndexQuery createNullIndexQuery()
   {
     return new NullIndexQuery();
   }
}
/**
* This class creates a Null  IndexQuery. It is used when there
*  is no record in the index. It may also be used when the
 * index contains all the records but an empty EntryIDSet should be
 * returned as part of the optimization.
   * This class creates a Null IndexQuery. It is used when there is no
   * record in the index. It may also be used when the index contains
   * all the records but an empty EntryIDSet should be returned as part
   * of the optimization.
*/
final class NullIndexQuery extends IndexQuery
  private static final class NullIndexQuery extends IndexQuery
{
  /**
   * {@inheritDoc}
@@ -108,15 +115,11 @@
  }
}
/**
 * This class creates an intersection IndexQuery from a collection of
 * IndexQuery objects.
 */
final class IntersectionIndexQuery extends IndexQuery
  private static final class IntersectionIndexQuery extends IndexQuery
{
  /**
   * Collection of IndexQuery objects.
@@ -124,16 +127,20 @@
  private final  Collection<IndexQuery> subIndexQueries;
  /**
   * Creates an instance of IntersectionIndexQuery.
   * @param subIndexQueries Collection of IndexQuery objects.
     *
     * @param subIndexQueries
     *          Collection of IndexQuery objects.
   */
  IntersectionIndexQuery(Collection<IndexQuery> subIndexQueries)
    private IntersectionIndexQuery(Collection<IndexQuery> subIndexQueries)
  {
    this.subIndexQueries = subIndexQueries;
  }
  /**
   * {@inheritDoc}
   */
@@ -151,8 +158,8 @@
     {
       entryIDs.retainAll(query.evaluate());
     }
     if (entryIDs.isDefined() &&
         entryIDs.size() <= FILTER_CANDIDATE_THRESHOLD)
        if (entryIDs.isDefined()
            && entryIDs.size() <= FILTER_CANDIDATE_THRESHOLD)
     {
       break;
     }
@@ -164,23 +171,28 @@
/**
 * This class creates a union of IndexQuery objects.
 */
final class UnionIndexQuery extends IndexQuery
  private static final class UnionIndexQuery extends IndexQuery
{
  /**
   * Collection containing IndexQuery objects.
   */
  private final Collection<IndexQuery> subIndexQueries;
  /**
   * Creates an instance of UnionIndexQuery.
   * @param subIndexQueries The Collection of IndexQuery objects.
     *
     * @param subIndexQueries
     *          The Collection of IndexQuery objects.
   */
  UnionIndexQuery(Collection<IndexQuery> subIndexQueries)
    private UnionIndexQuery(Collection<IndexQuery> subIndexQueries)
  {
    this.subIndexQueries = subIndexQueries;
  }
  /**
   * {@inheritDoc}
   */
@@ -198,8 +210,8 @@
      {
        entryIDs.addAll(query.evaluate());
      }
      if (entryIDs.isDefined() &&
          entryIDs.size() <= FILTER_CANDIDATE_THRESHOLD)
        if (entryIDs.isDefined()
            && entryIDs.size() <= FILTER_CANDIDATE_THRESHOLD)
      {
        break;
      }
@@ -207,3 +219,4 @@
    return entryIDs;
  }
}
}
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexQueryFactoryImpl.java
@@ -25,24 +25,29 @@
 *      Copyright 2009 Sun Microsystems, Inc.
 */
package org.opends.server.backends.jeb;
import com.sleepycat.je.DatabaseEntry;
import com.sleepycat.je.LockMode;
import java.util.Collection;
import java.util.Map;
import org.opends.server.api.IndexQueryFactory;
import org.opends.server.types.ByteSequence;
/**
 * This class is an implementation of IndexQueryFactory which creates
 * IndexQuery objects as part of the query of the JEB index.
*/
public final class IndexQueryFactoryImpl
        implements IndexQueryFactory<IndexQuery>
public final class IndexQueryFactoryImpl implements
    IndexQueryFactory<IndexQuery>
{
  /**
   * The Map containing the string type identifier and the corresponding index.
   * The Map containing the string type identifier and the corresponding
   * index.
   */
  private Map<String,Index> indexMap;
@@ -50,7 +55,9 @@
  /**
   * Creates a new IndexQueryFactoryImpl object.
   * @param indexMap A map containing the index id and the corresponding index.
   *
   * @param indexMap
   *          A map containing the index id and the corresponding index.
   */
  public IndexQueryFactoryImpl(Map<String,Index> indexMap)
  {
@@ -63,7 +70,7 @@
   *{@inheritDoc}
   */
  public IndexQuery createExactMatchQuery(final String indexID,
          final byte[] value)
      final ByteSequence value)
  {
    return new IndexQuery()
    {
@@ -72,10 +79,12 @@
      public EntryIDSet evaluate()
      {
        //Read the database and get Record for the key.
        DatabaseEntry key = new DatabaseEntry(value);
          DatabaseEntry key = new DatabaseEntry(value.toByteArray());
        //Select the right index to be used.
        Index index = indexMap.get(indexID);
        EntryIDSet entrySet = index.readKey(key,null,LockMode.DEFAULT);
          EntryIDSet entrySet =
              index.readKey(key, null, LockMode.DEFAULT);
        return entrySet;
      }
    };
@@ -86,12 +95,9 @@
  /**
   *{@inheritDoc}
   */
  public IndexQuery createRangeMatchQuery(
                                              final String indexID,
                                              final byte[] lowerBound,
                                              final byte[] upperBound,
                                              final boolean includeLowerBound,
                                              final boolean includeUpperBound)
  public IndexQuery createRangeMatchQuery(final String indexID,
      final ByteSequence lowerBound, final ByteSequence upperBound,
      final boolean includeLowerBound, final boolean includeUpperBound)
  {
    return new IndexQuery()
    {
@@ -101,9 +107,9 @@
      {
        //Find the right index.
        Index index = indexMap.get(indexID);
        EntryIDSet entrySet =   index.readRange(lowerBound,upperBound,
                includeLowerBound,
            includeUpperBound);
          EntryIDSet entrySet =
              index.readRange(lowerBound.toByteArray(), upperBound
                  .toByteArray(), includeLowerBound, includeUpperBound);
        return entrySet;
      }
    };
@@ -114,8 +120,8 @@
  /**
   *{@inheritDoc}
   */
  public IndexQuery  createIntersectionQuery(Collection<IndexQuery>
                                                                subqueries)
  public IndexQuery createIntersectionQuery(
      Collection<IndexQuery> subqueries)
  {
    return IndexQuery.createIntersectionIndexQuery(subqueries);
  }
@@ -134,8 +140,9 @@
  /**
   *{@inheritDoc}
   * It returns an empty EntryIDSet object  when either all or no record sets
   * are requested.
   * <p>
   * It returns an empty EntryIDSet object when either all or no record
   * sets are requested.
   */
  public IndexQuery createMatchAllQuery()
  {
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java
@@ -389,7 +389,8 @@
        try
        {
          EntryID entryID = new EntryID(key);
          Entry entry = JebFormat.entryFromDatabase(data.getData(),
          Entry entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                             ec.getRootContainer().getCompressedSchema());
          // Insert into dn2id.
@@ -472,7 +473,8 @@
        try
        {
          EntryID entryID = new EntryID(key);
          Entry entry = JebFormat.entryFromDatabase(data.getData(),
          Entry entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                             ec.getRootContainer().getCompressedSchema());
          // Insert into dn2uri.
@@ -558,7 +560,8 @@
        try
        {
          EntryID entryID = new EntryID(key);
          Entry entry = JebFormat.entryFromDatabase(data.getData(),
          Entry entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                             ec.getRootContainer().getCompressedSchema());
          // Check that the parent entry exists.
@@ -671,7 +674,8 @@
        try
        {
          EntryID entryID = new EntryID(key);
          Entry entry = JebFormat.entryFromDatabase(data.getData(),
          Entry entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                             ec.getRootContainer().getCompressedSchema());
          // Check that the parent entry exists.
@@ -809,7 +813,8 @@
        try
        {
          EntryID entryID = new EntryID(key);
          Entry entry = JebFormat.entryFromDatabase(data.getData(),
          Entry entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                             ec.getRootContainer().getCompressedSchema());
          // Insert into attribute indexType.
@@ -887,7 +892,8 @@
        try
        {
          EntryID entryID = new EntryID(key);
          Entry entry = JebFormat.entryFromDatabase(data.getData(),
          Entry entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                             ec.getRootContainer().getCompressedSchema());
          // Insert into attribute indexType.
@@ -973,7 +979,8 @@
        try
        {
          EntryID entryID = new EntryID(key);
          Entry entry = JebFormat.entryFromDatabase(data.getData(),
          Entry entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                             ec.getRootContainer().getCompressedSchema());
          // Insert into attribute indexType.
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/JECompressedSchema.java
@@ -32,31 +32,20 @@
import static org.opends.server.loggers.debug.DebugLogger.*;
import static org.opends.server.util.StaticUtils.*;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.io.IOException;
import org.opends.messages.Message;
import org.opends.server.api.CompressedSchema;
import org.opends.server.core.DirectoryServer;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.Attributes;
import org.opends.server.types.ByteArray;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ObjectClass;
import org.opends.server.protocols.asn1.*;
import org.opends.server.types.*;
import com.sleepycat.je.Cursor;
import com.sleepycat.je.Database;
@@ -107,21 +96,22 @@
  private AtomicInteger ocCounter;
  // The map between encoded representations and attribute types.
  private ConcurrentHashMap<ByteArray,AttributeType> atDecodeMap;
  private ConcurrentHashMap<ByteSequence,AttributeType> atDecodeMap;
  // The map between encoded representations and attribute options.
  private ConcurrentHashMap<ByteArray,Set<String>> aoDecodeMap;
  private ConcurrentHashMap<ByteSequence,Set<String>> aoDecodeMap;
  // The map between encoded representations and object class sets.
  private ConcurrentHashMap<ByteArray,Map<ObjectClass,String>> ocDecodeMap;
  private ConcurrentHashMap<ByteSequence,Map<ObjectClass,String>> ocDecodeMap;
  // The map between attribute descriptions and their encoded
  // representations.
  private ConcurrentHashMap<AttributeType,
               ConcurrentHashMap<Set<String>,ByteArray>> adEncodeMap;
  private final ConcurrentHashMap<AttributeType,
                ConcurrentHashMap<Set<String>, ByteSequence>> adEncodeMap;
  // The map between object class sets and encoded representations.
  private ConcurrentHashMap<Map<ObjectClass,String>,ByteArray> ocEncodeMap;
  private final ConcurrentHashMap<Map<ObjectClass,String>,
      ByteSequence> ocEncodeMap;
  // The compressed attribute description schema database.
  private Database adDatabase;
@@ -132,6 +122,9 @@
  // The environment in which the databases are held.
  private Environment environment;
  private final ByteStringBuilder storeWriterBuffer;
  private final ASN1Writer storeWriter;
  /**
@@ -149,17 +142,21 @@
  {
    this.environment = environment;
    atDecodeMap = new ConcurrentHashMap<ByteArray,AttributeType>();
    aoDecodeMap = new ConcurrentHashMap<ByteArray,Set<String>>();
    ocDecodeMap = new ConcurrentHashMap<ByteArray,Map<ObjectClass,String>>();
    atDecodeMap = new ConcurrentHashMap<ByteSequence,AttributeType>();
    aoDecodeMap = new ConcurrentHashMap<ByteSequence,Set<String>>();
    ocDecodeMap = new ConcurrentHashMap<ByteSequence,Map<ObjectClass,String>>();
    adEncodeMap =
         new ConcurrentHashMap<AttributeType,
                  ConcurrentHashMap<Set<String>,ByteArray>>();
    ocEncodeMap = new ConcurrentHashMap<Map<ObjectClass,String>,ByteArray>();
                  ConcurrentHashMap<Set<String>, ByteSequence>>();
    ocEncodeMap = new ConcurrentHashMap<Map<ObjectClass,String>,
        ByteSequence>();
    adCounter = new AtomicInteger(1);
    ocCounter = new AtomicInteger(1);
    storeWriterBuffer = new ByteStringBuilder();
    storeWriter = ASN1.getWriter(storeWriterBuffer);
    load();
  }
@@ -211,21 +208,23 @@
                                                 LockMode.READ_UNCOMMITTED);
      while (status == OperationStatus.SUCCESS)
      {
        ByteArray token = new ByteArray(keyEntry.getData());
        highestToken = Math.max(highestToken, decodeInt(token.array()));
        byte[] tokenBytes = keyEntry.getData();
        ByteString token = ByteString.wrap(tokenBytes);
        highestToken = Math.max(highestToken, decodeInt(tokenBytes));
        ArrayList<ASN1Element> elements =
             ASN1Sequence.decodeAsSequence(valueEntry.getData()).elements();
        ASN1Reader reader =
            ASN1.getReader(valueEntry.getData());
        reader.readStartSequence();
        LinkedHashMap<ObjectClass,String> ocMap =
             new LinkedHashMap<ObjectClass,String>(elements.size());
        for (int i=0; i < elements.size(); i++)
             new LinkedHashMap<ObjectClass,String>();
        while(reader.hasNextElement())
        {
          ASN1OctetString os = elements.get(i).decodeAsOctetString();
          String ocName = os.stringValue();
          String ocName = reader.readOctetStringAsString();
          String lowerName = toLowerCase(ocName);
          ObjectClass oc = DirectoryServer.getObjectClass(lowerName, true);
          ocMap.put(oc, ocName);
        }
        reader.readEndSequence();
        ocEncodeMap.put(ocMap, token);
        ocDecodeMap.put(token, ocMap);
@@ -266,34 +265,34 @@
                                                 LockMode.READ_UNCOMMITTED);
      while (status == OperationStatus.SUCCESS)
      {
        ByteArray token = new ByteArray(keyEntry.getData());
        highestToken = Math.max(highestToken, decodeInt(token.array()));
        byte[] tokenBytes = keyEntry.getData();
        ByteString token = ByteString.wrap(tokenBytes);
        highestToken = Math.max(highestToken, decodeInt(tokenBytes));
        ArrayList<ASN1Element> elements =
             ASN1Sequence.decodeAsSequence(valueEntry.getData()).elements();
        ASN1OctetString os = elements.get(0).decodeAsOctetString();
        String attrName = os.stringValue();
        ASN1Reader reader =
            ASN1.getReader(valueEntry.getData());
        reader.readStartSequence();
        String attrName = reader.readOctetStringAsString();
        String lowerName = toLowerCase(attrName);
        AttributeType attrType =
             DirectoryServer.getAttributeType(lowerName, true);
        LinkedHashSet<String> options =
             new LinkedHashSet<String>(elements.size()-1);
        for (int i=1; i < elements.size(); i++)
            new LinkedHashSet<String>();
        while(reader.hasNextElement())
        {
          os = elements.get(i).decodeAsOctetString();
          options.add(os.stringValue());
          options.add(reader.readOctetStringAsString());
        }
        reader.readEndSequence();
        atDecodeMap.put(token, attrType);
        aoDecodeMap.put(token, options);
        ConcurrentHashMap<Set<String>,ByteArray> map =
             adEncodeMap.get(attrType);
        ConcurrentHashMap<Set<String>, ByteSequence> map = adEncodeMap
            .get(attrType);
        if (map == null)
        {
          map = new ConcurrentHashMap<Set<String>,ByteArray>(1);
          map = new ConcurrentHashMap<Set<String>, ByteSequence>(1);
          map.put(options, token);
          adEncodeMap.put(attrType, map);
        }
@@ -359,8 +358,8 @@
    atDecodeMap = null;
    aoDecodeMap = null;
    ocDecodeMap = null;
    adEncodeMap = null;
    ocEncodeMap = null;
    //adEncodeMap = null;
    //ocEncodeMap = null;
    adCounter   = null;
    ocCounter   = null;
  }
@@ -371,56 +370,43 @@
   * {@inheritDoc}
   */
  @Override()
  public byte[] encodeObjectClasses(Map<ObjectClass,String> objectClasses)
  public void encodeObjectClasses(ByteStringBuilder entryBuffer,
                                  Map<ObjectClass,String> objectClasses)
         throws DirectoryException
  {
    ByteArray encodedClasses = ocEncodeMap.get(objectClasses);
    ByteSequence encodedClasses = ocEncodeMap.get(objectClasses);
    if (encodedClasses == null)
    {
      synchronized (ocEncodeMap)
      {
        int setValue = ocCounter.getAndIncrement();
        byte[] tokenArray = encodeInt(setValue);
        encodedClasses = ByteString.wrap(tokenArray);
        ArrayList<ASN1Element> elements =
             new ArrayList<ASN1Element>(objectClasses.size());
        for (String ocName : objectClasses.values())
        {
          elements.add(new ASN1OctetString(ocName));
        }
        byte[] encodedOCs = new ASN1Sequence(elements).encode();
        store(ocDatabase, tokenArray, encodedOCs);
        encodedClasses = new ByteArray(tokenArray);
        storeObjectClass(tokenArray, objectClasses);
        ocEncodeMap.put(objectClasses, encodedClasses);
        ocDecodeMap.put(encodedClasses, objectClasses);
        return tokenArray;
      }
    }
    else
    {
      return encodedClasses.array();
    }
  }
    entryBuffer.appendBERLength(encodedClasses.length());
    encodedClasses.copyTo(entryBuffer);
  }
  /**
   * {@inheritDoc}
   */
  @Override()
  public Map<ObjectClass,String> decodeObjectClasses(
                                      byte[] encodedObjectClasses)
         throws DirectoryException
      ByteSequenceReader entryBufferReader) throws DirectoryException
  {
    ByteArray byteArray = new ByteArray(encodedObjectClasses);
    int tokenLength = entryBufferReader.getBERLength();
    ByteSequence byteArray = entryBufferReader.getByteSequence(tokenLength);
    Map<ObjectClass,String> ocMap = ocDecodeMap.get(byteArray);
    if (ocMap == null)
    {
      Message message = ERR_JEB_COMPSCHEMA_UNKNOWN_OC_TOKEN.get(
                             bytesToHex(encodedObjectClasses));
      Message message = ERR_JEB_COMPSCHEMA_UNKNOWN_OC_TOKEN.get(byteArray
          .toByteString().toHex());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                   message);
    }
@@ -430,52 +416,90 @@
    }
  }
  private void storeObjectClass(byte[] token,
                                Map<ObjectClass,String> objectClasses)
      throws DirectoryException
  {
    synchronized(storeWriter)
    {
      try
      {
        storeWriterBuffer.clear();
        storeWriter.writeStartSequence();
        for (String ocName : objectClasses.values())
        {
          storeWriter.writeOctetString(ocName);
        }
        storeWriter.writeEndSequence();
        store(ocDatabase, token, storeWriterBuffer);
      }
      catch(IOException ioe)
      {
        // TODO: Shouldn't happen but should log a message
      }
    }
  }
  private void storeAttribute(byte[] token,
                              AttributeType attrType, Set<String> options)
      throws DirectoryException
  {
    synchronized(storeWriter)
    {
      try
      {
        storeWriterBuffer.clear();
        storeWriter.writeStartSequence();
        storeWriter.writeOctetString(attrType.getNameOrOID());
        for (String option : options)
        {
          storeWriter.writeOctetString(option);
        }
        storeWriter.writeEndSequence();
        store(adDatabase, token, storeWriterBuffer);
      }
      catch(IOException ioe)
      {
        // TODO: Shouldn't happen but should log a message
      }
    }
  }
  /**
   * {@inheritDoc}
   */
  @Override()
  public byte[] encodeAttribute(Attribute attribute)
         throws DirectoryException
  public void encodeAttribute(ByteStringBuilder entryBuffer,
                              Attribute attribute) throws DirectoryException
  {
    AttributeType type = attribute.getAttributeType();
    Set<String> options = attribute.getOptions();
    ConcurrentHashMap<Set<String>,ByteArray> map =
         adEncodeMap.get(type);
    ConcurrentHashMap<Set<String>, ByteSequence> map = adEncodeMap.get(type);
    if (map == null)
    {
      byte[] tokenArray;
      ByteString byteString;
      synchronized (adEncodeMap)
      {
        map = new ConcurrentHashMap<Set<String>,ByteArray>(1);
        map = new ConcurrentHashMap<Set<String>, ByteSequence>(1);
        int intValue = adCounter.getAndIncrement();
        tokenArray = encodeInt(intValue);
        ByteArray byteArray = new ByteArray(tokenArray);
        map.put(options,byteArray);
        byteString = ByteString.wrap(tokenArray);
        map.put(options,byteString);
        ArrayList<ASN1Element> elements =
             new ArrayList<ASN1Element>(options.size()+1);
        elements.add(new ASN1OctetString(attribute.getName()));
        for (String option : options)
        {
          elements.add(new ASN1OctetString(option));
        }
        byte[] encodedValue = new ASN1Sequence(elements).encode();
        store(adDatabase, tokenArray, encodedValue);
        storeAttribute(tokenArray, type, options);
        adEncodeMap.put(type, map);
        atDecodeMap.put(byteArray, type);
        aoDecodeMap.put(byteArray, options);
        atDecodeMap.put(byteString, type);
        aoDecodeMap.put(byteString, options);
      }
      return encodeAttribute(tokenArray, attribute);
      encodeAttribute(entryBuffer, byteString, attribute);
    }
    else
    {
      ByteArray byteArray = map.get(options);
      ByteSequence byteArray = map.get(options);
      if (byteArray == null)
      {
        byte[] tokenArray;
@@ -483,29 +507,16 @@
        {
          int intValue = adCounter.getAndIncrement();
          tokenArray = encodeInt(intValue);
          byteArray = new ByteArray(tokenArray);
          byteArray = ByteString.wrap(tokenArray);
          map.put(options,byteArray);
          ArrayList<ASN1Element> elements =
               new ArrayList<ASN1Element>(options.size()+1);
          elements.add(new ASN1OctetString(attribute.getName()));
          for (String option : options)
          {
            elements.add(new ASN1OctetString(option));
          }
          byte[] encodedValue = new ASN1Sequence(elements).encode();
          store(adDatabase, tokenArray, encodedValue);
          storeAttribute(tokenArray, type, options);
          atDecodeMap.put(byteArray, type);
          aoDecodeMap.put(byteArray, options);
        }
      }
        return encodeAttribute(tokenArray, attribute);
      }
      else
      {
        return encodeAttribute(byteArray.array(), attribute);
      }
      encodeAttribute(entryBuffer, byteArray, attribute);
    }
  }
@@ -515,126 +526,70 @@
   * Encodes the information in the provided attribute to a byte
   * array.
   *
   * @param  buffer     The byte buffer to encode the attribute into.
   * @param  adArray    The byte array that is a placeholder for the
   *                    attribute type and set of options.
   * @param  attribute  The attribute to be encoded.
   *
   * @return  An encoded representation of the provided attribute.
   */
  private byte[] encodeAttribute(byte[] adArray, Attribute attribute)
  private void encodeAttribute(ByteStringBuilder buffer, ByteSequence adArray,
                                 Attribute attribute)
  {
    int totalValuesLength = 0;
    byte[][] subArrays = new  byte[attribute.size()*2][];
    int pos = 0;
    // Write the length of the adArray followed by the adArray.
    buffer.appendBERLength(adArray.length());
    adArray.copyTo(buffer);
    // Write the number of attributes
    buffer.appendBERLength(attribute.size());
    // Write the attribute values as length / value pairs
    for (AttributeValue v : attribute)
    {
      byte[] vBytes = v.getValueBytes();
      byte[] lBytes = ASN1Element.encodeLength(vBytes.length);
      subArrays[pos++] = lBytes;
      subArrays[pos++] = vBytes;
      totalValuesLength += lBytes.length + vBytes.length;
      buffer.appendBERLength(v.getValue().length());
      buffer.append(v.getValue());
    }
    byte[] adArrayLength = ASN1Element.encodeLength(adArray.length);
    byte[] countBytes = ASN1Element.encodeLength(attribute.size());
    int totalLength = adArrayLength.length + adArray.length +
                      countBytes.length + totalValuesLength;
    byte[] array = new byte[totalLength];
    System.arraycopy(adArrayLength, 0, array, 0,
                     adArrayLength.length);
    pos = adArrayLength.length;
    System.arraycopy(adArray, 0, array, pos, adArray.length);
    pos += adArray.length;
    System.arraycopy(countBytes, 0, array, pos, countBytes.length);
    pos += countBytes.length;
    for (int i=0; i < subArrays.length; i++)
    {
      System.arraycopy(subArrays[i], 0, array, pos,
                       subArrays[i].length);
      pos += subArrays[i].length;
    }
    return array;
  }
  /**
   * {@inheritDoc}
   */
  @Override()
  public Attribute decodeAttribute(byte[] encodedEntry, int startPos,
                                   int length)
  public Attribute decodeAttribute(ByteSequenceReader entryBufferReader)
         throws DirectoryException
  {
    // Figure out how many bytes are in the token that is the placeholder for
    // the attribute description.
    int pos = startPos;
    int adArrayLength = encodedEntry[pos] & 0x7F;
    if (adArrayLength != encodedEntry[pos++])
    {
      int numLengthBytes = adArrayLength;
      adArrayLength = 0;
      for (int i=0; i < numLengthBytes; i++, pos++)
      {
        adArrayLength = (adArrayLength << 8) | (encodedEntry[pos] & 0xFF);
      }
    }
    int adArrayLength = entryBufferReader.getBERLength();
    // Get the attribute description token and make sure it resolves to an
    // attribute type and option set.
    ByteArray adArray = new ByteArray(new byte[adArrayLength]);
    System.arraycopy(encodedEntry, pos, adArray.array(), 0, adArrayLength);
    pos += adArrayLength;
    ByteSequence adArray = entryBufferReader.getByteSequence(adArrayLength);
    AttributeType attrType = atDecodeMap.get(adArray);
    Set<String> options = aoDecodeMap.get(adArray);
    if ((attrType == null) || (options == null))
    {
      Message message = ERR_JEB_COMPSCHEMA_UNRECOGNIZED_AD_TOKEN.get(
                             bytesToHex(adArray.array()));
      Message message = ERR_JEB_COMPSCHEMA_UNRECOGNIZED_AD_TOKEN.get(adArray
          .toByteString().toHex());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                   message);
    }
    // Determine the number of values for the attribute.
    int numValues = encodedEntry[pos] & 0x7F;
    if (numValues != encodedEntry[pos++])
    {
      int numValuesBytes = numValues;
      numValues = 0;
      for (int i=0; i < numValuesBytes; i++, pos++)
      {
        numValues = (numValues << 8) | (encodedEntry[pos] & 0xFF);
      }
    }
    int numValues = entryBufferReader.getBERLength();
    // For the common case of a single value with no options, generate
    // less garbage.
    if (numValues == 1 && options.isEmpty())
    {
      int valueLength = encodedEntry[pos] & 0x7F;
      if (valueLength != encodedEntry[pos++])
      {
        int valueLengthBytes = valueLength;
        valueLength = 0;
        for (int j = 0; j < valueLengthBytes; j++, pos++)
        {
          valueLength = (valueLength << 8) | (encodedEntry[pos] & 0xFF);
        }
      }
      int valueLength = entryBufferReader.getBERLength();
      byte[] valueBytes = new byte[valueLength];
      System.arraycopy(encodedEntry, pos, valueBytes, 0, valueLength);
      return Attributes.create(attrType, new AttributeValue(attrType,
          new ASN1OctetString(valueBytes)));
      ByteString valueBytes =
          entryBufferReader.getByteSequence(valueLength).toByteString();
      return Attributes.create(attrType,
          AttributeValues.create(attrType, valueBytes));
    }
    else
    {
@@ -644,30 +599,18 @@
      builder.setInitialCapacity(numValues);
      for (int i = 0; i < numValues; i++)
      {
        int valueLength = encodedEntry[pos] & 0x7F;
        if (valueLength != encodedEntry[pos++])
        {
          int valueLengthBytes = valueLength;
          valueLength = 0;
          for (int j = 0; j < valueLengthBytes; j++, pos++)
          {
            valueLength = (valueLength << 8) | (encodedEntry[pos] & 0xFF);
          }
        }
        int valueLength = entryBufferReader.getBERLength();
        byte[] valueBytes = new byte[valueLength];
        System.arraycopy(encodedEntry, pos, valueBytes, 0, valueLength);
        pos += valueLength;
        builder.add(new AttributeValue(attrType,
            new ASN1OctetString(valueBytes)));
        ByteString valueBytes =
            entryBufferReader.getByteSequence(valueLength).toByteString();
        builder.add(AttributeValues.create(attrType,
            valueBytes));
      }
      return builder.toAttribute();
    }
  }
  /**
   * Stores the provided key-value pair in the specified database container.
   *
@@ -678,12 +621,14 @@
   * @throws  DirectoryException  If a problem occurs while attempting to store
   *                              the data.
   */
  private void store(Database database, byte[] keyBytes, byte[] valueBytes)
  private void store(Database database, byte[] keyBytes,
                     ByteStringBuilder valueBytes)
          throws DirectoryException
  {
    boolean successful = false;
    DatabaseEntry keyEntry   = new DatabaseEntry(keyBytes);
    DatabaseEntry valueEntry = new DatabaseEntry(valueBytes);
    DatabaseEntry valueEntry = new DatabaseEntry(valueBytes.getBackingArray(),
        0, valueBytes.length());
    for (int i=0; i < 3; i++)
    {
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/JEExtensibleIndexer.java
@@ -73,13 +73,6 @@
  /**
   * The extensible matching rule which needs to be indexed.
   */
  private final ExtensibleMatchingRule matchingRule;
  /**
   * Creates a new extensible indexer for JE backend.
   *
   * @param attributeType The attribute type for which an indexer is
@@ -92,7 +85,6 @@
          ExtensibleIndexer extensibleIndexer)
  {
    this.attributeType = attributeType;
    this.matchingRule = matchingRule;
    this.extensibleIndexer = extensibleIndexer;
  }
@@ -118,6 +110,7 @@
   *
   * @return A byte array comparator.
   */
  @Override
  public Comparator<byte[]> getComparator()
  {
    return comparator;
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/JebFormat.java
@@ -26,23 +26,9 @@
 */
package org.opends.server.backends.jeb;
import org.opends.server.api.CompressedSchema;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.DataFormatException;
/**
 * Handles the disk representation of LDAP data.
 */
@@ -70,219 +56,6 @@
  public static final byte TAG_DIRECTORY_SERVER_ENTRY = 0x61;
  /**
   * Decode a DatabaseEntry.  The encoded bytes may be compressed and/or
   * encrypted.
   *
   * @param bytes The encoded bytes of a DatabaseEntry.
   * @return The decoded bytes.
   * @throws ASN1Exception If the data is not in the expected ASN.1 encoding
   * format.
   * @throws DataFormatException If an error occurs while trying to decompress
   * compressed data.
   */
  static public byte[] decodeDatabaseEntry(byte[] bytes)
       throws ASN1Exception,DataFormatException
  {
    // FIXME: This array copy could be very costly on performance. We need to
    // FIXME: find a faster way to implement this versioning feature.
    // Remove version number from the encoded bytes
    byte[] encodedBytes = new byte[bytes.length - 1];
    System.arraycopy(bytes, 1, encodedBytes, 0, encodedBytes.length);
    // Decode the sequence.
    List<ASN1Element> elements;
    elements = ASN1Sequence.decodeAsSequence(encodedBytes).elements();
    // Decode the uncompressed size.
    int uncompressedSize;
    uncompressedSize = elements.get(0).decodeAsInteger().intValue();
    // Decode the data bytes.
    byte[] dataBytes;
    dataBytes = elements.get(1).decodeAsOctetString().value();
    byte[] uncompressedBytes;
    if (uncompressedSize == 0)
    {
      // The bytes are not compressed.
      uncompressedBytes = dataBytes;
    }
    else
    {
      // The bytes are compressed.
      CryptoManager cryptoManager = DirectoryServer.getCryptoManager();
      uncompressedBytes = new byte[uncompressedSize];
      /* int len = */ cryptoManager.uncompress(dataBytes, uncompressedBytes);
    }
    return uncompressedBytes;
  }
  /**
   * Decodes an entry from its database representation.
   * <p>
   * An entry on disk is ASN1 encoded in this format:
   *
   * <pre>
   * DatabaseEntry ::= [APPLICATION 0] IMPLICIT SEQUENCE {
   *  uncompressedSize      INTEGER,      -- A zero value means not compressed.
   *  dataBytes             OCTET STRING  -- Optionally compressed encoding of
   *                                         the data bytes.
   * }
   *
   * ID2EntryValue ::= DatabaseEntry
   *  -- Where dataBytes contains an encoding of DirectoryServerEntry.
   *
   * DirectoryServerEntry ::= [APPLICATION 1] IMPLICIT SEQUENCE {
   *  dn                      LDAPDN,
   *  objectClasses           SET OF LDAPString,
   *  userAttributes          AttributeList,
   *  operationalAttributes   AttributeList
   * }
   * </pre>
   *
   * @param bytes A byte array containing the encoded database value.
   * @param compressedSchema The compressed schema manager to use when decoding.
   * @return The decoded entry.
   * @throws ASN1Exception If the data is not in the expected ASN.1 encoding
   * format.
   * @throws LDAPException If the data is not in the expected ASN.1 encoding
   * format.
   * @throws DataFormatException If an error occurs while trying to decompress
   * compressed data.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  static public Entry entryFromDatabase(byte[] bytes,
                                        CompressedSchema compressedSchema)
       throws DirectoryException,ASN1Exception,LDAPException,DataFormatException
  {
    byte[] uncompressedBytes = decodeDatabaseEntry(bytes);
    return decodeDirectoryServerEntry(uncompressedBytes, compressedSchema);
  }
  /**
   * Decode an entry from a ASN1 encoded DirectoryServerEntry.
   *
   * @param bytes A byte array containing the encoding of DirectoryServerEntry.
   * @param compressedSchema The compressed schema manager to use when decoding.
   * @return The decoded entry.
   * @throws ASN1Exception If the data is not in the expected ASN.1 encoding
   * format.
   * @throws LDAPException If the data is not in the expected ASN.1 encoding
   * format.
   * @throws DirectoryException If a Directory Server error occurs.
   */
  static private Entry decodeDirectoryServerEntry(byte[] bytes,
                            CompressedSchema compressedSchema)
       throws DirectoryException,ASN1Exception,LDAPException
  {
    return Entry.decode(bytes, compressedSchema);
  }
  /**
   * Encodes a DatabaseEntry.  The encoded bytes may be compressed and/or
   * encrypted.
   *
   * @param bytes The bytes to encode.
   * @param dataConfig Compression and cryptographic options.
   * @return A byte array containing the encoded DatabaseEntry.
   */
  static public byte[] encodeDatabaseEntry(byte[] bytes, DataConfig dataConfig)
  {
    int uncompressedSize = 0;
    // Do optional compression.
    CryptoManager cryptoManager = DirectoryServer.getCryptoManager();
    if (dataConfig.isCompressed() && cryptoManager != null)
    {
      byte[] compressedBuffer = new byte[bytes.length];
      int compressedSize = cryptoManager.compress(bytes,
                                                  compressedBuffer);
      if (compressedSize != -1)
      {
        // Compression was successful.
        uncompressedSize = bytes.length;
        bytes = new byte[compressedSize];
        System.arraycopy(compressedBuffer, 0, bytes, 0, compressedSize);
        if(debugEnabled())
        {
          TRACER.debugInfo("Compression %d/%d%n",
                    compressedSize, uncompressedSize);
        }
      }
    }
    // Encode the DatabaseEntry.
    ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2);
    elements.add(new ASN1Integer(uncompressedSize));
    elements.add(new ASN1OctetString(bytes));
    byte[] asn1Sequence =
        new ASN1Sequence(TAG_DATABASE_ENTRY, elements).encode();
    // FIXME: This array copy could be very costly on performance. We need to
    // FIXME: find a faster way to implement this versioning feature.
    // Prefix version number to the encoded bytes
    byte[] encodedBytes = new byte[asn1Sequence.length + 1];
    encodedBytes[0] = FORMAT_VERSION;
    System.arraycopy(asn1Sequence, 0, encodedBytes, 1, asn1Sequence.length);
    return encodedBytes;
  }
  /**
   * Encodes an entry to the raw database format, with optional compression.
   *
   * @param entry The entry to encode.
   * @param dataConfig Compression and cryptographic options.
   * @return A byte array containing the encoded database value.
   *
   * @throws  DirectoryException  If a problem occurs while attempting to encode
   *                              the entry.
   */
  static public byte[] entryToDatabase(Entry entry, DataConfig dataConfig)
         throws DirectoryException
  {
    byte[] uncompressedBytes = encodeDirectoryServerEntry(entry,
                                             dataConfig.getEntryEncodeConfig());
    return encodeDatabaseEntry(uncompressedBytes, dataConfig);
  }
  /**
   * Encodes an entry to the raw database format, without compression.
   *
   * @param entry The entry to encode.
   * @return A byte array containing the encoded database value.
   *
   * @throws  DirectoryException  If a problem occurs while attempting to encode
   *                              the entry.
   */
  static public byte[] entryToDatabase(Entry entry)
         throws DirectoryException
  {
    return entryToDatabase(entry, new DataConfig(false, false, null));
  }
  /**
   * Encode a ASN1 DirectoryServerEntry.
   *
   * @param entry The entry to encode.
   * @encodeConfig The configuration to use when encoding the entry.
   * @return A byte array containing the encoded DirectoryServerEntry.
   *
   * @throws  DirectoryException  If a problem occurs while attempting to encode
   *                              the entry.
   */
  static private byte[] encodeDirectoryServerEntry(Entry entry,
                                                 EntryEncodeConfig encodeConfig)
         throws DirectoryException
  {
    return entry.encode(encodeConfig);
  }
  /**
   * Decode an entry ID value from its database representation. Note that
   * this method will throw an ArrayIndexOutOfBoundsException if the bytes
   * array length is less than 8.
@@ -454,16 +227,4 @@
    return bytes;
  }
   /**
   * Get the version number of the DatabaseEntry.
   *
   * @param bytes The encoded bytes of a DatabaseEntry.
   * @return The version number.
   */
  public static byte getEntryVersion(byte[] bytes)
  {
    return bytes[0];
  }
}
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/OctetStringKeyComparator.java
File was deleted
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/OrderingIndexer.java
@@ -170,7 +170,7 @@
        try
        {
          byte[] keyBytes = orderingRule.normalizeValue(value.getValue())
              .value();
              .toByteArray();
          keys.add(keyBytes);
        }
@@ -207,7 +207,7 @@
        try
        {
          byte[] keyBytes =
               orderingRule.normalizeValue(value.getValue()).value();
               orderingRule.normalizeValue(value.getValue()).toByteArray();
          Boolean cInsert = modifiedKeys.get(keyBytes);
          if(cInsert == null)
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SortValues.java
@@ -250,7 +250,7 @@
      }
      else
      {
        buffer.append(values[i].getStringValue());
        buffer.append(values[i].getValue().toString());
      }
    }
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SortValuesSet.java
@@ -27,10 +27,6 @@
package org.opends.server.backends.jeb;
import org.opends.server.types.*;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Element;
import java.util.LinkedList;
import com.sleepycat.je.DatabaseException;
@@ -469,35 +465,23 @@
  private byte[] attributeValuesToDatabase(AttributeValue[] values)
      throws DirectoryException
  {
    int totalValueBytes = 0;
    LinkedList<byte[]> valueBytes = new LinkedList<byte[]>();
    ByteStringBuilder builder = new ByteStringBuilder();
    for (AttributeValue v : values)
    {
      byte[] vBytes;
      if(v == null)
      {
        vBytes = new byte[0];
        builder.appendBERLength(0);
      }
      else
      {
        vBytes = v.getNormalizedValueBytes();
        builder.appendBERLength(v.getNormalizedValue().length());
        builder.append(v.getNormalizedValue());
      }
      byte[] vLength = ASN1Element.encodeLength(vBytes.length);
      valueBytes.add(vLength);
      valueBytes.add(vBytes);
      totalValueBytes += vLength.length + vBytes.length;
    }
    builder.trimToSize();
    byte[] attrBytes = new byte[totalValueBytes];
    int pos = 0;
    for (byte[] b : valueBytes)
    {
      System.arraycopy(b, 0, attrBytes, pos, b.length);
      pos += b.length;
    }
    return attrBytes;
    return builder.getBackingArray();
  }
  /**
@@ -570,8 +554,9 @@
         i < entryIDs.length * numValues;
         i++, j++)
    {
      values[j] = new AttributeValue(sortKeys[j].getAttributeType(),
                                     new ASN1OctetString(getValue(i)));
      values[j] = AttributeValues.create(
          sortKeys[j].getAttributeType(),
          getValue(i));
    }
    return new SortValues(id, values, vlvIndex.sortOrder);
@@ -603,12 +588,12 @@
         i < (index + 1) * numValues;
         i++, j++)
    {
      byte[] value = getValue(i);
      ByteString value = getValue(i);
      if(value != null)
      {
        values[j] = new AttributeValue(sortKeys[j].getAttributeType(),
                                       new ASN1OctetString(value));
        values[j] = AttributeValues.create(
            sortKeys[j].getAttributeType(), value);
      }
    }
@@ -653,7 +638,7 @@
   * @throws DirectoryException If a Directory Server error occurs.
   * @throws DatabaseException If an error occurs in the JE database.
   */
  public byte[] getValue(int index)
  public ByteString getValue(int index)
      throws DatabaseException, DirectoryException
  {
    if(valuesBytesOffsets == null)
@@ -689,7 +674,7 @@
        {
          byte[] valueBytes = new byte[valueLength];
          System.arraycopy(valuesBytes, vBytesPos, valueBytes, 0, valueLength);
          return valueBytes;
          return ByteString.wrap(valueBytes);
        }
      }
      else
@@ -697,6 +682,6 @@
        vBytesPos += valueLength;
      }
    }
    return new byte[0];
    return ByteString.wrap(new byte[0]);
  }
}
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/SubstringIndexer.java
@@ -168,7 +168,7 @@
      {
        try
        {
          byte[] normalizedBytes = value.getNormalizedValue().value();
          byte[] normalizedBytes = value.getNormalizedValue().toByteArray();
          substringKeys(normalizedBytes, keys);
        }
@@ -245,7 +245,7 @@
      {
        try
        {
          byte[] normalizedBytes = value.getNormalizedValue().value();
          byte[] normalizedBytes = value.getNormalizedValue().toByteArray();
          substringKeys(normalizedBytes, modifiedKeys, insert);
        }
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VLVIndex.java
@@ -51,8 +51,6 @@
import static org.opends.server.util.StaticUtils.stackTraceToSingleLineString;
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.config.ConfigException;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.controls.VLVRequestControl;
import org.opends.server.controls.VLVResponseControl;
@@ -1296,13 +1294,13 @@
        try
        {
          byte[] vBytes = vlvRequest.getGreaterThanOrEqualAssertion().value();
          byte[] vLength = ASN1Element.encodeLength(vBytes.length);
          byte[] keyBytes = new byte[vBytes.length + vLength.length];
          System.arraycopy(vLength, 0, keyBytes, 0, vLength.length);
          System.arraycopy(vBytes, 0, keyBytes, vLength.length, vBytes.length);
          ByteSequence vBytes = vlvRequest.getGreaterThanOrEqualAssertion();
          ByteStringBuilder keyBytes =
              new ByteStringBuilder(vBytes.length() + 4);
          keyBytes.appendBERLength(vBytes.length());
          vBytes.copyTo(keyBytes);
          key.setData(keyBytes);
          key.setData(keyBytes.getBackingArray(), 0, keyBytes.length());
          status = cursor.getSearchKeyRange(key, data, lockMode);
          if(status == OperationStatus.SUCCESS)
          {
@@ -1324,7 +1322,7 @@
                new SortValuesSet(key.getData(), data.getData(), this);
            AttributeValue[] assertionValue = new AttributeValue[1];
            assertionValue[0] =
                new AttributeValue(
                AttributeValues.create(
                    sortOrder.getSortKeys()[0].getAttributeType(),
                    vlvRequest.getGreaterThanOrEqualAssertion());
@@ -1582,39 +1580,25 @@
  byte[] encodeKey(long entryID, AttributeValue[] values)
      throws DirectoryException
  {
    int totalValueBytes = 0;
    LinkedList<byte[]> valueBytes = new LinkedList<byte[]>();
    ByteStringBuilder builder = new ByteStringBuilder();
    for (AttributeValue v : values)
    {
      byte[] vBytes;
      if(v == null)
      {
        vBytes = new byte[0];
        builder.appendBERLength(0);
      }
      else
      {
        vBytes = v.getNormalizedValueBytes();
        builder.appendBERLength(v.getNormalizedValue().length());
        builder.append(v.getNormalizedValue());
      }
      byte[] vLength = ASN1Element.encodeLength(vBytes.length);
      valueBytes.add(vLength);
      valueBytes.add(vBytes);
      totalValueBytes += vLength.length + vBytes.length;
    }
    builder.append(entryID);
    builder.trimToSize();
    byte[] entryIDBytes =
        JebFormat.entryIDToDatabase(entryID);
    byte[] attrBytes = new byte[entryIDBytes.length + totalValueBytes];
    int pos = 0;
    for (byte[] b : valueBytes)
    {
      System.arraycopy(b, 0, attrBytes, pos, b.length);
      pos += b.length;
    }
    System.arraycopy(entryIDBytes, 0, attrBytes, pos, entryIDBytes.length);
    return attrBytes;
    return builder.getBackingArray();
  }
  /**
@@ -1658,8 +1642,9 @@
        byte[] valueBytes = new byte[valueLength];
        System.arraycopy(keyBytes, vBytesPos, valueBytes, 0, valueLength);
        attributeValues[i] =
            new AttributeValue(sortOrder.getSortKeys()[i].getAttributeType(),
                new ASN1OctetString(valueBytes));
            AttributeValues.create(
                sortOrder.getSortKeys()[i].getAttributeType(),
                ByteString.wrap(valueBytes));
      }
      vBytesPos += valueLength;
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VLVKeyComparator.java
@@ -29,6 +29,7 @@
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ByteString;
import java.util.Comparator;
import java.io.Serializable;
@@ -282,12 +283,12 @@
        break;
      }
      byte[] b1Bytes = set.getValue((index * orderingRules.length) + j);
      byte[] b2Bytes = null;
      ByteString b1Bytes = set.getValue((index * orderingRules.length) + j);
      ByteString b2Bytes = null;
      if(values[j] != null)
      {
        b2Bytes = values[j].getNormalizedValueBytes();
        b2Bytes = values[j].getNormalizedValue();
      }
      // A null value will always come after a non-null value.
@@ -310,11 +311,11 @@
      int result;
      if(ascending[j])
      {
        result = orderingRules[j].compare(b1Bytes, b2Bytes);
        result = orderingRules[j].compareValues(b1Bytes, b2Bytes);
      }
      else
      {
        result = orderingRules[j].compare(b2Bytes, b1Bytes);
        result = orderingRules[j].compareValues(b2Bytes, b1Bytes);
      }
      if(result != 0)
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/VerifyJob.java
@@ -44,7 +44,6 @@
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.api.ApproximateMatchingRule;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.util.StaticUtils;
import org.opends.server.util.ServerConstants;
@@ -472,7 +471,8 @@
        Entry entry;
        try
        {
          entry = JebFormat.entryFromDatabase(data.getData(),
          entry = ID2Entry.entryFromDatabase(
              ByteString.wrap(data.getData()),
                                 rootContainer.getCompressedSchema());
        }
        catch (Exception e)
@@ -578,7 +578,7 @@
        DN dn;
        try
        {
          dn = DN.decode(new ASN1OctetString(key.getData()));
          dn = DN.decode(ByteString.wrap(key.getData()));
        }
        catch (DirectoryException e)
        {
@@ -955,7 +955,7 @@
      hashMap = new HashMap<ByteString, Long>();
      entryLimitMap.put(index, hashMap);
    }
    ByteString octetString = new ASN1OctetString(key);
    ByteString octetString = ByteString.wrap(key);
    Long counter = hashMap.get(octetString);
    if (counter == null)
    {
@@ -1142,7 +1142,7 @@
          attrType.getOrderingMatchingRule();
      ApproximateMatchingRule approximateMatchingRule =
          attrType.getApproximateMatchingRule();
      ASN1OctetString previousValue = null;
      ByteString previousValue = null;
      OperationStatus status;
      for (status = cursor.getFirst(key, data, LockMode.DEFAULT);
@@ -1184,7 +1184,7 @@
            case SUBSTRING:
              ArrayList<ByteString> subAnyElements =
                   new ArrayList<ByteString>(1);
              subAnyElements.add(new ASN1OctetString(value));
              subAnyElements.add(ByteString.wrap(value));
              sf = SearchFilter.createSubstringFilter(attrType,null,
                                                      subAnyElements,null);
@@ -1197,13 +1197,14 @@
              // 2. Make sure the key value is greater then the previous key
              //    value.
              assertionValue =
                  new AttributeValue(attrType, new ASN1OctetString(value));
                  AttributeValues.create(attrType,
                      ByteString.wrap(value));
              sf = SearchFilter.createEqualityFilter(attrType,assertionValue);
              if(orderingMatchingRule != null && previousValue != null)
              {
                ASN1OctetString thisValue = new ASN1OctetString(value);
                ByteString thisValue = ByteString.wrap(value);
                int order = orderingMatchingRule.compareValues(thisValue,
                                                               previousValue);
                if(order > 0)
@@ -1214,8 +1215,8 @@
                    TRACER.debugError("Reversed ordering of index keys " +
                        "(keys dumped in the order found in database)%n" +
                        "Key 1:%n%s%nKey 2:%n%s",
                               keyDump(index, thisValue.value()),
                               keyDump(index,previousValue.value()));
                               keyDump(index, thisValue.toByteArray()),
                               keyDump(index,previousValue.toByteArray()));
                  }
                  continue;
                }
@@ -1225,8 +1226,9 @@
                  if(debugEnabled())
                  {
                    TRACER.debugError("Duplicate index keys%nKey 1:%n%s%n" +
                        "Key2:%n%s", keyDump(index, thisValue.value()),
                                     keyDump(index,previousValue.value()));
                        "Key2:%n%s", keyDump(index, thisValue.toByteArray()),
                                     keyDump(index,
                                         previousValue.toByteArray()));
                  }
                  continue;
                }
@@ -1238,7 +1240,8 @@
              break;
            case EQ:
              assertionValue =
                   new AttributeValue(attrType, new ASN1OctetString(value));
                  AttributeValues.create(attrType,
                      ByteString.wrap(value));
              sf = SearchFilter.createEqualityFilter(attrType,assertionValue);
              break;
@@ -1310,7 +1313,7 @@
              }
              else
              {
                ByteString normalizedValue = new ASN1OctetString(value);
                ByteString normalizedValue = ByteString.wrap(value);
                List<Attribute> attrs = entry.getAttribute(attrType);
                if ((attrs != null) && (!attrs.isEmpty()))
                {
@@ -1839,7 +1842,7 @@
      {
        for (AttributeValue value : attr)
        {
          byte[] normalizedBytes = value.getNormalizedValue().value();
          byte[] normalizedBytes = value.getNormalizedValue().toByteArray();
          // Equality index.
          if (equalityIndex != null)
@@ -1886,7 +1889,7 @@
            DatabaseEntry key = new DatabaseEntry();
            for (ByteString keyBytes : keyBytesSet)
            {
              key.setData(keyBytes.value());
              key.setData(keyBytes.toByteArray());
              try
              {
                ConditionResult cr;
@@ -1929,7 +1932,7 @@
                 attr.getAttributeType().getOrderingMatchingRule();
            normalizedBytes =
                 orderingRule.normalizeValue(value.getValue()).value();
                 orderingRule.normalizeValue(value.getValue()).toByteArray();
            DatabaseEntry key = new DatabaseEntry(normalizedBytes);
            try
@@ -1972,7 +1975,7 @@
                attr.getAttributeType().getApproximateMatchingRule();
            normalizedBytes =
                approximateRule.normalizeValue(value.getValue()).value();
                approximateRule.normalizeValue(value.getValue()).toByteArray();
            DatabaseEntry key = new DatabaseEntry(normalizedBytes);
            try
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/Importer.java
@@ -42,7 +42,6 @@
import org.opends.server.config.ConfigException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.backends.jeb.*;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.messages.Message;
import org.opends.messages.JebMessages;
import static org.opends.messages.JebMessages.*;
@@ -868,7 +867,7 @@
              message = ERR_JEB_IMPORT_NO_WORKER_THREADS.get();
              throw new JebException(message);
            }
            DN dn = DN.decode(new ASN1OctetString(key.getData()));
            DN dn = DN.decode(ByteString.wrap(key.getData()));
            if(!context.getIncludeBranches().contains(dn)) {
              EntryID id = new EntryID(data);
              Entry entry =
opendj-sdk/opends/src/server/org/opends/server/backends/task/RecurringTask.java
@@ -76,23 +76,23 @@
  // The DN of the entry that actually defines this task.
  private DN recurringTaskEntryDN;
  private final DN recurringTaskEntryDN;
  // The entry that actually defines this task.
  private Entry recurringTaskEntry;
  private final Entry recurringTaskEntry;
  // The unique ID for this recurring task.
  private String recurringTaskID;
  private final String recurringTaskID;
  // The fully-qualified name of the class that will be used to implement the
  // class.
  private String taskClassName;
  private final String taskClassName;
  // Task instance.
  private Task task;
  // Task scheduler for this task.
  private TaskScheduler taskScheduler;
  private final TaskScheduler taskScheduler;
  // Number of tokens in the task schedule tab.
  private static final int TASKTAB_NUM_TOKENS = 5;
@@ -180,7 +180,7 @@
      throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message);
    }
    recurringTaskID = value.getStringValue();
    recurringTaskID = value.getValue().toString();
    // Get the schedule for this task.
@@ -224,7 +224,7 @@
      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
    }
    String taskScheduleTab = value.getStringValue();
    String taskScheduleTab = value.toString();
    parseTaskTab(taskScheduleTab);
    // Get the class name from the entry.  If there isn't one, then fail.
@@ -267,7 +267,7 @@
      throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
    }
    taskClassName = value.getStringValue();
    taskClassName = value.getValue().toString();
    // Make sure that the specified class can be loaded.
opendj-sdk/opends/src/server/org/opends/server/backends/task/Task.java
@@ -52,19 +52,7 @@
import org.opends.server.core.DirectoryServer;
import org.opends.server.loggers.ErrorLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.Attributes;
import org.opends.server.types.DN;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.InitializationException;
import org.opends.server.types.Modification;
import org.opends.server.types.ModificationType;
import org.opends.server.types.Operation;
import org.opends.server.types.*;
import org.opends.server.util.EMailMessage;
import org.opends.server.util.StaticUtils;
import org.opends.server.util.TimeThread;
@@ -440,7 +428,7 @@
      throw new InitializationException(message);
    }
    return value.getStringValue();
    return value.getValue().toString();
  }
@@ -480,7 +468,7 @@
    Iterator<AttributeValue> iterator = attrList.get(0).iterator();
    while (iterator.hasNext())
    {
      valueStrings.add(iterator.next().getStringValue());
      valueStrings.add(iterator.next().getValue().toString());
    }
    return valueStrings;
@@ -1006,7 +994,7 @@
      }
      List<Attribute> attrList = taskEntry.getAttribute(type);
      AttributeValue value = new AttributeValue(type, messageString);
      AttributeValue value = AttributeValues.create(type, messageString);
      if (attrList == null)
      {
        attrList = new ArrayList<Attribute>();
opendj-sdk/opends/src/server/org/opends/server/backends/task/TaskBackend.java
@@ -863,7 +863,7 @@
      }
      AttributeValue v = iterator.next();
      String valueString = toLowerCase(v.getStringValue());
      String valueString = toLowerCase(v.toString());
      if (!(valueString.startsWith("cancel") ||
        valueString.startsWith("stop"))) {
        acceptable = false;
@@ -2352,6 +2352,7 @@
  /**
   * {@inheritDoc}
   */
  @Override
  public void preloadEntryCache() throws UnsupportedOperationException {
    throw new UnsupportedOperationException("Operation not supported.");
  }
opendj-sdk/opends/src/server/org/opends/server/backends/task/TaskScheduler.java
@@ -1979,7 +1979,7 @@
      throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message);
    }
    String taskClassName = value.getStringValue();
    String taskClassName = value.getValue().toString();
    if (! DirectoryServer.getAllowedTasks().contains(taskClassName))
    {
      Message message = ERR_TASKSCHED_NOT_ALLOWED_TASK.get(taskClassName);
opendj-sdk/opends/src/server/org/opends/server/config/BooleanConfigAttribute.java
@@ -40,9 +40,10 @@
import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.AttributeValues;
import org.opends.server.types.ByteString;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.messages.ConfigMessages.*;
@@ -241,13 +242,15 @@
         new LinkedHashSet<AttributeValue>(1);
    if (booleanValue)
    {
      valueSet.add(new AttributeValue(new ASN1OctetString(CONFIG_VALUE_TRUE),
                                      new ASN1OctetString(CONFIG_VALUE_TRUE)));
      valueSet.add(AttributeValues.create(
          ByteString.valueOf(CONFIG_VALUE_TRUE),
          ByteString.valueOf(CONFIG_VALUE_TRUE)));
    }
    else
    {
      valueSet.add(new AttributeValue(new ASN1OctetString(CONFIG_VALUE_FALSE),
                                      new ASN1OctetString(CONFIG_VALUE_FALSE)));
      valueSet.add(AttributeValues.create(
          ByteString.valueOf(CONFIG_VALUE_FALSE),
          ByteString.valueOf(CONFIG_VALUE_FALSE)));
    }
    return valueSet;
@@ -288,7 +291,7 @@
  public boolean valueIsAcceptable(AttributeValue value,
                                   StringBuilder rejectReason)
  {
    String stringValue = value.getStringValue();
    String stringValue = value.getValue().toString();
    if (stringValue.equalsIgnoreCase(CONFIG_VALUE_TRUE) ||
        stringValue.equalsIgnoreCase(CONFIG_VALUE_FALSE))
    {
@@ -464,7 +467,8 @@
          {
            // Get the value and parse it as a Boolean.
            Iterator<AttributeValue> iterator = a.iterator();
            String valueString = iterator.next().getStringValue().toLowerCase();
            String valueString =
                iterator.next().getValue().toString().toLowerCase();
            if (valueString.equals("true") || valueString.equals("yes") ||
                valueString.equals("on") || valueString.equals("1"))
@@ -526,7 +530,8 @@
        {
          // Get the value and parse it as a Boolean.
          Iterator<AttributeValue> iterator = a.iterator();
          String valueString = iterator.next().getStringValue().toLowerCase();
          String valueString =
              iterator.next().getValue().toString().toLowerCase();
          if (valueString.equals("true") || valueString.equals("yes") ||
              valueString.equals("on") || valueString.equals("1"))
opendj-sdk/opends/src/server/org/opends/server/config/ConfigAttribute.java
@@ -449,7 +449,7 @@
    if (! valueIsAcceptable(value, rejectReason))
    {
      Message message = ERR_CONFIG_ATTR_REJECTED_VALUE.get(
          value.getStringValue(), name, rejectReason.toString());
          value.getValue().toString(), name, rejectReason.toString());
      throw new ConfigException(message);
    }
@@ -470,7 +470,7 @@
      if (! valueIsAcceptable(value, rejectReason))
      {
        Message message = ERR_CONFIG_ATTR_REJECTED_VALUE.get(
            value.getStringValue(), name, rejectReason.toString());
            value.getValue().toString(), name, rejectReason.toString());
        throw new ConfigException(message);
      }
    }
@@ -589,14 +589,14 @@
      if (tempValues.contains(value))
      {
        Message message = ERR_CONFIG_ATTR_ADD_VALUES_ALREADY_EXISTS.get(
            name, value.getStringValue());
            name, value.getValue().toString());
        throw new ConfigException(message);
      }
      if (! valueIsAcceptable(value, rejectReason))
      {
        Message message = ERR_CONFIG_ATTR_REJECTED_VALUE.get(
            value.getStringValue(), name, rejectReason.toString());
            value.getValue().toString(), name, rejectReason.toString());
        throw new ConfigException(message);
      }
    }
@@ -657,7 +657,7 @@
      if (! tempValues.remove(value))
      {
        Message message =
            ERR_CONFIG_ATTR_NO_SUCH_VALUE.get(name, value.getStringValue());
           ERR_CONFIG_ATTR_NO_SUCH_VALUE.get(name, value.getValue().toString());
        throw new ConfigException(message);
      }
    }
opendj-sdk/opends/src/server/org/opends/server/config/DNConfigAttribute.java
@@ -40,11 +40,7 @@
import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DN;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -448,8 +444,8 @@
      }
      AttributeValue attrValue =
           new AttributeValue(new ASN1OctetString(value.toString()),
                              new ASN1OctetString(value.toNormalizedString()));
          AttributeValues.create(ByteString.valueOf(value.toString()),
              ByteString.valueOf(value.toNormalizedString()));
      if (valueSet.contains(attrValue))
      {
@@ -496,8 +492,8 @@
    else
    {
      valueSet = new LinkedHashSet<AttributeValue>(1);
      valueSet.add(new AttributeValue(new ASN1OctetString(value.toString()),
                            new ASN1OctetString(value.toNormalizedString())));
      valueSet.add(AttributeValues.create(ByteString.valueOf(value.toString()),
          ByteString.valueOf(value.toNormalizedString())));
    }
    return valueSet;
@@ -524,8 +520,8 @@
    for (DN value : values)
    {
      valueSet.add(new AttributeValue(new ASN1OctetString(value.toString()),
                            new ASN1OctetString(value.toNormalizedString())));
      valueSet.add(AttributeValues.create(ByteString.valueOf(value.toString()),
          ByteString.valueOf(value.toNormalizedString())));
    }
    return valueSet;
@@ -577,7 +573,7 @@
    // Make sure that it can be parsed as a DN.
    try
    {
      DN.decode(value.getStringValue());
      DN.decode(value.getValue().toString());
    }
    catch (Exception e)
    {
@@ -587,7 +583,7 @@
      }
      rejectReason.append(ERR_CONFIG_ATTR_DN_CANNOT_PARSE.get(
              value.getStringValue(), getName(),
              value.getValue().toString(), getName(),
              String.valueOf(e)));
      return false;
    }
@@ -692,8 +688,8 @@
      }
      valueSet.add(new AttributeValue(new ASN1OctetString(dn.toString()),
                            new ASN1OctetString(dn.toNormalizedString())));
      valueSet.add(AttributeValues.create(ByteString.valueOf(dn.toString()),
          ByteString.valueOf(dn.toNormalizedString())));
    }
@@ -841,7 +837,7 @@
              DN dn;
              try
              {
                dn = DN.decode(v.getStringValue());
                dn = DN.decode(v.getValue().toString());
              }
              catch (Exception e)
              {
@@ -851,7 +847,7 @@
                }
                Message message = ERR_CONFIG_ATTR_DN_CANNOT_PARSE.get(
                    v.getStringValue(), getName(), String.valueOf(e));
                    v.getValue().toString(), getName(), String.valueOf(e));
                throw new ConfigException(message, e);
              }
@@ -911,7 +907,7 @@
            DN dn;
            try
            {
              dn = DN.decode(v.getStringValue());
              dn = DN.decode(v.getValue().toString());
            }
            catch (Exception e)
            {
@@ -921,7 +917,7 @@
              }
              Message message = ERR_CONFIG_ATTR_DN_CANNOT_PARSE.get(
                  v.getStringValue(), getName(), String.valueOf(e));
                  v.getValue().toString(), getName(), String.valueOf(e));
              throw new ConfigException(message, e);
            }
opendj-sdk/opends/src/server/org/opends/server/config/IntegerConfigAttribute.java
@@ -40,10 +40,7 @@
import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -683,8 +680,8 @@
      String valueString = String.valueOf(value);
      AttributeValue attrValue =
           new AttributeValue(new ASN1OctetString(valueString),
                              new ASN1OctetString(valueString));
          AttributeValues.create(ByteString.valueOf(valueString),
              ByteString.valueOf(valueString));
      if (valueSet.contains(attrValue))
      {
@@ -726,8 +723,8 @@
         new LinkedHashSet<AttributeValue>(1);
    String valueString = String.valueOf(value);
    valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                    new ASN1OctetString(valueString)));
    valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
        ByteString.valueOf(valueString)));
    return valueSet;
  }
@@ -754,8 +751,8 @@
    for (long value : values)
    {
      String valueString = String.valueOf(value);
      valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                      new ASN1OctetString(valueString)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
          ByteString.valueOf(valueString)));
    }
    return valueSet;
@@ -797,7 +794,7 @@
                                   StringBuilder rejectReason)
  {
    // First, make sure we can represent it as a long.
    String stringValue = value.getStringValue();
    String stringValue = value.getValue().toString();
    long longValue;
    try
    {
@@ -951,8 +948,8 @@
      }
      valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                      new ASN1OctetString(valueString)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
          ByteString.valueOf(valueString)));
    }
@@ -1101,12 +1098,12 @@
              long longValue;
              try
              {
                longValue = Long.parseLong(v.getStringValue());
                longValue = Long.parseLong(v.getValue().toString());
              }
              catch (Exception e)
              {
                Message message = ERR_CONFIG_ATTR_INT_COULD_NOT_PARSE.get(
                    v.getStringValue(), a.getName(), String.valueOf(e));
                    v.getValue().toString(), a.getName(), String.valueOf(e));
                throw new ConfigException(message, e);
              }
@@ -1183,12 +1180,12 @@
            long longValue;
            try
            {
              longValue = Long.parseLong(v.getStringValue());
              longValue = Long.parseLong(v.getValue().toString());
            }
            catch (Exception e)
            {
              Message message = ERR_CONFIG_ATTR_INT_COULD_NOT_PARSE.get(
                  v.getStringValue(), a.getName(), String.valueOf(e));
                  v.getValue().toString(), a.getName(), String.valueOf(e));
              throw new ConfigException(message, e);
            }
opendj-sdk/opends/src/server/org/opends/server/config/IntegerWithUnitConfigAttribute.java
@@ -41,10 +41,7 @@
import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -612,8 +609,8 @@
         new LinkedHashSet<AttributeValue>(1);
    String valueString = intValue + " " + unit;
    valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                    new ASN1OctetString(valueString)));
    valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
        ByteString.valueOf(valueString)));
    return valueSet;
  }
@@ -656,7 +653,7 @@
                                   StringBuilder rejectReason)
  {
    // Get a string representation of the value and convert it to lowercase.
    String lowerValue = value.getStringValue().toLowerCase();
    String lowerValue = value.getValue().toString().toLowerCase();
    return valueIsAcceptable(lowerValue, rejectReason);
  }
@@ -833,8 +830,8 @@
      }
      valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                      new ASN1OctetString(valueString)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
          ByteString.valueOf(valueString)));
    }
@@ -956,7 +953,7 @@
          {
            Iterator<AttributeValue> iterator = a.iterator();
            String valueString = iterator.next().getStringValue();
            String valueString = iterator.next().getValue().toString();
            if (iterator.hasNext())
            {
@@ -1041,7 +1038,7 @@
        {
          Iterator<AttributeValue> iterator = a.iterator();
          String valueString = iterator.next().getStringValue();
          String valueString = iterator.next().getValue().toString();
          if (iterator.hasNext())
          {
opendj-sdk/opends/src/server/org/opends/server/config/JMXMBean.java
@@ -56,14 +56,6 @@
import org.opends.server.api.MonitorProvider;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.jmx.Credential;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.InvokableMethod;
import org.opends.server.types.ResultCode;
import org.opends.server.types.SearchScope;
import static org.opends.server.loggers.debug.DebugLogger.*;
import static org.opends.server.loggers.ErrorLogger.*;
@@ -72,12 +64,10 @@
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import org.opends.server.protocols.jmx.JmxClientConnection;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.ldap.LDAPFilter;
import org.opends.server.protocols.internal.InternalSearchOperation ;
import org.opends.server.types.LDAPException;
import org.opends.server.types.*;
/**
@@ -448,12 +438,12 @@
          if (iterator.hasNext())
          {
            ArrayList<String> stringValues = new ArrayList<String>();
            stringValues.add(value.getStringValue());
            stringValues.add(value.getValue().toString());
            while (iterator.hasNext())
            {
              value = iterator.next();
              stringValues.add(value.getStringValue());
              stringValues.add(value.getValue().toString());
            }
            String[] valueArray = new String[stringValues.size()];
@@ -462,7 +452,7 @@
          }
          else
          {
            return new Attribute(name, value.getStringValue());
            return new Attribute(name, value.getValue().toString());
          }
        }
      }
@@ -522,12 +512,12 @@
    InternalSearchOperation op=null;
    if (clientConnection instanceof JmxClientConnection) {
        op = ((JmxClientConnection)clientConnection).processSearch(
             new ASN1OctetString(configEntryDN.toString()),
            ByteString.valueOf(configEntryDN.toString()),
             SearchScope.BASE_OBJECT, filter);
    }
    else if (clientConnection instanceof InternalClientConnection) {
        op = ((InternalClientConnection)clientConnection).processSearch(
             new ASN1OctetString(configEntryDN.toString()),
            ByteString.valueOf(configEntryDN.toString()),
             SearchScope.BASE_OBJECT, filter);
    }
    // BUG : op may be null
@@ -616,12 +606,12 @@
    InternalSearchOperation op=null;
    if (clientConnection instanceof JmxClientConnection) {
      op = ((JmxClientConnection)clientConnection).processSearch(
        new ASN1OctetString(configEntryDN.toString()),
          ByteString.valueOf(configEntryDN.toString()),
        SearchScope.BASE_OBJECT, filter);
    }
    else if (clientConnection instanceof InternalClientConnection) {
      op = ((InternalClientConnection)clientConnection).processSearch(
        new ASN1OctetString(configEntryDN.toString()),
          ByteString.valueOf(configEntryDN.toString()),
        SearchScope.BASE_OBJECT, filter);
    }
    // BUG: op may be null
@@ -681,12 +671,12 @@
            if (iterator.hasNext())
            {
              ArrayList<String> stringValues = new ArrayList<String>();
              stringValues.add(value.getStringValue());
              stringValues.add(value.getValue().toString());
              while (iterator.hasNext())
              {
                value = iterator.next();
                stringValues.add(value.getStringValue());
                stringValues.add(value.getValue().toString());
              }
              String[] valueArray = new String[stringValues.size()];
@@ -696,7 +686,7 @@
            }
            else
            {
              attrList.add(new Attribute(name, value.getStringValue()));
              attrList.add(new Attribute(name, value.getValue().toString()));
              break monitorLoop;
            }
          }
opendj-sdk/opends/src/server/org/opends/server/config/MultiChoiceConfigAttribute.java
@@ -40,10 +40,7 @@
import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -512,8 +509,8 @@
      }
      AttributeValue attrValue =
           new AttributeValue(new ASN1OctetString(value),
                              new ASN1OctetString(value));
          AttributeValues.create(ByteString.valueOf(value),
              ByteString.valueOf(value));
      if (valueSet.contains(attrValue))
      {
@@ -554,8 +551,8 @@
    LinkedHashSet<AttributeValue> valueSet =
         new LinkedHashSet<AttributeValue>(1);
    valueSet.add(new AttributeValue(new ASN1OctetString(value),
                                    new ASN1OctetString(value)));
    valueSet.add(AttributeValues.create(ByteString.valueOf(value),
        ByteString.valueOf(value)));
    return valueSet;
  }
@@ -581,8 +578,8 @@
    for (String value : values)
    {
      valueSet.add(new AttributeValue(new ASN1OctetString(value),
                                      new ASN1OctetString(value)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(value),
          ByteString.valueOf(value)));
    }
    return valueSet;
@@ -626,7 +623,7 @@
    // Make sure that the value is non-empty.
    String stringValue;
    if ((value == null) ||
        ((stringValue = value.getStringValue()).length() == 0))
        ((stringValue = value.getValue().toString()).length() == 0))
    {
      rejectReason.append(ERR_CONFIG_ATTR_EMPTY_STRING_VALUE.get(getName()));
      return false;
@@ -727,8 +724,8 @@
        }
      }
      valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                      new ASN1OctetString(valueString)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
          ByteString.valueOf(valueString)));
    }
@@ -860,16 +857,16 @@
            pendingValues = new ArrayList<String>(numValues);
            for (AttributeValue v : a)
            {
              String lowerValue = v.getStringValue().toLowerCase();
              String lowerValue = v.getValue().toString().toLowerCase();
              if (! allowedValues.contains(lowerValue))
              {
                // This is illegal -- the value is not allowed.
                Message message = ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(
                    v.getStringValue(), a.getName());
                    v.getValue().toString(), a.getName());
                throw new ConfigException(message);
              }
              pendingValues.add(v.getStringValue());
              pendingValues.add(v.getValue().toString());
            }
          }
        }
@@ -922,16 +919,16 @@
          activeValues = new ArrayList<String>(numValues);
          for (AttributeValue v : a)
          {
            String lowerValue = v.getStringValue().toLowerCase();
            String lowerValue = v.getValue().toString().toLowerCase();
            if (! allowedValues.contains(lowerValue))
            {
              // This is illegal -- the value is not allowed.
              Message message = ERR_CONFIG_ATTR_VALUE_NOT_ALLOWED.get(
                  v.getStringValue(), a.getName());
                  v.getValue().toString(), a.getName());
              throw new ConfigException(message);
            }
            activeValues.add(v.getStringValue());
            activeValues.add(v.getValue().toString());
          }
        }
      }
opendj-sdk/opends/src/server/org/opends/server/config/ReadOnlyConfigAttribute.java
@@ -38,9 +38,10 @@
import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.ByteString;
import org.opends.server.types.AttributeValues;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.messages.ConfigMessages.*;
@@ -280,8 +281,8 @@
    LinkedHashSet<AttributeValue> valueSet =
         new LinkedHashSet<AttributeValue>(1);
    valueSet.add(new AttributeValue(new ASN1OctetString(value),
                                    new ASN1OctetString(value)));
    valueSet.add(AttributeValues.create(ByteString.valueOf(value),
        ByteString.valueOf(value)));
    return valueSet;
  }
@@ -307,8 +308,8 @@
    for (String value : values)
    {
      valueSet.add(new AttributeValue(new ASN1OctetString(value),
                                      new ASN1OctetString(value)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(value),
          ByteString.valueOf(value)));
    }
    return valueSet;
@@ -383,8 +384,8 @@
         new LinkedHashSet<AttributeValue>(numValues);
    for (String valueString : valueStrings)
    {
      valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                      new ASN1OctetString(valueString)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
          ByteString.valueOf(valueString)));
    }
opendj-sdk/opends/src/server/org/opends/server/config/StringConfigAttribute.java
@@ -40,10 +40,7 @@
import org.opends.server.api.AttributeSyntax;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -451,8 +448,8 @@
      }
      AttributeValue attrValue =
           new AttributeValue(new ASN1OctetString(value),
                              new ASN1OctetString(value));
          AttributeValues.create(ByteString.valueOf(value),
              ByteString.valueOf(value));
      if (valueSet.contains(attrValue))
      {
@@ -493,8 +490,8 @@
    LinkedHashSet<AttributeValue> valueSet =
         new LinkedHashSet<AttributeValue>(1);
    valueSet.add(new AttributeValue(new ASN1OctetString(value),
                                    new ASN1OctetString(value)));
    valueSet.add(AttributeValues.create(ByteString.valueOf(value),
        ByteString.valueOf(value)));
    return valueSet;
  }
@@ -520,8 +517,8 @@
    for (String value : values)
    {
      valueSet.add(new AttributeValue(new ASN1OctetString(value),
                                      new ASN1OctetString(value)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(value),
          ByteString.valueOf(value)));
    }
    return valueSet;
@@ -563,7 +560,7 @@
                                   StringBuilder rejectReason)
  {
    // The only requirement is that the value is not null or empty.
    if ((value == null) || (value.getStringValue().length() == 0))
    if ((value == null) || (value.getValue().toString().length() == 0))
    {
      rejectReason.append(ERR_CONFIG_ATTR_EMPTY_STRING_VALUE.get(getName()));
      return false;
@@ -641,8 +638,8 @@
        }
      }
      valueSet.add(new AttributeValue(new ASN1OctetString(valueString),
                                      new ASN1OctetString(valueString)));
      valueSet.add(AttributeValues.create(ByteString.valueOf(valueString),
          ByteString.valueOf(valueString)));
    }
@@ -774,7 +771,7 @@
            pendingValues = new ArrayList<String>(numValues);
            for (AttributeValue v : a)
            {
              pendingValues.add(v.getStringValue());
              pendingValues.add(v.getValue().toString());
            }
          }
        }
@@ -827,7 +824,7 @@
          activeValues = new ArrayList<String>(numValues);
          for (AttributeValue v : a)
          {
            activeValues.add(v.getStringValue());
            activeValues.add(v.getValue().toString());
          }
        }
      }
opendj-sdk/opends/src/server/org/opends/server/controls/AccountUsableRequestControl.java
@@ -29,13 +29,16 @@
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.types.ByteString;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ResultCode;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
/**
@@ -46,8 +49,41 @@
public class AccountUsableRequestControl
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private static final class Decoder
      implements ControlDecoder<AccountUsableRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public AccountUsableRequestControl decode(boolean isCritical,
                                              ByteString value)
           throws DirectoryException
    {
      if (value != null)
      {
        Message message = ERR_ACCTUSABLEREQ_CONTROL_HAS_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      return new AccountUsableRequestControl(isCritical);
    }
    public String getOID()
    {
      return OID_ACCOUNT_USABLE_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<AccountUsableRequestControl> DECODER =
    new Decoder();
  /**
   * Creates a new instance of the account usable request control with the
@@ -55,67 +91,32 @@
   */
  public AccountUsableRequestControl()
  {
    super(OID_ACCOUNT_USABLE_CONTROL, false);
    this(false);
  }
  /**
   * Creates a new instance of the account usable request control with the
   * provided information.
   * default settings.
   *
   * @param  oid         The OID to use for this control.
   * @param  isCritical  Indicates whether support for this control should be
   *                     considered a critical part of the client processing.
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   */
  public AccountUsableRequestControl(String oid, boolean isCritical)
  public AccountUsableRequestControl(boolean isCritical)
  {
    super(oid, isCritical);
    super(OID_ACCOUNT_USABLE_CONTROL, isCritical);
  }
  /**
   * Creates a new account usable request control from the contents of the
   * provided control.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this account usable request control.
   *
   * @return  The account usable request control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         account usable request control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public static AccountUsableRequestControl decodeControl(Control control)
         throws LDAPException
  {
    if (control.hasValue())
    {
      Message message = ERR_ACCTUSABLEREQ_CONTROL_HAS_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    return new AccountUsableRequestControl(control.getOID(),
                                           control.isCritical());
  }
  /**
   * Retrieves a string representation of this account usable request control.
   *
   * @return  A string representation of this account usable request control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  protected void writeValue(ASN1Writer writer) throws IOException {
    // No value element.
  }
opendj-sdk/opends/src/server/org/opends/server/controls/AccountUsableResponseControl.java
@@ -28,19 +28,12 @@
import org.opends.messages.Message;
import java.io.IOException;
import java.util.ArrayList;
import org.opends.server.protocols.asn1.ASN1Boolean;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -72,6 +65,117 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<AccountUsableResponseControl>
  {
    /**
     * {@inheritDoc}
     */
    public AccountUsableResponseControl decode(boolean isCritical,
                                               ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        // The response control must always have a value.
        Message message = ERR_ACCTUSABLERES_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      try
      {
        ASN1Reader reader = ASN1.getReader(value);
        switch (reader.peekType())
        {
          case TYPE_SECONDS_BEFORE_EXPIRATION:
            int secondsBeforeExpiration = (int)reader.readInteger();
            return new AccountUsableResponseControl(isCritical,
                secondsBeforeExpiration);
          case TYPE_MORE_INFO:
            boolean isInactive = false;
            boolean isReset = false;
            boolean isExpired = false;
            boolean isLocked = false;
            int     remainingGraceLogins = -1;
            int     secondsBeforeUnlock = 0;
            reader.readStartSequence();
            while(reader.hasNextElement())
            {
              switch (reader.peekType())
              {
                case TYPE_INACTIVE:
                  isInactive = reader.readBoolean();
                  break;
                case TYPE_RESET:
                  isReset = reader.readBoolean();
                  break;
                case TYPE_EXPIRED:
                  isExpired = reader.readBoolean();
                  break;
                case TYPE_REMAINING_GRACE_LOGINS:
                  remainingGraceLogins = (int)reader.readInteger();
                  break;
                case TYPE_SECONDS_BEFORE_UNLOCK:
                  isLocked = true;
                  secondsBeforeUnlock = (int)reader.readInteger();
                  break;
                default:
                  Message message = ERR_ACCTUSABLERES_UNKNOWN_UNAVAILABLE_TYPE.
                      get(byteToHex(reader.peekType()));
                  throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                      message);
              }
            }
            reader.readEndSequence();
            return new AccountUsableResponseControl(isCritical,
                isInactive, isReset,
                isExpired,
                remainingGraceLogins,
                isLocked,
                secondsBeforeUnlock);
          default:
            Message message = ERR_ACCTUSABLERES_UNKNOWN_VALUE_ELEMENT_TYPE.get(
                byteToHex(reader.peekType()));
            throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
        }
      }
      catch (DirectoryException de)
      {
        throw de;
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_ACCTUSABLERES_DECODE_ERROR.get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
    }
    public String getOID()
    {
      return OID_ACCOUNT_USABLE_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<AccountUsableResponseControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -175,8 +279,26 @@
   */
  public AccountUsableResponseControl(int secondsBeforeExpiration)
  {
    super(OID_ACCOUNT_USABLE_CONTROL, false,
          encodeValue(secondsBeforeExpiration));
    this(false, secondsBeforeExpiration);
  }
  /**
   * Creates a new account usability response control that may be used to
   * indicate that the account is available and provide the number of seconds
   * until expiration.  It will use the default OID and criticality.
   *
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   * @param  secondsBeforeExpiration  The length of time in seconds until the
   *                                  user's password expires, or -1 if the
   *                                  user's password will not expire or the
   *                                  expiration time is unknown.
   */
  public AccountUsableResponseControl(boolean isCritical,
                                      int secondsBeforeExpiration)
  {
    super(OID_ACCOUNT_USABLE_CONTROL, isCritical);
    this.secondsBeforeExpiration = secondsBeforeExpiration;
@@ -194,37 +316,50 @@
  /**
   * Creates a new account usability response control that may be used to
   * indicate that the account is available and provide the number of seconds
   * until expiration.
   * indicate that the account is not available and provide information about
   * the underlying reason.  It will use the default OID and criticality.
   *
   * @param  oid                      The OID for this account usability
   *                                  response control.
   * @param  isCritical               Indicates whether this control should be
   *                                  marked critical.
   * @param  secondsBeforeExpiration  The length of time in seconds until the
   *                                  user's password expires, or -1 if the
   *                                  user's password will not expire or the
   *                                  expiration time is unknown.
   *                     considered critical in processing the
   *                     request.
   * @param  isInactive            Indicates whether the user's account has been
   *                               inactivated by an administrator.
   * @param  isReset               Indicates whether the user's password has
   *                               been reset by an administrator.
   * @param  isExpired             Indicates whether the user's password is
   *                               expired.
   * @param  remainingGraceLogins  The number of grace logins remaining.  A
   *                               value of zero indicates that there are none
   *                               remaining.  A value of -1 indicates that
   *                               grace login functionality is not enabled.
   * @param  isLocked              Indicates whether the user's account is
   *                               currently locked out.
   * @param  secondsBeforeUnlock   The length of time in seconds until the
   *                               account is unlocked.  A value of -1 indicates
   *                               that the account will not be automatically
   *                               unlocked and must be reset by an
   *                               administrator.
   */
  public AccountUsableResponseControl(String oid, boolean isCritical,
                                      int secondsBeforeExpiration)
  public AccountUsableResponseControl(boolean isCritical, boolean isInactive,
                                      boolean isReset,
                                      boolean isExpired,
                                      int remainingGraceLogins,
                                      boolean isLocked, int secondsBeforeUnlock)
  {
    super(oid, isCritical, encodeValue(secondsBeforeExpiration));
    super(OID_ACCOUNT_USABLE_CONTROL, isCritical);
    this.secondsBeforeExpiration = secondsBeforeExpiration;
    this.isInactive           = isInactive;
    this.isReset              = isReset;
    this.isExpired            = isExpired;
    this.remainingGraceLogins = remainingGraceLogins;
    this.isLocked             = isLocked;
    this.secondsBeforeUnlock  = secondsBeforeUnlock;
    isUsable             = true;
    isInactive           = false;
    isReset              = false;
    isExpired            = false;
    remainingGraceLogins = -1;
    isLocked             = false;
    secondsBeforeUnlock  = 0;
    isUsable                = false;
    secondsBeforeExpiration = -1;
  }
  /**
   * Creates a new account usability response control that may be used to
   * indicate that the account is not available and provide information about
@@ -253,341 +388,62 @@
                                      int remainingGraceLogins,
                                      boolean isLocked, int secondsBeforeUnlock)
  {
    super(OID_ACCOUNT_USABLE_CONTROL, false,
          encodeValue(isInactive, isReset, isExpired, remainingGraceLogins,
                      isLocked, secondsBeforeUnlock));
    this.isInactive           = isInactive;
    this.isReset              = isReset;
    this.isExpired            = isExpired;
    this.remainingGraceLogins = remainingGraceLogins;
    this.isLocked             = isLocked;
    this.secondsBeforeUnlock  = secondsBeforeUnlock;
    isUsable                = false;
    secondsBeforeExpiration = -1;
    this(false, isInactive, isReset, isExpired, remainingGraceLogins,
        isLocked, secondsBeforeUnlock);
  }
  /**
   * Creates a new account usability response control that may be used to
   * indicate that the account is not available and provide information about
   * the underlying reason.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid                   The OID for this account usability response
   *                               control.
   * @param  isCritical            Indicates whether this control should be
   *                               marked critical.
   * @param  isInactive            Indicates whether the user's account has been
   *                               inactivated by an administrator.
   * @param  isReset               Indicates whether the user's password has
   *                               been reset by an administrator.
   * @param  isExpired             Indicates whether the user's password is
   *                               expired.
   * @param  remainingGraceLogins  The number of grace logins remaining.  A
   *                               value of zero indicates that there are none
   *                               remaining.  A value of -1 indicates that
   *                               grace login functionality is not enabled.
   * @param  isLocked              Indicates whether the user's account is
   *                               currently locked out.
   * @param  secondsBeforeUnlock   The length of time in seconds until the
   *                               account is unlocked.  A value of -1 indicates
   *                               that the account will not be automatically
   *                               unlocked and must be reset by an
   *                               administrator.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public AccountUsableResponseControl(String oid, boolean isCritical,
                                      boolean isInactive, boolean isReset,
                                      boolean isExpired,
                                      int remainingGraceLogins,
                                      boolean isLocked, int secondsBeforeUnlock)
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    if(secondsBeforeExpiration < 0)
  {
    super(oid, isCritical,
          encodeValue(isInactive, isReset, isExpired, remainingGraceLogins,
                      isLocked, secondsBeforeUnlock));
    this.isInactive           = isInactive;
    this.isReset              = isReset;
    this.isExpired            = isExpired;
    this.remainingGraceLogins = remainingGraceLogins;
    this.isLocked             = isLocked;
    this.secondsBeforeUnlock  = secondsBeforeUnlock;
    isUsable                = false;
    secondsBeforeExpiration = -1;
  }
  /**
   * Creates a new account usability response control using the provided
   * information.  This version of the constructor is only intended for internal
   * use.
   *
   * @param  oid                      The OID for this account usability
   *                                  response control.
   * @param  isCritical               Indicates whether this control should be
   *                                  marked critical.
   * @param  isAvailable              Indicates whether the user's account is
   *                                  available for use.
   * @param  secondsBeforeExpiration  The length of time in seconds until the
   *                                  user's password expires, or -1 if the
   *                                  user's password will not expire or the
   *                                  expiration time is unknown.
   * @param  isInactive               Indicates whether the user's account has
   *                                  been inactivated by an administrator.
   * @param  isReset                  Indicates whether the user's password has
   *                                  been reset by an administrator.
   * @param  isExpired                Indicates whether the user's password is
   *                                  expired.
   * @param  remainingGraceLogins     The number of grace logins remaining.  A
   *                                  value of zero indicates that there are
   *                                  none remaining.  A value of -1 indicates
   *                                  that grace login functionality is not
   *                                  enabled.
   * @param  isLocked                 Indicates whether the user's account is
   *                                  currently locked out.
   * @param  secondsBeforeUnlock      The length of time in seconds until the
   *                                  account is unlocked.  A value of -1
   *                                  indicates that the account will not be
   *                                  automatically unlocked and must be reset
   *                                  by an administrator.
   * @param  encodedValue             The pre-encoded value for this account
   *                                  usable response control.
   */
  private AccountUsableResponseControl(String oid, boolean isCritical,
                                             boolean isAvailable,
                                             int secondsBeforeExpiration,
                                             boolean isInactive,
                                             boolean isReset, boolean isExpired,
                                             int remainingGraceLogins,
                                             boolean isLocked,
                                             int secondsBeforeUnlock,
                                             ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
    this.isUsable                = isAvailable;
    this.secondsBeforeExpiration = secondsBeforeExpiration;
    this.isInactive              = isInactive;
    this.isReset                 = isReset;
    this.isExpired               = isExpired;
    this.remainingGraceLogins    = remainingGraceLogins;
    this.isLocked                = isLocked;
    this.secondsBeforeUnlock     = secondsBeforeUnlock;
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the value for an account usable response control in which the use's
   * account is available.
   *
   * @param  secondsBeforeExpiration  The length of time in seconds until the
   *                                  user's password expires, or -1 if the
   *                                  user's password will not expire or the
   *                                  expiration time is unknown.
   *
   * @return  An ASN.1 octet string containing the encoded control value.
   */
  private static ASN1OctetString encodeValue(int secondsBeforeExpiration)
  {
    ASN1Integer sbeInteger = new ASN1Integer(TYPE_SECONDS_BEFORE_EXPIRATION,
      writer.writeInteger(TYPE_SECONDS_BEFORE_EXPIRATION,
                                             secondsBeforeExpiration);
    return new ASN1OctetString(sbeInteger.encode());
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the value for an account usable response control in which the user's
   * account is not available.
   *
   *
   * @param  isInactive            Indicates whether the user's account has been
   *                               inactivated by an administrator.
   * @param  isReset               Indicates whether the user's password has
   *                               been reset by an administrator.
   * @param  isExpired             Indicates whether the user's password is
   *                               expired.
   * @param  remainingGraceLogins  The number of grace logins remaining.  A
   *                               value of zero indicates that there are none
   *                               remaining.  A value of -1 indicates that
   *                               grace login functionality is not enabled.
   * @param  isLocked              Indicates whether the user's account is
   *                               currently locked out.
   * @param  secondsBeforeUnlock   The length of time in seconds until the
   *                               account is unlocked.  A value of -1 indicates
   *                               that the account will not be automatically
   *                               unlocked and must be reset by an
   *                               administrator.
   *
   * @return  An ASN.1 octet string containing the encoded control value.
   */
  private static ASN1OctetString encodeValue(boolean isInactive,
                                             boolean isReset, boolean isExpired,
                                             int remainingGraceLogins,
                                             boolean isLocked,
                                             int secondsBeforeUnlock)
    else
  {
    ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(5);
      writer.writeStartSequence(TYPE_MORE_INFO);
    if (isInactive)
    {
      elements.add(new ASN1Boolean(TYPE_INACTIVE, true));
        writer.writeBoolean(TYPE_INACTIVE, true);
    }
    if (isReset)
    {
      elements.add(new ASN1Boolean(TYPE_RESET, true));
        writer.writeBoolean(TYPE_RESET, true);
    }
    if (isExpired)
    {
      elements.add(new ASN1Boolean(TYPE_EXPIRED, true));
        writer.writeBoolean(TYPE_EXPIRED, true);
      if (remainingGraceLogins >= 0)
      {
        elements.add(new ASN1Integer(TYPE_REMAINING_GRACE_LOGINS,
                                     remainingGraceLogins));
          writer.writeInteger(TYPE_REMAINING_GRACE_LOGINS,
              remainingGraceLogins);
      }
    }
    if (isLocked)
    {
      elements.add(new ASN1Integer(TYPE_SECONDS_BEFORE_UNLOCK,
                                   secondsBeforeUnlock));
        writer.writeInteger(TYPE_SECONDS_BEFORE_UNLOCK,
            secondsBeforeUnlock);
      }
      writer.writeEndSequence();
    }
    ASN1Sequence moreInfoSequence = new ASN1Sequence(TYPE_MORE_INFO,
                                                     elements);
    return new ASN1OctetString(moreInfoSequence.encode());
    writer.writeEndSequence();
  }
  /**
   * Creates a new account usable response control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this account usable response control.
   *
   * @return  The account usable response control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         account usable response control.
   */
  public static AccountUsableResponseControl decodeControl(Control control)
         throws LDAPException
  {
    ASN1OctetString controlValue = control.getValue();
    if (controlValue == null)
    {
      // The response control must always have a value.
      Message message = ERR_ACCTUSABLERES_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    try
    {
      ASN1Element valueElement = ASN1Element.decode(controlValue.value());
      switch (valueElement.getType())
      {
        case TYPE_SECONDS_BEFORE_EXPIRATION:
          int secondsBeforeExpiration =
                   valueElement.decodeAsInteger().intValue();
          return new AccountUsableResponseControl(control.getOID(),
                                                  control.isCritical(), true,
                                                  secondsBeforeExpiration,
                                                  false, false, false, -1,
                                                  false, 0, controlValue);
        case TYPE_MORE_INFO:
          boolean isInactive = false;
          boolean isReset = false;
          boolean isExpired = false;
          boolean isLocked = false;
          int     remainingGraceLogins = -1;
          int     secondsBeforeUnlock = 0;
          for (ASN1Element e : valueElement.decodeAsSequence().elements())
          {
            switch (e.getType())
            {
              case TYPE_INACTIVE:
                isInactive = e.decodeAsBoolean().booleanValue();
                break;
              case TYPE_RESET:
                isReset = e.decodeAsBoolean().booleanValue();
                break;
              case TYPE_EXPIRED:
                isExpired = e.decodeAsBoolean().booleanValue();
                break;
              case TYPE_REMAINING_GRACE_LOGINS:
                remainingGraceLogins = e.decodeAsInteger().intValue();
                break;
              case TYPE_SECONDS_BEFORE_UNLOCK:
                isLocked = true;
                secondsBeforeUnlock = e.decodeAsInteger().intValue();
                break;
              default:
                Message message = ERR_ACCTUSABLERES_UNKNOWN_UNAVAILABLE_TYPE.
                    get(byteToHex(e.getType()));
                throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
            }
          }
          return new AccountUsableResponseControl(control.getOID(),
                                                  control.isCritical(), false,
                                                  -1, isInactive, isReset,
                                                  isExpired,
                                                  remainingGraceLogins,
                                                  isLocked, secondsBeforeUnlock,
                                                  controlValue);
        default:
          Message message = ERR_ACCTUSABLERES_UNKNOWN_VALUE_ELEMENT_TYPE.get(
              byteToHex(valueElement.getType()));
          throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (ASN1Exception ae)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ae);
      }
      Message message = ERR_ACCTUSABLERES_DECODE_ERROR.get(ae.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_ACCTUSABLERES_DECODE_ERROR.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
  }
  /**
   * Indicates whether the associated user account is available for use.
@@ -703,20 +559,6 @@
  /**
   * Retrieves a string representation of this password policy response control.
   *
   * @return  A string representation of this password policy response control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this password policy response control to
   * the provided buffer.
   *
opendj-sdk/opends/src/server/org/opends/server/controls/AuthorizationIdentityResponseControl.java
@@ -29,15 +29,13 @@
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.DN;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
/**
@@ -49,7 +47,50 @@
public class AuthorizationIdentityResponseControl
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<AuthorizationIdentityResponseControl>
  {
    /**
     * {@inheritDoc}
     */
    public AuthorizationIdentityResponseControl decode(boolean isCritical,
                                                       ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_AUTHZIDRESP_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      try
      {
        String authID = value.toString();
        return new AuthorizationIdentityResponseControl(isCritical,
            authID);
      }
      catch(Exception e)
      {
        // TODO: message.
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, Message.EMPTY);
      }
    }
    public String getOID()
    {
      return OID_AUTHZID_RESPONSE;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<AuthorizationIdentityResponseControl>
      DECODER = new Decoder();
  // The authorization ID for this control.
@@ -63,8 +104,20 @@
   */
  public AuthorizationIdentityResponseControl()
  {
    super(OID_AUTHZID_RESPONSE, false, new ASN1OctetString());
    this(false);
  }
  /**
   * Creates a new authorization identity response control using the default
   * settings to indicate an anonymous authentication.
   *
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   */
  public AuthorizationIdentityResponseControl(boolean isCritical)
  {
    super(OID_AUTHZID_RESPONSE, isCritical);
  }
@@ -77,7 +130,23 @@
   */
  public AuthorizationIdentityResponseControl(String authorizationID)
  {
    super(OID_AUTHZID_RESPONSE, false, encodeValue(authorizationID));
    this(false, authorizationID);
  }
  /**
   * Creates a new authorization identity response control with the provided
   * information.
   *
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   * @param  authorizationID  The authorization ID for this control.
   */
  public AuthorizationIdentityResponseControl(boolean isCritical,
                                              String authorizationID)
  {
    super(OID_AUTHZID_RESPONSE, isCritical);
    this.authorizationID = authorizationID;
@@ -85,6 +154,7 @@
  /**
   * Creates a new authorization identity response control with the provided
   * information.
@@ -93,7 +163,7 @@
   */
  public AuthorizationIdentityResponseControl(DN authorizationDN)
  {
    super(OID_AUTHZID_RESPONSE, false, encodeValue(authorizationDN));
    super(OID_AUTHZID_RESPONSE, false);
    if (authorizationDN == null)
@@ -109,142 +179,14 @@
  /**
   * Creates a new authorization identity response control with the provided
   * information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid              The OID to use for this control.
   * @param  isCritical       Indicates whether this control should be
   *                          considered a critical part of the response
   *                          processing.
   * @param  authorizationID  The authorization ID for this control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public AuthorizationIdentityResponseControl(String oid, boolean isCritical,
                                              String authorizationID)
  {
    super(oid, isCritical, encodeValue(authorizationID));
    this.authorizationID = authorizationID;
  }
  /**
   * Creates a new authorization identity response control with the provided
   * information.
   *
   * @param  oid              The OID to use for this control.
   * @param  isCritical       Indicates whether this control should be
   *                          considered a critical part of the response
   *                          processing.
   * @param  authorizationDN  The authorization DN for this control.
   */
  public AuthorizationIdentityResponseControl(String oid, boolean isCritical,
                                              DN authorizationDN)
  {
    super(oid, isCritical, encodeValue(authorizationDN));
    if (authorizationDN == null)
    {
      this.authorizationID = "dn:";
    }
    else
    {
      this.authorizationID = "dn:" + authorizationDN.toString();
    }
  }
  /**
   * Creates a new authorization identity response control with the provided
   * information.
   *
   * @param  oid              The OID to use for this control.
   * @param  isCritical       Indicates whether this control should be
   *                          considered a critical part of the response
   *                          processing.
   * @param  authorizationID  The authorization ID for this control.
   * @param  encodedValue     The encoded value for the control.
   */
  private AuthorizationIdentityResponseControl(String oid, boolean isCritical,
                                               String authorizationID,
                                               ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
    this.authorizationID = authorizationID;
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the control value.
   *
   * @param  authorizationID  The authorization ID for this authorization ID
   *                          response control.
   *
   * @return  An ASN.1 octet string containing the encoded information.
   */
  private static ASN1OctetString encodeValue(String authorizationID)
  {
    return new ASN1OctetString(authorizationID);
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the control value.
   *
   * @param  authorizationDN  The authorization DN for this authorization ID
   *                          response control.
   *
   * @return  An ASN.1 octet string containing the encoded information.
   */
  private static ASN1OctetString encodeValue(DN authorizationDN)
  {
    if (authorizationDN == null)
    {
      return new ASN1OctetString("dn:");
    }
    else
    {
      return new ASN1OctetString("dn:" + authorizationDN.toString());
    }
  }
  /**
   * Creates a new authorization identity response control from the contents of
   * the provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this authorization identity response control.
   *
   * @return  The authorization identity response control decoded from the
   *          provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         authorization identity response control.
   */
  public static AuthorizationIdentityResponseControl decodeControl(
                                                          Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_AUTHZIDRESP_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    return new AuthorizationIdentityResponseControl(control.getOID(),
                    control.isCritical(), control.getValue().stringValue(),
                    control.getValue());
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeOctetString(authorizationID);
  }
@@ -264,37 +206,6 @@
  /**
   * Specifies the authorization ID for this authorization identity response
   * control.
   *
   * @param  authorizationID  The authorization ID for this authorization
   *                          identity response control.
   */
  public void setAuthorizationID(String authorizationID)
  {
    this.authorizationID = authorizationID;
    setValue(encodeValue(authorizationID));
  }
  /**
   * Retrieves a string representation of this authorization identity response
   * control.
   *
   * @return  A string representation of this authorization identity response
   *          control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this authorization identity response
   * control to the provided buffer.
   *
opendj-sdk/opends/src/server/org/opends/server/controls/ControlDecoder.java
New file
@@ -0,0 +1,68 @@
/*
 * 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/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * 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 2008 Sun Microsystems, Inc.
 */
package org.opends.server.controls;
import org.opends.server.types.ByteString;
import org.opends.server.types.Control;
import org.opends.server.types.DirectoryException;
/**
 * An interface for decoding controls.
 *
 * @param <T>
 *          The type of control decoded by this decoder.
 */
public interface ControlDecoder<T extends Control>
{
  /**
   * Decodes the provided control.
   *
   * @param isCritical
   *          Indicates whether the control should be considered
   *          critical.
   * @param value
   *          The value for the control.
   * @return The decoded control.
   * @throws DirectoryException
   *           If the control could not be decoded.
   */
  T decode(boolean isCritical, ByteString value) throws DirectoryException;
  /**
   * Gets the OID of the control decoded by this decoded.
   *
   * @return The OID of the control decoded by this decoded.
   */
  String getOID();
}
opendj-sdk/opends/src/server/org/opends/server/controls/EntryChangeNotificationControl.java
@@ -28,20 +28,12 @@
import org.opends.messages.Message;
import java.io.IOException;
import java.util.ArrayList;
import org.opends.server.protocols.asn1.ASN1Constants;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Enumerated;
import org.opends.server.protocols.asn1.ASN1Long;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.DN;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -60,6 +52,94 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<EntryChangeNotificationControl>
  {
    /**
     * {@inheritDoc}
     */
    public EntryChangeNotificationControl decode(
        boolean isCritical, ByteString value) throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_ECN_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      DN                         previousDN   = null;
      long                       changeNumber = -1;
      PersistentSearchChangeType changeType;
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        reader.readStartSequence();
        int changeTypeValue = (int)reader.readInteger();
        changeType = PersistentSearchChangeType.valueOf(changeTypeValue);
        while(reader.hasNextElement()) {
          switch(reader.peekType()) {
            case ASN1Constants.UNIVERSAL_OCTET_STRING_TYPE :
              if (changeType != PersistentSearchChangeType.MODIFY_DN)
              {
                Message message =
                    ERR_ECN_ILLEGAL_PREVIOUS_DN.get(String.valueOf(changeType));
                throw new DirectoryException(
                    ResultCode.PROTOCOL_ERROR, message);
              }
              previousDN = DN.decode(reader.readOctetStringAsString());
              break;
            case ASN1Constants.UNIVERSAL_INTEGER_TYPE :
              changeNumber = reader.readInteger();
              break;
            default :
              Message message =
                  ERR_ECN_INVALID_ELEMENT_TYPE.get(
                      byteToHex(reader.peekType()));
              throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
          }
        }
      }
      catch (DirectoryException de)
      {
        throw de;
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_ECN_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
      return new EntryChangeNotificationControl(isCritical, changeType,
          previousDN, changeNumber);
    }
    public String getOID()
    {
      return OID_ENTRY_CHANGE_NOTIFICATION;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<EntryChangeNotificationControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -77,20 +157,22 @@
  private PersistentSearchChangeType changeType;
  /**
   * Creates a new entry change notification control with the provided
   * information.
   *
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   * @param  changeType    The change type for this change notification control.
   * @param  changeNumber  The change number for the associated change, or a
   *                       negative value if no change number is available.
   */
  public EntryChangeNotificationControl(PersistentSearchChangeType changeType,
  public EntryChangeNotificationControl(boolean isCritical,
                                        PersistentSearchChangeType changeType,
                                        long changeNumber)
  {
    super(OID_ENTRY_CHANGE_NOTIFICATION, false,
          encodeValue(changeType, null, changeNumber));
    super(OID_ENTRY_CHANGE_NOTIFICATION, isCritical);
    this.changeType   = changeType;
@@ -105,6 +187,49 @@
   * Creates a new entry change notification control with the provided
   * information.
   *
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   * @param  changeType    The change type for this change notification control.
   * @param  previousDN    The DN that the entry had prior to a modify DN
   *                       operation, or <CODE>null</CODE> if the operation was
   *                       not a modify DN.
   * @param  changeNumber  The change number for the associated change, or a
   *                       negative value if no change number is available.
   */
  public EntryChangeNotificationControl(boolean isCritical,
                                        PersistentSearchChangeType changeType,
                                        DN previousDN, long changeNumber)
  {
    super(OID_ENTRY_CHANGE_NOTIFICATION, isCritical);
    this.changeType   = changeType;
    this.previousDN   = previousDN;
    this.changeNumber = changeNumber;
  }
  /**
   * Creates a new entry change notification control with the provided
   * information.
   *
   * @param  changeType    The change type for this change notification control.
   * @param  changeNumber  The change number for the associated change, or a
   *                       negative value if no change number is available.
   */
  public EntryChangeNotificationControl(PersistentSearchChangeType changeType,
                                        long changeNumber)
  {
    this(false, changeType, changeNumber);
  }
  /**
   * Creates a new entry change notification control with the provided
   * information.
   *
   * @param  changeType    The change type for this change notification control.
   * @param  previousDN    The DN that the entry had prior to a modify DN
   *                       operation, or <CODE>null</CODE> if the operation was
@@ -115,213 +240,36 @@
  public EntryChangeNotificationControl(PersistentSearchChangeType changeType,
                                        DN previousDN, long changeNumber)
  {
    super(OID_ENTRY_CHANGE_NOTIFICATION, false,
          encodeValue(changeType, previousDN, changeNumber));
    this.changeType   = changeType;
    this.previousDN   = previousDN;
    this.changeNumber = changeNumber;
    this(false, changeType, previousDN, changeNumber);
  }
  /**
   * Creates a new entry change notification control with the provided
   * information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether this control should be considered
   *                       critical to the operation processing.
   * @param  changeType    The change type for this change notification control.
   * @param  previousDN    The DN that the entry had prior to a modify DN
   *                       operation, or <CODE>null</CODE> if the operation was
   *                       not a modify DN.
   * @param  changeNumber  The change number for the associated change, or a
   *                       negative value if no change number is available.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public EntryChangeNotificationControl(String oid, boolean isCritical,
                                        PersistentSearchChangeType changeType,
                                        DN previousDN, long changeNumber)
  {
    super(oid, isCritical, encodeValue(changeType, previousDN, changeNumber));
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    this.changeType   = changeType;
    this.previousDN   = previousDN;
    this.changeNumber = changeNumber;
  }
  /**
   * Creates a new entry change notification control with the provided
   * information.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether this control should be considered
   *                       critical to the operation processing.
   * @param  changeType    The change type for this change notification control.
   * @param  previousDN    The DN that the entry had prior to a modify DN
   *                       operation, or <CODE>null</CODE> if the operation was
   *                       not a modify DN.
   * @param  changeNumber  The change number for the associated change, or a
   *                       negative value if no change number is available.
   * @param  encodedValue  The pre-encoded value for this change notification
   *                       control.
   */
  private EntryChangeNotificationControl(String oid, boolean isCritical,
                                         PersistentSearchChangeType changeType,
                                         DN previousDN, long changeNumber,
                                         ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
    this.changeType   = changeType;
    this.previousDN   = previousDN;
    this.changeNumber = changeNumber;
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the control value.
   *
   * @param  changeType    The change type for this change notification control.
   * @param  previousDN    The DN that the entry had prior to a modify DN
   *                       operation, or <CODE>null</CODE> if the operation was
   *                       not a modify DN.
   * @param  changeNumber  The change number for the associated change, or a
   *                       negative value if no change number is available.
   *
   * @return  An ASN.1 octet string containing the encoded information.
   */
  private static ASN1OctetString encodeValue(PersistentSearchChangeType
                                                  changeType,
                                             DN previousDN, long changeNumber)
  {
    ArrayList<ASN1Element> elements =
         new ArrayList<ASN1Element>(3);
    elements.add(new ASN1Enumerated(changeType.intValue()));
    writer.writeStartSequence();
    writer.writeInteger(changeType.intValue());
    if (previousDN != null)
    {
      elements.add(new ASN1OctetString(previousDN.toString()));
      writer.writeOctetString(previousDN.toString());
    }
    if (changeNumber > 0)
    {
      elements.add(new ASN1Long(changeNumber));
      writer.writeInteger(changeNumber);
    }
    writer.writeEndSequence();
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
  }
  /**
   * Creates a new entry change notification control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this entry change notification control.
   *
   * @return  The entry change notification control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         entry change notification control.
   */
  public static EntryChangeNotificationControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_ECN_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    DN                         previousDN   = null;
    long                       changeNumber = -1;
    PersistentSearchChangeType changeType;
    try
    {
      ArrayList<ASN1Element> elements =
           ASN1Sequence.decodeAsSequence(control.getValue().value()).elements();
      if ((elements.size() < 1) || (elements.size() > 3))
      {
        Message message = ERR_ECN_INVALID_ELEMENT_COUNT.get(elements.size());
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      int changeTypeValue = elements.get(0).decodeAsEnumerated().intValue();
      changeType = PersistentSearchChangeType.valueOf(changeTypeValue);
      if (elements.size() == 2)
      {
        ASN1Element e = elements.get(1);
        if (e.getType() == ASN1Constants.UNIVERSAL_OCTET_STRING_TYPE)
        {
          if (changeType != PersistentSearchChangeType.MODIFY_DN)
          {
            Message message =
                ERR_ECN_ILLEGAL_PREVIOUS_DN.get(String.valueOf(changeType));
            throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
          }
          ASN1OctetString rawPreviousDN = e.decodeAsOctetString();
          previousDN = DN.decode(rawPreviousDN);
        }
        else if (e.getType() == ASN1Constants.UNIVERSAL_INTEGER_TYPE)
        {
          changeNumber = e.decodeAsLong().longValue();
        }
        else
        {
          Message message =
              ERR_ECN_INVALID_ELEMENT_TYPE.get(byteToHex(e.getType()));
          throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
        }
      }
      else if (elements.size() == 3)
      {
        if (changeType != PersistentSearchChangeType.MODIFY_DN)
        {
          Message message =
              ERR_ECN_ILLEGAL_PREVIOUS_DN.get(String.valueOf(changeType));
          throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
        }
        ASN1OctetString rawPreviousDN = elements.get(1).decodeAsOctetString();
        previousDN = DN.decode(rawPreviousDN);
        changeNumber = elements.get(2).decodeAsLong().longValue();
      }
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message = ERR_ECN_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
    return new EntryChangeNotificationControl(control.getOID(),
                                              control.isCritical(), changeType,
                                              previousDN, changeNumber,
                                              control.getValue());
    writer.writeEndSequence();
  }
@@ -337,22 +285,6 @@
  }
  /**
   * Sets the change type for this entry change notification control.
   *
   * @param  changeType  The change type for this entry change notification
   *                     control.
   */
  public void setChangeType(PersistentSearchChangeType changeType)
  {
    this.changeType = changeType;
    setValue(encodeValue(changeType, previousDN, changeNumber));
  }
  /**
   * Retrieves the previous DN for this entry change notification control.
   *
@@ -367,21 +299,6 @@
  /**
   * Specifies the previous DN for this entry change notification control.
   *
   * @param  previousDN  The previous DN for this entry change notification
   *                     control.
   */
  public void setPreviousDN(DN previousDN)
  {
    this.previousDN = previousDN;
    setValue(encodeValue(changeType, previousDN, changeNumber));
  }
  /**
   * Retrieves the change number for this entry change notification control.
   *
   * @return  The change number for this entry change notification control, or a
@@ -395,36 +312,6 @@
  /**
   * Specifies the change number for this entry change notification control.
   *
   * @param  changeNumber  The change number for this entry change notification
   *                       control.
   */
  public void setChangeNumber(long changeNumber)
  {
    this.changeNumber = changeNumber;
    setValue(encodeValue(changeType, previousDN, changeNumber));
  }
  /**
   * Retrieves a string representation of this entry change notification
   * control.
   *
   * @return  A string representation of this entry change notification control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this entry change notification control
   * to the provided buffer.
   *
opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRights.java
File was deleted
opendj-sdk/opends/src/server/org/opends/server/controls/GetEffectiveRightsRequestControl.java
New file
@@ -0,0 +1,287 @@
/*
 * 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/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * 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 2009 Sun Microsystems, Inc.
 */
package org.opends.server.controls;
import org.opends.messages.Message;
import org.opends.server.types.*;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import static org.opends.server.util.ServerConstants.OID_GET_EFFECTIVE_RIGHTS;
import org.opends.server.core.DirectoryServer;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import java.util.List;
import java.util.LinkedList;
import java.io.IOException;
/**
 * This class partially implements the geteffectiverights control as defined
 * in draft-ietf-ldapext-acl-model-08.txt. The main differences are:
 *
 *  - The response control is not supported. Instead the dseecompat
 *    geteffectiverights control implementation creates attributes containing
 *    right information strings and adds those attributes to the
 *    entry being returned. The attribute type names are dynamically created;
 *    see the dseecompat's AciGetEffectiveRights class for details.
 *
 *  - The dseecompat implementation allows additional attribute types
 *    in the request control for which rights information can be returned.
 *    These are known as the specified attribute types.
 *
 * The dseecompat request control value is the following:
 *
 * <BR>
 * <PRE>
 *  GetRightsControl ::= SEQUENCE {
 *    authzId    authzId
 *    attributes  SEQUENCE OF AttributeType
 *  }
 *
 *   -- Only the "dn:DN form is supported.
 *
 * </PRE>
 *
 **/
public class GetEffectiveRightsRequestControl extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private static final class Decoder
      implements ControlDecoder<GetEffectiveRightsRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public GetEffectiveRightsRequestControl decode(boolean isCritical,
        ByteString value) throws DirectoryException
    {
      // If the value is null create a GetEffectiveRightsRequestControl
      // class with null authzDN and attribute list, else try to
      // decode the value.
      if (value == null)
        return new GetEffectiveRightsRequestControl(isCritical, (DN)null,
            (List<AttributeType>)null);
      else
      {
        ASN1Reader reader = ASN1.getReader(value);
        DN authzDN;
        List<AttributeType> attrs=null;
        String authzIDString="";
        try {
          reader.readStartSequence();
          authzIDString = reader.readOctetStringAsString();
          String lowerAuthzIDString = authzIDString.toLowerCase();
          //Make sure authzId starts with "dn:" and is a valid DN.
          if (lowerAuthzIDString.startsWith("dn:"))
            authzDN = DN.decode(authzIDString.substring(3));
          else {
            Message message = INFO_GETEFFECTIVERIGHTS_INVALID_AUTHZID.get(
                lowerAuthzIDString);
            throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
          }
          //There is an sequence containing an attribute list, try to decode it.
          if(reader.hasNextElement()) {
            AttributeType attributeType;
            attrs = new LinkedList<AttributeType>();
            reader.readStartSequence();
            while(reader.hasNextElement()) {
              //Decode as an octet string.
              String attrStr = reader.readOctetStringAsString();
              //Get an attribute type for it and add to the list.
              if((attributeType =
                  DirectoryServer.getAttributeType(attrStr)) == null)
                attributeType =
                    DirectoryServer.getDefaultAttributeType(attrStr);
              attrs.add(attributeType);
            }
            reader.readEndSequence();
          }
          reader.readEndSequence();
        } catch (ASN1Exception e) {
          if (debugEnabled()) {
            TRACER.debugCaught(DebugLogLevel.ERROR, e);
          }
          Message message =
              INFO_GETEFFECTIVERIGHTS_DECODE_ERROR.get(e.getMessage());
          throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
        }
        return new GetEffectiveRightsRequestControl(isCritical,
            authzDN, attrs);
      }
    }
    public String getOID()
    {
      return OID_GET_EFFECTIVE_RIGHTS;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<GetEffectiveRightsRequestControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
  //The DN representing the authzId. May be null.
  private DN authzDN=null;
  //The raw DN representing the authzId. May be null.
  private String rawAuthzDN=null;
  //The list of additional attribute types to return rights for. May be null.
  private List<AttributeType> attrs=null;
  //The raw DN representing the authzId. May be null.
  private List<String> rawAttrs=null;
  /**
   * Create a new geteffectiverights control with the specified authzDN and
   * an attribute list.
   *
   * @param authzDN  The authzDN.
   *
   * @param attrs  The list of additional attributes to be returned.
   */
  public GetEffectiveRightsRequestControl(DN authzDN,
                            List<AttributeType> attrs) {
    this(true, authzDN, attrs);
  }
  /**
   * Create a new geteffectiverights control with the specified authzDN and
   * an attribute list.
   *
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   * @param authzDN  The authzDN.
   * @param attrs  The list of additional attributes to be returned.
   */
  public GetEffectiveRightsRequestControl(boolean isCritical, DN authzDN,
                                          List<AttributeType> attrs) {
    super(OID_GET_EFFECTIVE_RIGHTS, isCritical);
    this.authzDN=authzDN;
    this.attrs=attrs;
  }
  /**
   * Create a new geteffectiverights control with the specified raw
   * authzDN and an attribute list.
   *
   * @param  isCritical  Indicates whether this control should be
   *                     considered critical in processing the
   *                     request.
   * @param authzDN  The authzDN.
   * @param attrs  The list of additional attributes to be returned.
   */
  public GetEffectiveRightsRequestControl(boolean isCritical,
                                          String authzDN,
                                          List<String> attrs)
  {
    super(OID_GET_EFFECTIVE_RIGHTS, isCritical);
    this.rawAuthzDN=authzDN;
    this.rawAttrs=attrs;
  }
  /**
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    if(authzDN != null)
    {
      writer.writeOctetString("dn:" + authzDN.toString());
    }
    else if(rawAuthzDN != null)
    {
      writer.writeOctetString("dn:" + rawAuthzDN);
    }
    if(attrs != null)
    {
      writer.writeStartSequence();
      for(AttributeType attr : attrs)
      {
        writer.writeOctetString(attr.getNameOrOID());
      }
      writer.writeEndSequence();
    }
    else if(rawAttrs != null)
    {
      writer.writeStartSequence();
      for(String attr : rawAttrs)
      {
        writer.writeOctetString(attr);
      }
      writer.writeEndSequence();
    }
    writer.writeEndSequence();
    writer.writeEndSequence();
  }
  /**
   * Return the authzDN parsed from the control.
   *
   * @return The DN representing the authzId.
   */
  public DN getAuthzDN () {
    return authzDN;
    // TODO: what if rawAuthzDN is not null?
  }
  /**
   * Return the requested additional attributes parsed from the control. Known
   * as the specified attributes.
   *
   * @return  The list containing any additional attributes to return rights
   *          about.
   */
  public List<AttributeType> getAttributes() {
    return attrs;
  }
}
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPAssertionRequestControl.java
@@ -28,23 +28,16 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.protocols.ldap.LDAPFilter;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.types.SearchFilter;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
/**
@@ -58,10 +51,51 @@
       extends Control
{
  /**
   * The tracer object for the debug logger.
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private static final DebugTracer TRACER = getTracer();
  private final static class Decoder
      implements ControlDecoder<LDAPAssertionRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public LDAPAssertionRequestControl decode(boolean isCritical,
                                              ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_LDAPASSERT_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      LDAPFilter filter;
      try
      {
        filter = LDAPFilter.decode(reader);
      }
      catch (LDAPException e)
      {
        throw new DirectoryException(ResultCode.valueOf(e.getResultCode()), e
            .getMessageObject(), e.getCause());
      }
      return new LDAPAssertionRequestControl(isCritical, filter);
    }
    public String getOID()
    {
      return OID_LDAP_ASSERTION;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<LDAPAssertionRequestControl> DECODER =
    new Decoder();
@@ -84,8 +118,7 @@
   */
  public LDAPAssertionRequestControl(boolean isCritical, LDAPFilter rawFilter)
  {
    super(OID_LDAP_ASSERTION, isCritical,
          new ASN1OctetString(rawFilter.encode().encode()));
    super(OID_LDAP_ASSERTION, isCritical);
    this.rawFilter = rawFilter;
@@ -96,98 +129,17 @@
  /**
   * Creates a new instance of this LDAP assertion request control with the
   * provided information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid         The OID to use for this control.
   * @param  isCritical  Indicates whether support for this control should be
   *                     considered a critical part of the server processing.
   * @param  rawFilter   The unparsed LDAP search filter contained in the
   *                     request from the client.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public LDAPAssertionRequestControl(String oid, boolean isCritical,
                                     LDAPFilter rawFilter)
  {
    super(oid, isCritical, new ASN1OctetString(rawFilter.encode().encode()));
    this.rawFilter = rawFilter;
    filter = null;
  }
  /**
   * Creates a new instance of this LDAP assertion request control with the
   * provided information.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether support for this control should be
   *                       considered a critical part of the server processing.
   * @param  rawFilter     The unparsed LDAP search filter contained in the
   *                       request from the client.
   * @param  encodedValue  The pre-encoded value for this control.
   */
  private LDAPAssertionRequestControl(String oid, boolean isCritical,
                                      LDAPFilter rawFilter,
                                      ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
    this.rawFilter = rawFilter;
    filter = null;
  }
  /**
   * Creates a new LDAP assertion request control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this LDAP assertion request control.
   *
   * @return  The LDAP assertion control decoded from the provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid LDAP
   *                         assertion control.
   */
  public static LDAPAssertionRequestControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_LDAPASSERT_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    ASN1Element valueElement;
    try
    {
      valueElement = ASN1Element.decode(control.getValue().value());
    }
    catch (ASN1Exception ae)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ae);
      }
      Message message =
          ERR_LDAPASSERT_INVALID_CONTROL_VALUE.get(ae.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                              ae);
    }
    return new LDAPAssertionRequestControl(control.getOID(),
                                           control.isCritical(),
                                           LDAPFilter.decode(valueElement),
                                           control.getValue());
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    rawFilter.write(writer);
    writer.writeEndSequence();
  }
@@ -203,23 +155,6 @@
  }
  /**
   * Sets the raw, unparsed filter from the request control.  This method should
   * only be called by pre-parse plugins.
   *
   * @param  rawFilter  The raw, unparsed filter from the request control.
   */
  public void setRawFilter(LDAPFilter rawFilter)
  {
    this.rawFilter = rawFilter;
    this.filter    = null;
    setValue(new ASN1OctetString(rawFilter.encode().encode()));
  }
  /**
   * Retrieves the processed search filter for this control.
   *
@@ -242,25 +177,12 @@
  /**
   * Retrieves a string representation of this LDAP assertion request control.
   *
   * @return  A string representation of this LDAP assertion request control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this LDAP assertion request control to
   * the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("LDAPAssertionRequestControl(criticality=");
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPostReadRequestControl.java
@@ -28,25 +28,19 @@
import org.opends.messages.Message;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import java.io.IOException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.ObjectClass;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
@@ -63,6 +57,68 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<LDAPPostReadRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public LDAPPostReadRequestControl decode(boolean isCritical,
                                             ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_POSTREADREQ_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      LinkedHashSet<String> rawAttributes = new LinkedHashSet<String>();
      try
      {
        reader.readStartSequence();
        while(reader.hasNextElement())
        {
          rawAttributes.add(reader.readOctetStringAsString());
        }
        reader.readEndSequence();
      }
      catch (Exception ae)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, ae);
        }
        Message message =
            ERR_POSTREADREQ_CANNOT_DECODE_VALUE.get(ae.getMessage());
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message,
            ae);
      }
      return new LDAPPostReadRequestControl(isCritical,
          rawAttributes);
    }
    public String getOID()
    {
      return OID_LDAP_READENTRY_POSTREAD;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<LDAPPostReadRequestControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -79,10 +135,10 @@
  private boolean returnAllUserAttrs;
  // The set of raw attributes to return in the entry.
  private LinkedHashSet<String> rawAttributes;
  private Set<String> rawAttributes;
  // The set of processed attributes to return in the entry.
  private LinkedHashSet<AttributeType> requestedAttributes;
  private Set<AttributeType> requestedAttributes;
@@ -97,10 +153,9 @@
   *                        attributes should be returned.
   */
  public LDAPPostReadRequestControl(boolean isCritical,
                                    LinkedHashSet<String> rawAttributes)
                                    Set<String> rawAttributes)
  {
    super(OID_LDAP_READENTRY_POSTREAD, isCritical,
          encodeAttributes(rawAttributes));
    super(OID_LDAP_READENTRY_POSTREAD, isCritical);
    if (rawAttributes == null)
@@ -131,9 +186,9 @@
   *                        attributes should be returned.
   */
  public LDAPPostReadRequestControl(String oid, boolean isCritical,
                                    LinkedHashSet<String> rawAttributes)
                                    Set<String> rawAttributes)
  {
    super(oid, isCritical, encodeAttributes(rawAttributes));
    super(oid, isCritical);
    if (rawAttributes == null)
@@ -150,124 +205,29 @@
    returnAllUserAttrs        = false;
  }
  /**
   * Creates a new instance of this LDAP post-read request control with the
   * provided information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid            The OID to use for this control.
   * @param  isCritical     Indicates whether support for this control should be
   *                        considered a critical part of the server processing.
   * @param  rawAttributes  The set of raw attributes to return in the entry.
   *                        A null or empty set will indicates that all user
   *                        attributes should be returned.
   * @param  encodedValue   The post-encoded value for this control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private LDAPPostReadRequestControl(String oid, boolean isCritical,
                                     LinkedHashSet<String> rawAttributes,
                                     ASN1OctetString encodedValue)
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    if (rawAttributes != null)
  {
    super(oid, isCritical, encodedValue);
    if (rawAttributes == null)
    {
      this.rawAttributes = new LinkedHashSet<String>(0);
    }
    else
    {
      this.rawAttributes = rawAttributes;
    }
    requestedAttributes       = null;
    returnAllOperationalAttrs = false;
    returnAllUserAttrs        = false;
  }
  /**
   * Creates a new LDAP post-read request control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this LDAP post-read request control.
   *
   * @return  The LDAP post-read request control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid LDAP
   *                         post-read request control.
   */
  public static LDAPPostReadRequestControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_POSTREADREQ_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    LinkedHashSet<String> rawAttributes = new LinkedHashSet<String>();
    try
    {
      ASN1Sequence attrSequence =
           ASN1Sequence.decodeAsSequence(control.getValue().value());
      for (ASN1Element e : attrSequence.elements())
      {
        rawAttributes.add(e.decodeAsOctetString().stringValue());
      }
    }
    catch (ASN1Exception ae)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ae);
      }
      Message message =
          ERR_POSTREADREQ_CANNOT_DECODE_VALUE.get(ae.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                              ae);
    }
    return new LDAPPostReadRequestControl(control.getOID(),
                                          control.isCritical(),
                                          rawAttributes, control.getValue());
  }
  /**
   * Encodes the provided set of raw, unprocessed attribute names to an
   * ASN.1 octet string suitable for use as the value of this control.
   *
   * @param  rawAttributes  The set of attributes to encoded in the encoded
   *                        control value.
   *
   * @return  The ASN.1 octet string containing the encoded attribute set.
   */
  private static ASN1OctetString encodeAttributes(LinkedHashSet<String>
                                                       rawAttributes)
  {
    if (rawAttributes == null)
    {
      return new ASN1OctetString(new ASN1Sequence().encode());
    }
    ArrayList<ASN1Element> elements =
         new ArrayList<ASN1Element>(rawAttributes.size());
    for (String attr : rawAttributes)
    {
      elements.add(new ASN1OctetString(attr));
        writer.writeOctetString(attr);
    }
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
  }
    writer.writeEndSequence();
    writer.writeEndSequence();
  }
  /**
@@ -277,36 +237,12 @@
   *
   * @return  The raw, unprocessed set of attributes.
   */
  public LinkedHashSet<String> getRawAttributes()
  public Set<String> getRawAttributes()
  {
    return rawAttributes;
  }
  /**
   * Specifies the raw, unprocessed set of requested attributes.  A null or
   * empty set indicates that all user attributes should be returned.
   *
   * @param  rawAttributes  The raw, unprocessed set of requested attributes.
   */
  public void setRawAttributes(LinkedHashSet<String> rawAttributes)
  {
    if (rawAttributes == null)
    {
      this.rawAttributes = new LinkedHashSet<String>();
    }
    else
    {
      this.rawAttributes = rawAttributes;
    }
    setValue(encodeAttributes(rawAttributes));
    requestedAttributes = null;
  }
  /**
   * Retrieves the set of processed attributes that have been requested for
   * inclusion in the entry that is returned.
@@ -314,7 +250,7 @@
   * @return  The set of processed attributes that have been requested for
   *          inclusion in the entry that is returned.
   */
  public LinkedHashSet<AttributeType> getRequestedAttributes()
  public Set<AttributeType> getRequestedAttributes()
  {
    if (requestedAttributes == null)
    {
@@ -441,25 +377,12 @@
  /**
   * Retrieves a string representation of this LDAP post-read request control.
   *
   * @return  A string representation of this LDAP post-read request control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this LDAP post-read request control to
   * the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("LDAPPostReadRequestControl(criticality=");
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPostReadResponseControl.java
@@ -28,22 +28,18 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.protocols.ldap.SearchResultEntryProtocolOp;
import org.opends.server.types.Control;
import org.opends.server.types.SearchResultEntry;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.protocols.ldap.*;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
/**
@@ -55,6 +51,65 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<LDAPPostReadResponseControl>
  {
    /**
     * {@inheritDoc}
     */
    public LDAPPostReadResponseControl decode(boolean isCritical,
                                              ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_POSTREADRESP_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      SearchResultEntry searchEntry;
      try
      {
        SearchResultEntryProtocolOp searchResultEntryProtocolOp =
            LDAPReader.readSearchEntry(reader);
        searchEntry = searchResultEntryProtocolOp.toSearchResultEntry();
      }
      catch (LDAPException le)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, le);
        }
        Message message =
            ERR_POSTREADRESP_CANNOT_DECODE_VALUE.get(le.getMessage());
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message,
            le);
      }
      return new LDAPPostReadResponseControl(isCritical, searchEntry);
    }
    public String getOID()
    {
      return OID_LDAP_READENTRY_POSTREAD;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<LDAPPostReadResponseControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -76,11 +131,7 @@
   */
  public LDAPPostReadResponseControl(SearchResultEntry searchEntry)
  {
    super(OID_LDAP_READENTRY_POSTREAD, false,
          encodeEntry(searchEntry));
    this.searchEntry = searchEntry;
    this(false, searchEntry);
  }
@@ -89,122 +140,36 @@
   * Creates a new instance of this LDAP post-read response control with the
   * provided information.
   *
   * @param  oid          The OID to use for this control.
   * @param  isCritical   Indicates whether support for this control should be
   *                      considered a critical part of the server processing.
   * @param  searchEntry  The search result entry to include in the response
   *                      control.
   */
  public LDAPPostReadResponseControl(String oid, boolean isCritical,
  public LDAPPostReadResponseControl(boolean isCritical,
                                    SearchResultEntry searchEntry)
  {
    super(oid, isCritical, encodeEntry(searchEntry));
    super(OID_LDAP_READENTRY_POSTREAD, isCritical);
    this.searchEntry = searchEntry;
  }
  /**
   * Creates a new instance of this LDAP post-read response control with the
   * provided information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether support for this control should be
   *                       considered a critical part of the server processing.
   * @param  searchEntry   The search result entry to include in the response
   *                       control.
   * @param  encodedValue  The pre-encoded value for this control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private LDAPPostReadResponseControl(String oid, boolean isCritical,
                                      SearchResultEntry searchEntry,
                                      ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    this.searchEntry = searchEntry;
  }
  /**
   * Creates a new LDAP post-read response control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this LDAP post-read response control.
   *
   * @return  The LDAP post-read response control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid LDAP
   *                         post-read response control.
   */
  public static LDAPPostReadResponseControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_POSTREADRESP_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    ASN1OctetString controlValue = control.getValue();
    SearchResultEntry searchEntry;
    try
    {
      ASN1Element element = ASN1Element.decode(controlValue.value());
      SearchResultEntryProtocolOp searchResultEntryProtocolOp =
           SearchResultEntryProtocolOp.decodeSearchEntry(element);
      searchEntry = searchResultEntryProtocolOp.toSearchResultEntry();
    }
    catch (ASN1Exception ae)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ae);
      }
      Message message =
          ERR_POSTREADRESP_CANNOT_DECODE_VALUE.get(ae.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                              ae);
    }
    catch (LDAPException le)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, le);
      }
      Message message =
          ERR_POSTREADRESP_CANNOT_DECODE_VALUE.get(le.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                              le);
    }
    return new LDAPPostReadResponseControl(control.getOID(),
                                           control.isCritical(), searchEntry,
                                           controlValue);
  }
  /**
   * Encodes the provided search result entry for use as an attribute value.
   *
   * @param  searchEntry  The search result entry to be encoded.
   *
   * @return  The ASN.1 octet string containing the encoded control value.
   */
  private static ASN1OctetString encodeEntry(SearchResultEntry searchEntry)
  {
    SearchResultEntryProtocolOp protocolOp =
         new SearchResultEntryProtocolOp(searchEntry);
    return new ASN1OctetString(protocolOp.encode().encode());
    protocolOp.write(writer);
    writer.writeEndSequence();
  }
@@ -224,40 +189,12 @@
  /**
   * Specifies the search result entry for use with this post-read response
   * control.
   *
   * @param  searchEntry  The search result entry for use with this post-read
   *                      response control.
   */
  public void setSearchEntry(SearchResultEntry searchEntry)
  {
    this.searchEntry = searchEntry;
    setValue(encodeEntry(searchEntry));
  }
  /**
   * Retrieves a string representation of this LDAP post-read response control.
   *
   * @return  A string representation of this LDAP post-read response control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this LDAP post-read response control to
   * the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("LDAPPostReadResponseControl(criticality=");
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPreReadRequestControl.java
@@ -28,22 +28,16 @@
import org.opends.messages.Message;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.Set;
import java.io.IOException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Control;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -63,6 +57,67 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<LDAPPreReadRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public LDAPPreReadRequestControl decode(boolean isCritical,
                                            ByteString value)
        throws DirectoryException
    {
     if (value == null)
      {
        Message message = ERR_PREREADREQ_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      LinkedHashSet<String> rawAttributes = new LinkedHashSet<String>();
      try
      {
        reader.readStartSequence();
        while(reader.hasNextElement())
        {
          rawAttributes.add(reader.readOctetStringAsString());
        }
        reader.readEndSequence();
      }
      catch (Exception ae)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, ae);
        }
        Message message =
            ERR_PREREADREQ_CANNOT_DECODE_VALUE.get(ae.getMessage());
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message,
            ae);
      }
      return new LDAPPreReadRequestControl(isCritical,
          rawAttributes);
    }
    public String getOID()
    {
      return OID_LDAP_READENTRY_PREREAD;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<LDAPPreReadRequestControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -79,10 +134,10 @@
  private boolean returnAllUserAttrs;
  // The set of raw attributes to return in the entry.
  private LinkedHashSet<String> rawAttributes;
  private Set<String> rawAttributes;
  // The set of processed attributes to return in the entry.
  private LinkedHashSet<AttributeType> requestedAttributes;
  private Set<AttributeType> requestedAttributes;
@@ -97,10 +152,9 @@
   *                        attributes should be returned.
   */
  public LDAPPreReadRequestControl(boolean isCritical,
                                   LinkedHashSet<String> rawAttributes)
                                   Set<String> rawAttributes)
  {
    super(OID_LDAP_READENTRY_PREREAD, isCritical,
          encodeAttributes(rawAttributes));
    super(OID_LDAP_READENTRY_PREREAD, isCritical);
    if (rawAttributes == null)
@@ -120,150 +174,27 @@
  /**
   * Creates a new instance of this LDAP pre-read request control with the
   * provided information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid            The OID to use for this control.
   * @param  isCritical     Indicates whether support for this control should be
   *                        considered a critical part of the server processing.
   * @param  rawAttributes  The set of raw attributes to return in the entry.
   *                        A null or empty set will indicates that all user
   *                        attributes should be returned.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public LDAPPreReadRequestControl(String oid, boolean isCritical,
                                   LinkedHashSet<String> rawAttributes)
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    if (rawAttributes != null)
  {
    super(oid, isCritical, encodeAttributes(rawAttributes));
    if (rawAttributes == null)
    {
      this.rawAttributes = new LinkedHashSet<String>(0);
    }
    else
    {
      this.rawAttributes = rawAttributes;
    }
    requestedAttributes       = null;
    returnAllOperationalAttrs = false;
    returnAllUserAttrs        = false;
  }
  /**
   * Creates a new instance of this LDAP pre-read request control with the
   * provided information.
   *
   * @param  oid            The OID to use for this control.
   * @param  isCritical     Indicates whether support for this control should be
   *                        considered a critical part of the server processing.
   * @param  rawAttributes  The set of raw attributes to return in the entry.
   *                        A null or empty set will indicates that all user
   *                        attributes should be returned.
   * @param  encodedValue   The pre-encoded value for this control.
   */
  private LDAPPreReadRequestControl(String oid, boolean isCritical,
                                    LinkedHashSet<String> rawAttributes,
                                    ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
    if (rawAttributes == null)
    {
      this.rawAttributes = new LinkedHashSet<String>(0);
    }
    else
    {
      this.rawAttributes = rawAttributes;
    }
    requestedAttributes       = null;
    returnAllOperationalAttrs = false;
    returnAllUserAttrs        = false;
  }
  /**
   * Creates a new LDAP pre-read request control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this LDAP pre-read request control.
   *
   * @return  The LDAP pre-read request control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid LDAP
   *                         pre-read request control.
   */
  public static LDAPPreReadRequestControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_PREREADREQ_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    LinkedHashSet<String> rawAttributes = new LinkedHashSet<String>();
    try
    {
      ASN1Sequence attrSequence =
           ASN1Sequence.decodeAsSequence(control.getValue().value());
      for (ASN1Element e : attrSequence.elements())
      {
        rawAttributes.add(e.decodeAsOctetString().stringValue());
      }
    }
    catch (ASN1Exception ae)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ae);
      }
      Message message = ERR_PREREADREQ_CANNOT_DECODE_VALUE.get(ae.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                              ae);
    }
    return new LDAPPreReadRequestControl(control.getOID(), control.isCritical(),
                                         rawAttributes, control.getValue());
  }
  /**
   * Encodes the provided set of raw, unprocessed attribute names to an
   * ASN.1 octet string suitable for use as the value of this control.
   *
   * @param  rawAttributes  The set of attributes to encoded in the encoded
   *                        control value.
   *
   * @return  The ASN.1 octet string containing the encoded attribute set.
   */
  private static ASN1OctetString encodeAttributes(LinkedHashSet<String>
                                                       rawAttributes)
  {
    if (rawAttributes == null)
    {
      return new ASN1OctetString(new ASN1Sequence().encode());
    }
    ArrayList<ASN1Element> elements =
         new ArrayList<ASN1Element>(rawAttributes.size());
    for (String attr : rawAttributes)
    {
      elements.add(new ASN1OctetString(attr));
        writer.writeOctetString(attr);
    }
    }
    writer.writeEndSequence();
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
    writer.writeEndSequence();
  }
@@ -275,7 +206,7 @@
   *
   * @return  The raw, unprocessed set of attributes.
   */
  public LinkedHashSet<String> getRawAttributes()
  public Set<String> getRawAttributes()
  {
    return rawAttributes;
  }
@@ -283,36 +214,13 @@
  /**
   * Specifies the raw, unprocessed set of requested attributes.  A null or
   * empty set indicates that all user attributes should be returned.
   *
   * @param  rawAttributes  The raw, unprocessed set of requested attributes.
   */
  public void setRawAttributes(LinkedHashSet<String> rawAttributes)
  {
    if (rawAttributes == null)
    {
      this.rawAttributes = new LinkedHashSet<String>();
    }
    else
    {
      this.rawAttributes = rawAttributes;
    }
    setValue(encodeAttributes(rawAttributes));
    requestedAttributes = null;
  }
  /**
   * Retrieves the set of processed attributes that have been requested for
   * inclusion in the entry that is returned.
   *
   * @return  The set of processed attributes that have been requested for
   *          inclusion in the entry that is returned.
   */
  public LinkedHashSet<AttributeType> getRequestedAttributes()
  public Set<AttributeType> getRequestedAttributes()
  {
    if (requestedAttributes == null)
    {
@@ -439,25 +347,12 @@
  /**
   * Retrieves a string representation of this LDAP pre-read request control.
   *
   * @return  A string representation of this LDAP pre-read request control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this LDAP pre-read request control to
   * the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("LDAPPreReadRequestControl(criticality=");
opendj-sdk/opends/src/server/org/opends/server/controls/LDAPPreReadResponseControl.java
@@ -28,22 +28,19 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.protocols.ldap.SearchResultEntryProtocolOp;
import org.opends.server.types.Control;
import org.opends.server.types.SearchResultEntry;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.ldap.LDAPReader;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
/**
@@ -55,6 +52,63 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<LDAPPreReadResponseControl>
  {
    /**
     * {@inheritDoc}
     */
    public LDAPPreReadResponseControl decode(boolean isCritical,
                                             ByteString value)
        throws DirectoryException
    {
     if (value == null)
      {
        Message message = ERR_PREREADRESP_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      SearchResultEntry searchEntry;
      try
      {
        SearchResultEntryProtocolOp searchResultEntryProtocolOp =
            LDAPReader.readSearchEntry(reader);
        searchEntry = searchResultEntryProtocolOp.toSearchResultEntry();
      }
      catch (LDAPException le)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, le);
        }
        Message message =
            ERR_PREREADRESP_CANNOT_DECODE_VALUE.get(le.getMessage());
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message,
            le);
      }
      return new LDAPPreReadResponseControl(isCritical, searchEntry);
    }
    public String getOID()
    {
      return OID_LDAP_READENTRY_PREREAD;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<LDAPPreReadResponseControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -76,11 +130,7 @@
   */
  public LDAPPreReadResponseControl(SearchResultEntry searchEntry)
  {
    super(OID_LDAP_READENTRY_PREREAD, false,
          encodeEntry(searchEntry));
    this.searchEntry = searchEntry;
    this(false, searchEntry);
  }
@@ -89,16 +139,15 @@
   * Creates a new instance of this LDAP pre-read response control with the
   * provided information.
   *
   * @param  oid          The OID to use for this control.
   * @param  isCritical   Indicates whether support for this control should be
   *                      considered a critical part of the server processing.
   * @param  searchEntry  The search result entry to include in the response
   *                      control.
   */
  public LDAPPreReadResponseControl(String oid, boolean isCritical,
  public LDAPPreReadResponseControl(boolean isCritical,
                                    SearchResultEntry searchEntry)
  {
    super(oid, isCritical, encodeEntry(searchEntry));
    super(OID_LDAP_READENTRY_PREREAD, isCritical);
    this.searchEntry = searchEntry;
@@ -107,104 +156,21 @@
  /**
   * Creates a new instance of this LDAP pre-read response control with the
   * provided information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether support for this control should be
   *                       considered a critical part of the server processing.
   * @param  searchEntry   The search result entry to include in the response
   *                       control.
   * @param  encodedValue  The pre-encoded value for this control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private LDAPPreReadResponseControl(String oid, boolean isCritical,
                                     SearchResultEntry searchEntry,
                                     ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    this.searchEntry = searchEntry;
  }
  /**
   * Creates a new LDAP pre-read response control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this LDAP pre-read response control.
   *
   * @return  The LDAP pre-read response control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid LDAP
   *                         pre-read response control.
   */
  public static LDAPPreReadResponseControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_PREREADRESP_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    ASN1OctetString controlValue = control.getValue();
    SearchResultEntry searchEntry;
    try
    {
      ASN1Element element = ASN1Element.decode(controlValue.value());
      SearchResultEntryProtocolOp searchResultEntryProtocolOp =
           SearchResultEntryProtocolOp.decodeSearchEntry(element);
      searchEntry = searchResultEntryProtocolOp.toSearchResultEntry();
    }
    catch (ASN1Exception ae)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ae);
      }
      Message message =
          ERR_PREREADRESP_CANNOT_DECODE_VALUE.get(ae.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                              ae);
    }
    catch (LDAPException le)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, le);
      }
      Message message =
          ERR_PREREADRESP_CANNOT_DECODE_VALUE.get(le.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                              le);
    }
    return new LDAPPreReadResponseControl(control.getOID(),
                                          control.isCritical(), searchEntry,
                                          controlValue);
  }
  /**
   * Encodes the provided search result entry for use as an attribute value.
   *
   * @param  searchEntry  The search result entry to be encoded.
   *
   * @return  The ASN.1 octet string containing the encoded control value.
   */
  private static ASN1OctetString encodeEntry(SearchResultEntry searchEntry)
  {
    SearchResultEntryProtocolOp protocolOp =
         new SearchResultEntryProtocolOp(searchEntry);
    return new ASN1OctetString(protocolOp.encode().encode());
    protocolOp.write(writer);
    writer.writeEndSequence();
  }
@@ -224,40 +190,12 @@
  /**
   * Specifies the search result entry for use with this pre-read response
   * control.
   *
   * @param  searchEntry  The search result entry for use with this pre-read
   *                      response control.
   */
  public void setSearchEntry(SearchResultEntry searchEntry)
  {
    this.searchEntry = searchEntry;
    setValue(encodeEntry(searchEntry));
  }
  /**
   * Retrieves a string representation of this LDAP pre-read response control.
   *
   * @return  A string representation of this LDAP pre-read response control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this LDAP pre-read response control to
   * the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("LDAPPreReadResponseControl(criticality=");
opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesControl.java
@@ -30,16 +30,12 @@
import java.util.ArrayList;
import java.io.IOException;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.Control;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -59,6 +55,75 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<MatchedValuesControl>
  {
    /**
     * {@inheritDoc}
     */
    public MatchedValuesControl decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      ArrayList<MatchedValuesFilter> filters;
      if (value == null)
      {
        Message message = ERR_MATCHEDVALUES_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        reader.readStartSequence();
        if (!reader.hasNextElement())
        {
          Message message = ERR_MATCHEDVALUES_NO_FILTERS.get();
          throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
        }
        filters = new ArrayList<MatchedValuesFilter>();
        while(reader.hasNextElement())
        {
          filters.add(MatchedValuesFilter.decode(reader));
        }
        reader.readEndSequence();
      }
      catch (DirectoryException e)
      {
        throw e;
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message = ERR_MATCHEDVALUES_CANNOT_DECODE_VALUE_AS_SEQUENCE.get(
            getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      return new MatchedValuesControl(isCritical,filters);
    }
    public String getOID()
    {
      return OID_MATCHED_VALUES;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<MatchedValuesControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -67,7 +132,7 @@
  // The set of matched values filters for this control.
  ArrayList<MatchedValuesFilter> filters;
  private final ArrayList<MatchedValuesFilter> filters;
@@ -83,7 +148,7 @@
  public MatchedValuesControl(boolean isCritical,
                              ArrayList<MatchedValuesFilter> filters)
  {
    super(OID_MATCHED_VALUES, isCritical, encodeValue(filters));
    super(OID_MATCHED_VALUES, isCritical);
    this.filters = filters;
@@ -92,136 +157,27 @@
  /**
   * Creates a new matched values control using the default OID and the provided
   * criticality and set of filters.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid         The OID for this matched values control.
   * @param  isCritical  Indicates whether this control should be considered
   *                     critical to the operation processing.
   * @param  filters     The set of filters to use to determine which values to
   *                     return.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public MatchedValuesControl(String oid, boolean isCritical,
                              ArrayList<MatchedValuesFilter> filters)
  {
    super(oid, isCritical, encodeValue(filters));
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    this.filters = filters;
  }
  /**
   * Creates a new matched values control using the default OID and the provided
   * criticality and set of filters.
   *
   * @param  oid           The OID for this matched values control.
   * @param  isCritical    Indicates whether this control should be considered
   *                       critical to the operation processing.
   * @param  filters       The set of filters to use to determine which values
   *                       to return.
   * @param  encodedValue  The pre-encoded value for this matched values
   *                       control.
   */
  private MatchedValuesControl(String oid, boolean isCritical,
                               ArrayList<MatchedValuesFilter> filters,
                               ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
    this.filters = filters;
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the control value.
   *
   * @param  filters  The set of filters to include in the control value.
   *
   * @return  An ASN.1 octet string containing the encoded information.
   */
  private static ASN1OctetString
                      encodeValue(ArrayList<MatchedValuesFilter> filters)
  {
    ArrayList<ASN1Element> elements =
         new ArrayList<ASN1Element>(filters.size());
    writer.writeStartSequence();
    for (MatchedValuesFilter f : filters)
    {
      elements.add(f.encode());
      f.encode(writer);
    }
    writer.writeEndSequence();
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
    writer.writeEndSequence();
  }
  /**
   * Creates a new matched values control from the contents of the provided
   * control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this matched values control.
   *
   * @return  The matched values control decoded from the provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         matched values control.
   */
  public static MatchedValuesControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_MATCHEDVALUES_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    ArrayList<ASN1Element> elements;
    try
    {
      elements =
           ASN1Sequence.decodeAsSequence(control.getValue().value()).elements();
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message = ERR_MATCHEDVALUES_CANNOT_DECODE_VALUE_AS_SEQUENCE.get(
          getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    if (elements.isEmpty())
    {
      Message message = ERR_MATCHEDVALUES_NO_FILTERS.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    ArrayList<MatchedValuesFilter> filters =
         new ArrayList<MatchedValuesFilter>(elements.size());
    for (ASN1Element e : elements)
    {
      filters.add(MatchedValuesFilter.decode(e));
    }
    return new MatchedValuesControl(control.getOID(), control.isCritical(),
                                    filters, control.getValue());
  }
  /**
   * Retrieves the set of filters associated with this matched values control.
   *
@@ -271,27 +227,12 @@
  /**
   * Retrieves a string representation of this authorization identity response
   * control.
   *
   * @return  A string representation of this authorization identity response
   *          control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this authorization identity response
   * control to the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    if (filters.size() == 1)
opendj-sdk/opends/src/server/org/opends/server/controls/MatchedValuesFilter.java
@@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.List;
import java.io.IOException;
import org.opends.server.api.ApproximateMatchingRule;
import org.opends.server.api.EqualityMatchingRule;
@@ -38,21 +39,13 @@
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.api.SubstringMatchingRule;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.asn1.*;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.LDAPException;
import org.opends.server.types.RawFilter;
import org.opends.server.util.Validator;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.protocols.ldap.LDAPConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -130,19 +123,19 @@
  private ApproximateMatchingRule approximateMatchingRule;
  // The normalized subFinal value for this matched values filter.
  private ASN1OctetString normalizedSubFinal;
  private ByteString normalizedSubFinal;
  // The normalized subInitial value for this matched values filter.
  private ASN1OctetString normalizedSubInitial;
  private ByteString normalizedSubInitial;
  // The raw, unprocessed assertion value for this matched values filter.
  private ByteString rawAssertionValue;
  private final ByteString rawAssertionValue;
  // The subFinal value for this matched values filter.
  private ByteString subFinal;
  private final ByteString subFinal;
  // The subInitial value for this matched values filter.
  private ByteString subInitial;
  private final ByteString subInitial;
  // The processed attribute type for this matched values filter.
  private AttributeType attributeType;
@@ -155,16 +148,16 @@
  private boolean decoded;
  // The match type for this matched values filter.
  private byte matchType;
  private final byte matchType;
  // The equality matching rule for this matched values filter.
  private EqualityMatchingRule equalityMatchingRule;
  // The set of normalized subAny values for this matched values filter.
  private List<ASN1OctetString> normalizedSubAny;
  private List<ByteString> normalizedSubAny;
  // The set of subAny values for this matched values filter.
  private List<ByteString> subAny;
  private final List<ByteString> subAny;
  // The matching rule for this matched values filter.
  private MatchingRule matchingRule;
@@ -173,10 +166,10 @@
  private OrderingMatchingRule orderingMatchingRule;
  // The matching rule ID for this matched values filter.
  private String matchingRuleID;
  private final String matchingRuleID;
  // The raw, unprocessed attribute type for this matched values filter.
  private String rawAttributeType;
  private final String rawAttributeType;
  // The substring matching rule for this matched values filter.
  private SubstringMatchingRule substringMatchingRule;
@@ -256,8 +249,7 @@
  {
    Validator.ensureNotNull(attributeType, assertionValue);
    String rawAttributeType = attributeType.getNameOrOID();
    ASN1OctetString rawAssertionValue = assertionValue.getValue()
        .toASN1OctetString();
    ByteString rawAssertionValue = assertionValue.getValue();
    MatchedValuesFilter filter =
         new MatchedValuesFilter(EQUALITY_MATCH_TYPE, rawAttributeType,
@@ -357,8 +349,7 @@
    Validator.ensureNotNull(attributeType, assertionValue);
    String          rawAttributeType  = attributeType.getNameOrOID();
    ASN1OctetString rawAssertionValue =
         assertionValue.getValue().toASN1OctetString();
    ByteString rawAssertionValue = assertionValue.getValue();
    MatchedValuesFilter filter =
         new MatchedValuesFilter(GREATER_OR_EQUAL_TYPE, rawAttributeType,
@@ -405,8 +396,7 @@
    Validator.ensureNotNull(attributeType, assertionValue);
    String          rawAttributeType = attributeType.getNameOrOID();
    ASN1OctetString rawAssertionValue =
         assertionValue.getValue().toASN1OctetString();
    ByteString rawAssertionValue = assertionValue.getValue();
    MatchedValuesFilter filter =
         new MatchedValuesFilter(LESS_OR_EQUAL_TYPE, rawAttributeType,
@@ -492,8 +482,7 @@
  {
    Validator.ensureNotNull(attributeType,assertionValue);
    String          rawAttributeType  = attributeType.getNameOrOID();
    ASN1OctetString rawAssertionValue =
         assertionValue.getValue().toASN1OctetString();
    ByteString rawAssertionValue = assertionValue.getValue();
    MatchedValuesFilter filter =
         new MatchedValuesFilter(APPROXIMATE_MATCH_TYPE, rawAttributeType,
@@ -546,8 +535,7 @@
    Validator.ensureNotNull(attributeType, matchingRule, assertionValue);
    String rawAttributeType = attributeType.getNameOrOID();
    String matchingRuleID = matchingRule.getOID();
    ASN1OctetString rawAssertionValue =
         assertionValue.getValue().toASN1OctetString();
    ByteString rawAssertionValue = assertionValue.getValue();
    MatchedValuesFilter filter =
         new MatchedValuesFilter(EXTENSIBLE_MATCH_TYPE, rawAttributeType,
@@ -651,14 +639,13 @@
    }
  }
  /**
   * Encodes this matched values filter as an ASN.1 element.
   *
   * @return  The ASN.1 element containing the encoded matched values filter.
   * @param writer The ASN1Writer to use to encode this matched values filter.
   * @throws IOException if an error occurs while encoding.
   */
  public ASN1Element encode()
  public void encode(ASN1Writer writer) throws IOException
  {
    switch (matchType)
    {
@@ -667,89 +654,90 @@
      case LESS_OR_EQUAL_TYPE:
      case APPROXIMATE_MATCH_TYPE:
        // These will all be encoded in the same way.
        ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2);
        elements.add(new ASN1OctetString(rawAttributeType));
        elements.add(rawAssertionValue.toASN1OctetString());
        return new ASN1Sequence(matchType, elements);
        writer.writeStartSequence(matchType);
        writer.writeOctetString(rawAttributeType);
        writer.writeOctetString(rawAssertionValue);
        writer.writeEndSequence();
        return;
      case SUBSTRINGS_TYPE:
        ArrayList<ASN1Element> subElements = new ArrayList<ASN1Element>();
        writer.writeStartSequence(matchType);
        writer.writeOctetString(rawAttributeType);
        writer.writeStartSequence();
        if (subInitial != null)
        {
          ASN1OctetString subInitialOS = subInitial.toASN1OctetString();
          subInitialOS.setType(TYPE_SUBINITIAL);
          subElements.add(subInitialOS);
          writer.writeOctetString(TYPE_SUBINITIAL, subInitial);
        }
        if (subAny != null)
        {
          for (ByteString s : subAny)
          {
            ASN1OctetString os = s.toASN1OctetString();
            os.setType(TYPE_SUBANY);
            subElements.add(os);
            writer.writeOctetString(TYPE_SUBANY, s);
          }
        }
        if (subFinal != null)
        {
          ASN1OctetString subFinalOS = subFinal.toASN1OctetString();
          subFinalOS.setType(TYPE_SUBFINAL);
          subElements.add(subFinalOS);
          writer.writeOctetString(TYPE_SUBFINAL, subFinal);
        }
        writer.writeEndSequence();
        elements = new ArrayList<ASN1Element>(2);
        elements.add(new ASN1OctetString(rawAttributeType));
        elements.add(new ASN1Sequence(subElements));
        return new ASN1Sequence(matchType, elements);
        writer.writeEndSequence();
        return;
      case PRESENT_TYPE:
        return new ASN1OctetString(matchType, rawAttributeType);
        writer.writeOctetString(matchType, rawAttributeType);
        return;
      case EXTENSIBLE_MATCH_TYPE:
        elements = new ArrayList<ASN1Element>(3);
        writer.writeStartSequence(matchType);
        if (matchingRuleID != null)
        {
          elements.add(new ASN1OctetString(TYPE_MATCHING_RULE_ID,
                                           matchingRuleID));
          writer.writeOctetString(TYPE_MATCHING_RULE_ID, matchingRuleID);
        }
        if (rawAttributeType != null)
        {
          elements.add(new ASN1OctetString(TYPE_MATCHING_RULE_TYPE,
                                           rawAttributeType));
          writer.writeOctetString(TYPE_MATCHING_RULE_TYPE, rawAttributeType);
        }
        ASN1OctetString valueOS = rawAssertionValue.toASN1OctetString();
        valueOS.setType(TYPE_MATCHING_RULE_VALUE);
        elements.add(valueOS);
        return new ASN1Sequence(matchType, elements);
        writer.writeOctetString(TYPE_MATCHING_RULE_VALUE, rawAssertionValue);
        writer.writeEndSequence();
        return;
      default:
        return null;
    }
  }
  /**
   * Decodes the provided ASN.1 element as a matched values filter item.
   *
   * @param  element  The ASN.1 element to be decoded.
   * @param  reader The ASN.1 reader.
   *
   * @return  The decoded matched values filter.
   *
   * @throws  LDAPException  If a problem occurs while attempting to decode the
   *                         filter item.
   */
  public static MatchedValuesFilter decode(ASN1Element element)
  public static MatchedValuesFilter decode(ASN1Reader reader)
         throws LDAPException
  {
    switch (element.getType())
    byte type;
    try
    {
      type = reader.peekType();
    }
    catch(Exception e)
    {
      // TODO: Need a better message.
      Message message =
          ERR_MVFILTER_INVALID_ELEMENT_TYPE.get(e.toString());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    switch (type)
    {
      case EQUALITY_MATCH_TYPE:
      case GREATER_OR_EQUAL_TYPE:
@@ -759,25 +747,12 @@
        // sequence consisting of the attribute type and assertion value.
        try
        {
          ArrayList<ASN1Element> elements =
               element.decodeAsSequence().elements();
          if (elements.size() != 2)
          {
            Message message =
                ERR_MVFILTER_INVALID_AVA_SEQUENCE_SIZE.get(elements.size());
            throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
          }
          String rawAttributeType =
                      elements.get(0).decodeAsOctetString().stringValue();
          return new MatchedValuesFilter(element.getType(), rawAttributeType,
                                         elements.get(1).decodeAsOctetString(),
                                         null, null, null, null);
        }
        catch (LDAPException le)
        {
          throw le;
          reader.readStartSequence();
          String rawAttributeType = reader.readOctetStringAsString();
          ByteString rawAssertionValue = reader.readOctetString();
          reader.readEndSequence();
          return new MatchedValuesFilter(type, rawAttributeType,
              rawAssertionValue, null, null, null, null);
        }
        catch (Exception e)
        {
@@ -798,37 +773,27 @@
        // sequence of substring types.
        try
        {
          ArrayList<ASN1Element> elements =
               element.decodeAsSequence().elements();
          if (elements.size() != 2)
          {
            Message message = ERR_MVFILTER_INVALID_SUBSTRING_SEQUENCE_SIZE.get(
                elements.size());
            throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
          }
          reader.readStartSequence();
          String rawAttributeType = reader.readOctetStringAsString();
          ArrayList<ASN1Element> subElements =
               elements.get(1).decodeAsSequence().elements();
          if (subElements.isEmpty())
          reader.readStartSequence();
          if(!reader.hasNextElement())
          {
            Message message = ERR_MVFILTER_NO_SUBSTRING_ELEMENTS.get();
            throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
          }
          String rawAttributeType =
                      elements.get(0).decodeAsOctetString().stringValue();
          ByteString subInitial        = null;
          ArrayList<ByteString> subAny = null;
          ByteString subFinal          = null;
          for (ASN1Element e : subElements)
          while(reader.hasNextElement())
          {
            switch (e.getType())
            switch(reader.peekType())
            {
              case TYPE_SUBINITIAL:
                if (subInitial == null)
                {
                  subInitial = e.decodeAsOctetString();
                  subInitial = reader.readOctetString();
                }
                else
                {
@@ -844,13 +809,13 @@
                  subAny = new ArrayList<ByteString>();
                }
                subAny.add(e.decodeAsOctetString());
                subAny.add(reader.readOctetString());
                break;
              case TYPE_SUBFINAL:
                if (subFinal == null)
                {
                  subFinal = e.decodeAsOctetString();
                  subFinal = reader.readOctetString();
                }
                else
                {
@@ -862,12 +827,15 @@
              default:
                Message message = ERR_MVFILTER_INVALID_SUBSTRING_ELEMENT_TYPE.
                    get(byteToHex(e.getType()));
                    get(byteToHex(reader.peekType()));
                throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
            }
          }
          reader.readEndSequence();
          return new MatchedValuesFilter(element.getType(), rawAttributeType,
          reader.readEndSequence();
          return new MatchedValuesFilter(type, rawAttributeType,
                                         null, subInitial, subAny, subFinal,
                                         null);
        }
@@ -893,9 +861,9 @@
        // The element must be an ASN.1 octet string holding the attribute type.
        try
        {
          String rawAttributeType = element.decodeAsOctetString().stringValue();
          String rawAttributeType = reader.readOctetStringAsString();
          return new MatchedValuesFilter(element.getType(), rawAttributeType,
          return new MatchedValuesFilter(type, rawAttributeType,
                                         null, null, null, null, null);
        }
        catch (Exception e)
@@ -918,27 +886,19 @@
        // the first element(s).
        try
        {
          ArrayList<ASN1Element> elements =
               element.decodeAsSequence().elements();
          if ((elements.size() < 2) || (elements.size() > 3))
          {
            Message message = ERR_MVFILTER_INVALID_EXTENSIBLE_SEQUENCE_SIZE.get(
                elements.size());
            throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
          }
          reader.readStartSequence();
          String          rawAttributeType  = null;
          String          matchingRuleID    = null;
          ASN1OctetString rawAssertionValue = null;
          for (ASN1Element e : elements)
          ByteString rawAssertionValue = null;
          while(reader.hasNextElement())
          {
            switch (e.getType())
            switch (reader.peekType())
            {
              case TYPE_MATCHING_RULE_ID:
                if (matchingRuleID == null)
                {
                  matchingRuleID = e.decodeAsOctetString().stringValue();
                  matchingRuleID = reader.readOctetStringAsString();
                }
                else
                {
@@ -952,7 +912,7 @@
              case TYPE_MATCHING_RULE_TYPE:
                if (rawAttributeType == null)
                {
                  rawAttributeType = e.decodeAsOctetString().stringValue();
                  rawAttributeType = reader.readOctetStringAsString();
                }
                else
                {
@@ -965,7 +925,7 @@
              case TYPE_MATCHING_RULE_VALUE:
                if (rawAssertionValue == null)
                {
                  rawAssertionValue = e.decodeAsOctetString();
                  rawAssertionValue = reader.readOctetString();
                }
                else
                {
@@ -978,13 +938,13 @@
              default:
                Message message = ERR_MVFILTER_INVALID_EXTENSIBLE_ELEMENT_TYPE.
                    get(byteToHex(e.getType()));
                    get(byteToHex(reader.peekType()));
                throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
            }
          }
          reader.readEndSequence();
          return new MatchedValuesFilter(element.getType(), rawAttributeType,
          return new MatchedValuesFilter(type, rawAttributeType,
                                         rawAssertionValue, null, null, null,
                                         matchingRuleID);
        }
@@ -1008,7 +968,7 @@
      default:
        Message message =
            ERR_MVFILTER_INVALID_ELEMENT_TYPE.get(byteToHex(element.getType()));
            ERR_MVFILTER_INVALID_ELEMENT_TYPE.get(byteToHex(type));
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
  }
@@ -1040,28 +1000,6 @@
  }
  /**
   * Specifies the raw, unprocessed attribute type for this matched values
   * filter.
   *
   * @param  rawAttributeType  The raw, unprocessed attribute type for this
   *                           matched values filter.
   */
  public void setRawAttributeType(String rawAttributeType)
  {
    this.rawAttributeType = rawAttributeType;
    decoded                 = false;
    attributeType           = null;
    approximateMatchingRule = null;
    equalityMatchingRule    = null;
    orderingMatchingRule    = null;
    substringMatchingRule   = null;
  }
  /**
   * Retrieves the attribute type for this matched values filter.
   *
@@ -1088,34 +1026,6 @@
  }
  /**
   * Specifies the attribute type for this matched values filter.
   *
   * @param  attributeType  The attribute type for this matched values filter.
   */
  public void setAttributeType(AttributeType attributeType)
  {
    this.attributeType = attributeType;
    if (attributeType == null)
    {
      rawAttributeType = null;
    }
    else
    {
      rawAttributeType = attributeType.getNameOrOID();
    }
    decoded                 = false;
    approximateMatchingRule = null;
    equalityMatchingRule    = null;
    orderingMatchingRule    = null;
    substringMatchingRule   = null;
  }
  /**
   * Retrieves the raw, unprocessed assertion value for this matched values
   * filter.
@@ -1131,23 +1041,6 @@
  /**
   * Specifies the raw, unprocessed assertion value for this matched values
   * filter.
   *
   * @param  rawAssertionValue  The raw, unprocessed assertion value for this
   *                            matched values filter.
   */
  public void setRawAssertionValue(ByteString rawAssertionValue)
  {
    this.rawAssertionValue = rawAssertionValue;
    decoded        = false;
    assertionValue = null;
  }
  /**
   * Retrieves the assertion value for this matched values filter.
   *
   * @return  The assertion value for this matched values filter, or
@@ -1159,8 +1052,8 @@
    {
      if (rawAssertionValue != null)
      {
        assertionValue = new AttributeValue(getAttributeType(),
                                            rawAssertionValue);
        assertionValue = AttributeValues.create(
            getAttributeType(), rawAssertionValue);
      }
    }
@@ -1170,29 +1063,6 @@
  /**
   * Specifies the assertion value for this matched values filter.
   *
   * @param  assertionValue  The assertion value for this matched values filter.
   */
  public void setAssertionValue(AttributeValue assertionValue)
  {
    this.assertionValue = assertionValue;
    if (assertionValue == null)
    {
      rawAssertionValue = null;
    }
    else
    {
      rawAssertionValue = assertionValue.getValue().toASN1OctetString();
    }
    decoded = false;
  }
  /**
   * Retrieves the subInitial element for this matched values filter.
   *
   * @return  The subInitial element for this matched values filter, or
@@ -1205,18 +1075,7 @@
  /**
   * Specifies the subInitial element for this matched values filter.
   *
   * @param  subInitial  The subInitial element for this matched values filter.
   */
  public void setSubInitialElement(ByteString subInitial)
  {
    this.subInitial = subInitial;
    decoded              = false;
    normalizedSubInitial = null;
  }
@@ -1226,7 +1085,7 @@
   * @return  The normalized form of the subInitial element, or
   *          <CODE>null</CODE> if there is none.
   */
  public ASN1OctetString getNormalizedSubInitialElement()
  public ByteString getNormalizedSubInitialElement()
  {
    if (normalizedSubInitial == null)
    {
@@ -1235,8 +1094,7 @@
        try
        {
          normalizedSubInitial =
               getSubstringMatchingRule().normalizeSubstring(subInitial).
                    toASN1OctetString();
               getSubstringMatchingRule().normalizeSubstring(subInitial);
        }
        catch (Exception e)
        {
@@ -1268,21 +1126,6 @@
  /**
   * Specifies the set of subAny elements for this matched values filter.
   *
   * @param  subAny  The set of subAny elements for this matched values filter.
   */
  public void setSubAnyElements(List<ByteString> subAny)
  {
    this.subAny = subAny;
    decoded          = false;
    normalizedSubAny = null;
  }
  /**
   * Retrieves the set of normalized subAny elements for this matched values
   * filter.
   *
@@ -1291,13 +1134,13 @@
   *          problem occurs while attempting to perform the normalization, then
   *          <CODE>null</CODE> will be returned.
   */
  public List<ASN1OctetString> getNormalizedSubAnyElements()
  public List<ByteString> getNormalizedSubAnyElements()
  {
    if (normalizedSubAny == null)
    {
      if ((subAny == null) || (subAny.isEmpty()))
      {
        normalizedSubAny = new ArrayList<ASN1OctetString>(0);
        normalizedSubAny = new ArrayList<ByteString>(0);
      }
      else
      {
@@ -1306,14 +1149,13 @@
          return null;
        }
        normalizedSubAny = new ArrayList<ASN1OctetString>();
        normalizedSubAny = new ArrayList<ByteString>();
        try
        {
          for (ByteString s : subAny)
          {
            normalizedSubAny.add(
                 substringMatchingRule.normalizeSubstring(s).
                      toASN1OctetString());
                 substringMatchingRule.normalizeSubstring(s));
          }
        }
        catch (Exception e)
@@ -1347,27 +1189,12 @@
  /**
   * Specifies the subFinal element for this matched values filter.
   *
   * @param  subFinal  The subFinal element for this matched values filter.
   */
  public void setSubFinalElement(ByteString subFinal)
  {
    this.subFinal = subFinal;
    decoded            = false;
    normalizedSubFinal = null;
  }
  /**
   * Retrieves the normalized form of the subFinal element.
   *
   * @return  The normalized form of the subFinal element, or <CODE>null</CODE>
   *          if there is none.
   */
  public ASN1OctetString getNormalizedSubFinalElement()
  public ByteString getNormalizedSubFinalElement()
  {
    if (normalizedSubFinal == null)
    {
@@ -1376,8 +1203,7 @@
        try
        {
          normalizedSubFinal =
               getSubstringMatchingRule().normalizeSubstring(subFinal).
                    toASN1OctetString();
               getSubstringMatchingRule().normalizeSubstring(subFinal);
        }
        catch (Exception e)
        {
@@ -1408,22 +1234,6 @@
  /**
   * Specifies the matching rule ID for this matched values filter.
   *
   * @param  matchingRuleID  The matching rule ID for this matched values
   *                         filter.
   */
  public void setMatchingRuleID(String matchingRuleID)
  {
    this.matchingRuleID = matchingRuleID;
    decoded      = false;
    matchingRule = null;
  }
  /**
   * Retrieves the matching rule for this matched values filter.
   *
   * @return  The matching rule for this matched values filter, or
@@ -1446,29 +1256,6 @@
  /**
   * Specifies the matching rule for this matched values filter.
   *
   * @param  matchingRule  The matching rule for this matched values filter.
   */
  public void setMatchingRule(MatchingRule matchingRule)
  {
    this.matchingRule = matchingRule;
    if (matchingRule == null)
    {
      matchingRuleID = null;
    }
    else
    {
      matchingRuleID = matchingRule.getNameOrOID();
    }
    decoded = false;
  }
  /**
   * Retrieves the approximate matching rule that should be used for this
   * matched values filter.
   *
@@ -1635,8 +1422,8 @@
        {
          try
          {
            ArrayList<ByteString> normalizedSubAnyBS =
                 new ArrayList<ByteString>(normalizedSubAny);
            ArrayList<ByteSequence> normalizedSubAnyBS =
                 new ArrayList<ByteSequence>(normalizedSubAny);
            return substringMatchingRule.valueMatchesSubstring(
                 value.getNormalizedValue(), normalizedSubInitial,
@@ -1762,12 +1549,10 @@
          try
          {
            ASN1OctetString nv1 =
                 matchingRule.normalizeValue(value.getValue()).
                      toASN1OctetString();
            ASN1OctetString nv2 =
                 matchingRule.normalizeValue(assertionValue.getValue()).
                      toASN1OctetString();
            ByteString nv1 =
                 matchingRule.normalizeValue(value.getValue());
            ByteString nv2 =
                 matchingRule.normalizeValue(assertionValue.getValue());
            return (matchingRule.valuesMatch(nv1, nv2) == ConditionResult.TRUE);
          }
@@ -1819,6 +1604,7 @@
   *
   * @return  A string representation of this matched values filter.
   */
  @Override
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
opendj-sdk/opends/src/server/org/opends/server/controls/PagedResultsControl.java
@@ -29,19 +29,15 @@
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.protocols.ldap.LDAPResultCode.PROTOCOL_ERROR;
import static org.opends.server.util.ServerConstants.OID_PAGED_RESULTS_CONTROL;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.*;
import java.util.ArrayList;
import java.io.IOException;
/**
 * This class represents a paged results control value as defined in
@@ -61,6 +57,107 @@
public class PagedResultsControl extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<PagedResultsControl>
  {
    /**
     * {@inheritDoc}
     */
    public PagedResultsControl decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_LDAP_PAGED_RESULTS_DECODE_NULL.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        reader.readStartSequence();
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE.get(String.valueOf(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
      int size;
      try
      {
        size = (int)reader.readInteger();
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_LDAP_PAGED_RESULTS_DECODE_SIZE.get(String.valueOf(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
      ByteString cookie;
      try
      {
        cookie = reader.readOctetString();
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_LDAP_PAGED_RESULTS_DECODE_COOKIE.get(String.valueOf(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
      try
      {
        reader.readEndSequence();
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE.get(String.valueOf(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
      return new PagedResultsControl(isCritical, size, cookie);
    }
    public String getOID()
    {
      return OID_PAGED_RESULTS_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final  ControlDecoder<PagedResultsControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -77,7 +174,7 @@
  /**
   * The control value cookie element.
   */
  private ASN1OctetString cookie;
  private ByteString cookie;
  /**
@@ -89,112 +186,36 @@
   * @param  cookie      The cookie element.
   */
  public PagedResultsControl(boolean isCritical, int size,
                             ASN1OctetString cookie)
                             ByteString cookie)
  {
    super(OID_PAGED_RESULTS_CONTROL, isCritical);
    this.size   = size;
    if(cookie == null)
        this.cookie=ByteString.empty();
    else
    this.cookie = cookie;
    this.setValue(encode());
  }
  /**
   * Creates a new paged results control by decoding the given information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  isCritical  Indicates whether the control is considered
   *                     critical in processing the request.
   * @param  value       The value of the control.
   *
   * @throws  LDAPException  If a problem occurs while attempting to decode the
   *                         provided information as a paged results control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public PagedResultsControl(boolean isCritical, ASN1OctetString value)
       throws LDAPException
  {
    super(OID_PAGED_RESULTS_CONTROL, isCritical, value);
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    if (value == null)
    {
      Message message = ERR_LDAP_PAGED_RESULTS_DECODE_NULL.get();
      throw new LDAPException(PROTOCOL_ERROR, message);
    }
    writer.writeStartSequence();
    writer.writeInteger(size);
    writer.writeOctetString(cookie);
    writer.writeEndSequence();
    ArrayList<ASN1Element> elements;
    try
    {
      ASN1Element sequence = ASN1Element.decode(value.value());
      elements = sequence.decodeAsSequence().elements();
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_LDAP_PAGED_RESULTS_DECODE_SEQUENCE.get(String.valueOf(e));
      throw new LDAPException(PROTOCOL_ERROR, message, e);
    }
    int numElements = elements.size();
    if (numElements != 2)
    {
      Message message =
          ERR_LDAP_PAGED_RESULTS_DECODE_INVALID_ELEMENT_COUNT.get(numElements);
      throw new LDAPException(PROTOCOL_ERROR, message);
    }
    try
    {
      size = elements.get(0).decodeAsInteger().intValue();
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_LDAP_PAGED_RESULTS_DECODE_SIZE.get(String.valueOf(e));
      throw new LDAPException(PROTOCOL_ERROR, message, e);
    }
    try
    {
      cookie = elements.get(1).decodeAsOctetString();
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_LDAP_PAGED_RESULTS_DECODE_COOKIE.get(String.valueOf(e));
      throw new LDAPException(PROTOCOL_ERROR, message, e);
    }
  }
  /**
   * Encodes this control value to an ASN.1 element.
   *
   * @return  The ASN.1 element containing the encoded control value.
   */
  public ASN1OctetString encode()
  {
    ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2);
    elements.add(new ASN1Integer(size));
    elements.add(cookie);
    ASN1Sequence sequence = new ASN1Sequence(elements);
    return new ASN1OctetString(sequence.encode());
    writer.writeEndSequence();
  }
@@ -214,7 +235,7 @@
   * Get the control value cookie element.
   * @return The control value cookie element.
   */
  public ASN1OctetString getCookie()
  public ByteString getCookie()
  {
    return cookie;
  }
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordExpiredControl.java
@@ -29,14 +29,16 @@
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.types.ByteString;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ResultCode;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
/**
@@ -48,75 +50,77 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<PasswordExpiredControl>
  {
    /**
     * {@inheritDoc}
     */
    public PasswordExpiredControl decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      if (value != null)
      {
        try
        {
          Integer.parseInt(value.toString());
        }
        catch (Exception e)
        {
          Message message = ERR_PWEXPIRED_CONTROL_INVALID_VALUE.get();
          throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
        }
      }
      return new PasswordExpiredControl(isCritical);
    }
    public String getOID()
    {
      return OID_NS_PASSWORD_EXPIRED;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<PasswordExpiredControl> DECODER =
    new Decoder();
  /**
   * Creates a new instance of the password expired control with the default
   * settings.
   */
  public PasswordExpiredControl()
  {
    super(OID_NS_PASSWORD_EXPIRED, false, new ASN1OctetString("0"));
    this(false);
  }
  /**
   * Creates a new instance of the password expired control with the provided
   * information.
   *
   * @param  oid         The OID to use for this control.
   * @param  isCritical  Indicates whether support for this control should be
   *                     considered a critical part of the client processing.
   */
  public PasswordExpiredControl(String oid, boolean isCritical)
  public PasswordExpiredControl(boolean isCritical)
  {
    super(oid, isCritical, new ASN1OctetString("0"));
    super(OID_NS_PASSWORD_EXPIRED, isCritical);
  }
  /**
   * Creates a new password expired control from the contents of the provided
   * control.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this password expired control.
   *
   * @return  The password expired control decoded from the provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         password expired control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public static PasswordExpiredControl decodeControl(Control control)
         throws LDAPException
  {
    if (control.hasValue())
    {
      String valueStr = control.getValue().stringValue();
      try
      {
        Integer.parseInt(valueStr);
      }
      catch (Exception e)
      {
        Message message = ERR_PWEXPIRED_CONTROL_INVALID_VALUE.get();
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
    }
    return new PasswordExpiredControl(control.getOID(), control.isCritical());
  }
  /**
   * Retrieves a string representation of this password expired control.
   *
   * @return  A string representation of this password expired control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeOctetString("0");
  }
@@ -127,6 +131,7 @@
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("PasswordExpiredControl()");
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordExpiringControl.java
@@ -29,11 +29,8 @@
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.types.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
@@ -41,6 +38,7 @@
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import java.io.IOException;
/**
@@ -53,6 +51,60 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<PasswordExpiringControl>
  {
    /**
     * {@inheritDoc}
     */
    public PasswordExpiringControl decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_PWEXPIRING_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      int secondsUntilExpiration;
      try
      {
        secondsUntilExpiration =
            Integer.parseInt(value.toString());
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message = ERR_PWEXPIRING_CANNOT_DECODE_SECONDS_UNTIL_EXPIRATION.
            get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      return new PasswordExpiringControl(isCritical,
          secondsUntilExpiration);
    }
    public String getOID()
    {
      return OID_NS_PASSWORD_EXPIRING;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<PasswordExpiringControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -74,11 +126,7 @@
   */
  public PasswordExpiringControl(int secondsUntilExpiration)
  {
    super(OID_NS_PASSWORD_EXPIRING, false,
          new ASN1OctetString(String.valueOf(secondsUntilExpiration)));
    this.secondsUntilExpiration = secondsUntilExpiration;
    this(false, secondsUntilExpiration);
  }
@@ -87,93 +135,31 @@
   * Creates a new instance of the password expiring control with the provided
   * information.
   *
   * @param  oid                     The OID to use for this control.
   * @param  isCritical              Indicates whether support for this control
   *                                 should be considered a critical part of the
   *                                 client processing.
   * @param  secondsUntilExpiration  The length of time in seconds until the
   *                                 password actually expires.
   */
  public PasswordExpiringControl(String oid, boolean isCritical,
                                 int secondsUntilExpiration)
  public PasswordExpiringControl(boolean isCritical, int secondsUntilExpiration)
  {
    super(oid, isCritical,
          new ASN1OctetString(String.valueOf(secondsUntilExpiration)));
    super(OID_NS_PASSWORD_EXPIRING, isCritical);
    this.secondsUntilExpiration = secondsUntilExpiration;
  }
  /**
   * Creates a new instance of the password expiring control with the provided
   * information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid                     The OID to use for this control.
   * @param  isCritical              Indicates whether support for this control
   *                                 should be considered a critical part of the
   *                                 client processing.
   * @param  secondsUntilExpiration  The length of time in seconds until the
   *                                 password actually expires.
   * @param  encodedValue            The pre-encoded value for this control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private PasswordExpiringControl(String oid, boolean isCritical,
                                  int secondsUntilExpiration,
                                  ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
    this.secondsUntilExpiration = secondsUntilExpiration;
  }
  /**
   * Creates a new password expiring control from the contents of the provided
   * control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this password expiring control.
   *
   * @return  The password expiring control decoded from the provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         password expiring control.
   */
  public static PasswordExpiringControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_PWEXPIRING_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    int secondsUntilExpiration;
    try
    {
      secondsUntilExpiration =
           Integer.parseInt(control.getValue().stringValue());
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message = ERR_PWEXPIRING_CANNOT_DECODE_SECONDS_UNTIL_EXPIRATION.
          get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    return new PasswordExpiringControl(control.getOID(), control.isCritical(),
                                       secondsUntilExpiration,
                                       control.getValue());
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    writer.writeOctetString(String.valueOf(secondsUntilExpiration));
  }
@@ -192,25 +178,12 @@
  /**
   * Retrieves a string representation of this password expiring control.
   *
   * @return  A string representation of this password expiring control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this password expiring control to the
   * provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("PasswordExpiringControl(secondsUntilExpiration=");
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordPolicyRequestControl.java
@@ -29,13 +29,16 @@
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.types.ByteString;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ResultCode;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
/**
@@ -45,8 +48,42 @@
public class PasswordPolicyRequestControl
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<PasswordPolicyRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public PasswordPolicyRequestControl decode(boolean isCritical,
                                               ByteString value)
        throws DirectoryException
    {
      if (value != null)
      {
        Message message = ERR_PWPOLICYREQ_CONTROL_HAS_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      return new PasswordPolicyRequestControl(isCritical);
    }
    public String getOID()
    {
      return OID_PASSWORD_POLICY_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<PasswordPolicyRequestControl> DECODER =
    new Decoder();
  /**
   * Creates a new instance of the password policy request control with the
@@ -54,7 +91,7 @@
   */
  public PasswordPolicyRequestControl()
  {
    super(OID_PASSWORD_POLICY_CONTROL, false);
    this(false);
  }
@@ -64,57 +101,27 @@
   * Creates a new instance of the password policy request control with the
   * provided information.
   *
   * @param  oid         The OID to use for this control.
   * @param  isCritical  Indicates whether support for this control should be
   *                     considered a critical part of the client processing.
   */
  public PasswordPolicyRequestControl(String oid, boolean isCritical)
  public PasswordPolicyRequestControl(boolean isCritical)
  {
    super(oid, isCritical);
    super(OID_PASSWORD_POLICY_CONTROL, isCritical);
  }
  /**
   * Creates a new password policy request control from the contents of the
   * provided control.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this password policy request control.
   *
   * @return  The password policy request control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         password policy request control.
   * @param writer The ASN.1 output stream to write to.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public static PasswordPolicyRequestControl decodeControl(Control control)
         throws LDAPException
  {
    if (control.hasValue())
    {
      Message message = ERR_PWPOLICYREQ_CONTROL_HAS_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    return new PasswordPolicyRequestControl(control.getOID(),
                                            control.isCritical());
  }
  /**
   * Retrieves a string representation of this password policy request control.
   *
   * @return  A string representation of this password policy request control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  @Override
  public void writeValue(ASN1Writer writer) throws IOException {
    // No value element.
  }
@@ -125,6 +132,7 @@
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("PasswordPolicyRequestControl()");
opendj-sdk/opends/src/server/org/opends/server/controls/PasswordPolicyResponseControl.java
@@ -29,21 +29,15 @@
import java.util.ArrayList;
import java.io.IOException;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Enumerated;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -59,6 +53,112 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<PasswordPolicyResponseControl>
  {
    /**
     * {@inheritDoc}
     */
    public PasswordPolicyResponseControl decode(boolean isCritical,
                                                ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        // The response control must always have a value.
        Message message = ERR_PWPOLICYRES_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        PasswordPolicyWarningType warningType  = null;
        PasswordPolicyErrorType   errorType    = null;
        int                       warningValue = -1;
        reader.readStartSequence();
        while(reader.hasNextElement())
        {
          switch (reader.peekType())
          {
            case TYPE_WARNING_ELEMENT:
              // Its a CHOICE element. Read as sequence to retrieve
              // nested element.
              reader.readStartSequence();
              warningType =
                  PasswordPolicyWarningType.valueOf(reader.peekType());
              warningValue = (int)reader.readInteger();
              if (warningType == null)
              {
                Message message = ERR_PWPOLICYRES_INVALID_WARNING_TYPE.get(
                    byteToHex(reader.peekType()));
                throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                    message);
              }
              reader.readEndSequence();
              break;
            case TYPE_ERROR_ELEMENT:
              int errorValue = (int)reader.readInteger();
              errorType = PasswordPolicyErrorType.valueOf(errorValue);
              if (errorType == null)
              {
                Message message =
                    ERR_PWPOLICYRES_INVALID_ERROR_TYPE.get(errorValue);
                throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                    message);
              }
              break;
            default:
              Message message = ERR_PWPOLICYRES_INVALID_ELEMENT_TYPE.get(
                  byteToHex(reader.peekType()));
              throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
          }
        }
        reader.readEndSequence();
        return new PasswordPolicyResponseControl(isCritical,
            warningType, warningValue,
            errorType);
      }
      catch (DirectoryException de)
      {
        throw de;
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_PWPOLICYRES_DECODE_ERROR.get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
    }
    public String getOID()
    {
      return OID_ACCOUNT_USABLE_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<PasswordPolicyResponseControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -97,7 +197,7 @@
   */
  public PasswordPolicyResponseControl()
  {
    super(OID_PASSWORD_POLICY_CONTROL, false, encodeValue(null, -1, null));
    super(OID_PASSWORD_POLICY_CONTROL, false);
    warningType  = null;
@@ -125,13 +225,7 @@
                                       int warningValue,
                                       PasswordPolicyErrorType errorType)
  {
    super(OID_PASSWORD_POLICY_CONTROL, false,
          encodeValue(warningType, warningValue, errorType));
    this.warningType  = warningType;
    this.warningValue = warningValue;
    this.errorType    = errorType;
    this(false, warningType, warningValue, errorType);
  }
@@ -140,7 +234,6 @@
   * Creates a new instance of the password policy request control with the
   * provided information.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether support for this control should be
   *                       considered a critical part of the client processing.
   * @param  warningType   The warning type to use for this password policy
@@ -152,13 +245,12 @@
   *                       response control, or <CODE>null</CODE> if there
   *                       should not be an error flag.
   */
  public PasswordPolicyResponseControl(String oid, boolean isCritical,
  public PasswordPolicyResponseControl(boolean isCritical,
                                       PasswordPolicyWarningType warningType,
                                       int warningValue,
                                       PasswordPolicyErrorType errorType)
  {
    super(oid, isCritical, encodeValue(warningType, warningValue, errorType));
    super(OID_PASSWORD_POLICY_CONTROL, isCritical);
    this.warningType  = warningType;
    this.warningValue = warningValue;
@@ -168,182 +260,35 @@
  /**
   * Creates a new instance of the password policy request control with the
   * provided information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether support for this control should be
   *                       considered a critical part of the client processing.
   * @param  warningType   The warning type to use for this password policy
   *                       response control, or <CODE>null</CODE> if there
   *                       should not be a warning flag.
   * @param  warningValue  The warning value to use for this password policy
   *                       response control, if applicable.
   * @param  errorType     The error type to use for this password policy
   *                       response control, or <CODE>null</CODE> if there
   *                       should not be an error flag.
   * @param  encodedValue  The pre-encoded value to use for this control.
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private PasswordPolicyResponseControl(String oid, boolean isCritical,
                                        PasswordPolicyWarningType warningType,
                                        int warningValue,
                                        PasswordPolicyErrorType errorType,
                                        ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    this.warningType  = warningType;
    this.warningValue = warningValue;
    this.errorType    = errorType;
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the value for this control.
   *
   * @param  warningType   The warning type to use for this password policy
   *                       response control, or <CODE>null</CODE> if there
   *                       should not be a warning flag.
   * @param  warningValue  The warning value to use for this password policy
   *                       response control, if applicable.
   * @param  errorType     The error type to use for this password policy
   *                       response control, or <CODE>null</CODE> if there
   *                       should not be an error flag.
   *
   * @return  An ASN.1 octet string containing the encoded control value.
   */
  private static ASN1OctetString encodeValue(
                                      PasswordPolicyWarningType warningType,
                                      int warningValue,
                                      PasswordPolicyErrorType errorType)
  {
    ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2);
    writer.writeStartSequence();
    if (warningType != null)
    {
      ASN1Integer warningInteger = new ASN1Integer(warningType.getType(),
                                                   warningValue);
      elements.add(new ASN1Element(TYPE_WARNING_ELEMENT,
                                   warningInteger.encode()));
      // Just write the CHOICE element as a single element SEQUENCE.
      writer.writeStartSequence(TYPE_WARNING_ELEMENT);
      writer.writeInteger(warningType.getType(), warningValue);
      writer.writeEndSequence();
    }
    if (errorType != null)
    {
      elements.add(new ASN1Enumerated(TYPE_ERROR_ELEMENT,
                                      errorType.intValue()));
      writer.writeInteger(TYPE_ERROR_ELEMENT, errorType.intValue());
    }
    writer.writeEndSequence();
    ASN1Sequence valueSequence = new ASN1Sequence(elements);
    return new ASN1OctetString(valueSequence.encode());
    writer.writeEndSequence();
  }
  /**
   * Creates a new password policy response control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this password policy response control.
   *
   * @return  The password policy response control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         password policy response control.
   */
  public static PasswordPolicyResponseControl decodeControl(Control control)
         throws LDAPException
  {
    ASN1OctetString controlValue = control.getValue();
    if (controlValue == null)
    {
      // The response control must always have a value.
      Message message = ERR_PWPOLICYRES_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    try
    {
      PasswordPolicyWarningType warningType  = null;
      PasswordPolicyErrorType   errorType    = null;
      int                       warningValue = -1;
      ASN1Sequence valueSequence =
           ASN1Sequence.decodeAsSequence(controlValue.value());
      for (ASN1Element e : valueSequence.elements())
      {
        switch (e.getType())
        {
          case TYPE_WARNING_ELEMENT:
            ASN1Integer integerElement = ASN1Integer.decodeAsInteger(e.value());
            warningValue = integerElement.intValue();
            warningType =
                 PasswordPolicyWarningType.valueOf(integerElement.getType());
            if (warningType == null)
            {
              Message message = ERR_PWPOLICYRES_INVALID_WARNING_TYPE.get(
                  byteToHex(integerElement.getType()));
              throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
            }
            break;
          case TYPE_ERROR_ELEMENT:
            int errorValue = e.decodeAsEnumerated().intValue();
            errorType = PasswordPolicyErrorType.valueOf(errorValue);
            if (errorType == null)
            {
              Message message =
                  ERR_PWPOLICYRES_INVALID_ERROR_TYPE.get(errorValue);
              throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
            }
            break;
          default:
            Message message = ERR_PWPOLICYRES_INVALID_ELEMENT_TYPE.get(
                byteToHex(e.getType()));
            throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
        }
      }
      return new PasswordPolicyResponseControl(control.getOID(),
                                               control.isCritical(),
                                               warningType, warningValue,
                                               errorType, controlValue);
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (ASN1Exception ae)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, ae);
      }
      Message message = ERR_PWPOLICYRES_DECODE_ERROR.get(ae.getMessage());
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_PWPOLICYRES_DECODE_ERROR.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
  }
  /**
   * Retrieves the password policy warning type contained in this control.
   *
@@ -384,25 +329,12 @@
  /**
   * Retrieves a string representation of this password policy response control.
   *
   * @return  A string representation of this password policy response control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this password policy response control to
   * the provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("PasswordPolicyResponseControl(");
opendj-sdk/opends/src/server/org/opends/server/controls/PersistentSearchControl.java
@@ -28,22 +28,16 @@
import org.opends.messages.Message;
import java.util.ArrayList;
import java.util.Set;
import java.io.IOException;
import org.opends.server.protocols.asn1.ASN1Boolean;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
@@ -59,6 +53,74 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<PersistentSearchControl>
  {
    /**
     * {@inheritDoc}
     */
    public PersistentSearchControl decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = ERR_PSEARCH_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      boolean                         changesOnly;
      boolean                         returnECs;
      Set<PersistentSearchChangeType> changeTypes;
      try
      {
        reader.readStartSequence();
        int changeTypesValue = (int)reader.readInteger();
        changeTypes = PersistentSearchChangeType.intToTypes(changeTypesValue);
        changesOnly = reader.readBoolean();
        returnECs   = reader.readBoolean();
        reader.readEndSequence();
      }
      catch (LDAPException le)
      {
        throw new DirectoryException(ResultCode.valueOf(le.getResultCode()), le
            .getMessageObject());
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_PSEARCH_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
      return new PersistentSearchControl(isCritical,
          changeTypes, changesOnly, returnECs);
    }
    public String getOID()
    {
      return OID_PERSISTENT_SEARCH;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<PersistentSearchControl> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -94,13 +156,7 @@
  public PersistentSearchControl(Set<PersistentSearchChangeType> changeTypes,
                                 boolean changesOnly, boolean returnECs)
  {
    super(OID_PERSISTENT_SEARCH, true,
          encodeValue(changeTypes, changesOnly, returnECs));
    this.changeTypes = changeTypes;
    this.changesOnly = changesOnly;
    this.returnECs   = returnECs;
    this(true, changeTypes, changesOnly, returnECs);
  }
@@ -108,7 +164,6 @@
  /**
   * Creates a new persistent search control with the provided information.
   *
   * @param  oid          The OID to use for the control.
   * @param  isCritical   Indicates whether the control should be considered
   *                      critical for the operation processing.
   * @param  changeTypes  The set of change types for which to provide
@@ -120,11 +175,11 @@
   *                      notification control in updated entries that match the
   *                      associated search criteria.
   */
  public PersistentSearchControl(String oid, boolean isCritical,
  public PersistentSearchControl(boolean isCritical,
                                 Set<PersistentSearchChangeType> changeTypes,
                                 boolean changesOnly, boolean returnECs)
  {
    super(oid, isCritical, encodeValue(changeTypes, changesOnly, returnECs));
    super(OID_PERSISTENT_SEARCH, isCritical);
    this.changeTypes = changeTypes;
@@ -135,130 +190,24 @@
  /**
   * Creates a new persistent search control with the provided information.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  oid           The OID to use for the control.
   * @param  isCritical    Indicates whether the control should be considered
   *                       critical for the operation processing.
   * @param  changeTypes   The set of change types for which to provide
   *                       notification to the client.
   * @param  changesOnly   Indicates whether to only return changes that match
   *                       the associated search criteria, or to also return all
   *                       existing entries that match the filter.
   * @param  returnECs     Indicates whether to include the entry change
   *                       notification control in updated entries that match
   *                       the associated search criteria.
   * @param  encodedValue  The pre-encoded value for the control.
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private PersistentSearchControl(String oid, boolean isCritical,
                                  Set<PersistentSearchChangeType> changeTypes,
                                  boolean changesOnly, boolean returnECs,
                                  ASN1OctetString encodedValue)
  {
    super(oid, isCritical, encodedValue);
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    writer.writeInteger(
        PersistentSearchChangeType.changeTypesToInt(changeTypes));
    writer.writeBoolean(changesOnly);
    writer.writeBoolean(returnECs);
    writer.writeEndSequence();
    this.changeTypes = changeTypes;
    this.changesOnly = changesOnly;
    this.returnECs   = returnECs;
  }
  /**
   * Encodes the provided information into an ASN.1 octet string suitable for
   * use as the control value.
   *
   * @param  changeTypes  The set of change types for which to provide
   *                      notification to the client.
   * @param  changesOnly  Indicates whether to only return changes that match
   *                      the associated search criteria, or to also return all
   *                      existing entries that match the filter.
   * @param  returnECs    Indicates whether to include the entry change
   *                      notification control in updated entries that match the
   *                      associated search criteria.
   *
   * @return  An ASN.1 octet string containing the encoded information.
   */
  private static ASN1OctetString encodeValue(Set<PersistentSearchChangeType>
                                                  changeTypes,
                                             boolean changesOnly,
                                             boolean returnECs)
  {
    ArrayList<ASN1Element> elements =
         new ArrayList<ASN1Element>(3);
    elements.add(new ASN1Integer(
         PersistentSearchChangeType.changeTypesToInt(changeTypes)));
    elements.add(new ASN1Boolean(changesOnly));
    elements.add(new ASN1Boolean(returnECs));
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
  }
  /**
   * Creates a new persistent search control from the contents of the provided
   * control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this persistent search control.
   *
   * @return  The persistent search control decoded from the provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         persistent search control.
   */
  public static PersistentSearchControl decodeControl(Control control)
         throws LDAPException
  {
    if (! control.hasValue())
    {
      Message message = ERR_PSEARCH_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    boolean                         changesOnly;
    boolean                         returnECs;
    Set<PersistentSearchChangeType> changeTypes;
    try
    {
      ArrayList<ASN1Element> elements =
           ASN1Sequence.decodeAsSequence(control.getValue().value()).elements();
      if (elements.size() != 3)
      {
        Message message =
            ERR_PSEARCH_INVALID_ELEMENT_COUNT.get(elements.size());
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      int changeTypesValue = elements.get(0).decodeAsInteger().intValue();
      changeTypes = PersistentSearchChangeType.intToTypes(changeTypesValue);
      changesOnly = elements.get(1).decodeAsBoolean().booleanValue();
      returnECs   = elements.get(2).decodeAsBoolean().booleanValue();
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_PSEARCH_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
    return new PersistentSearchControl(control.getOID(), control.isCritical(),
                                       changeTypes, changesOnly, returnECs,
                                       control.getValue());
    writer.writeEndSequence();
  }
@@ -276,21 +225,6 @@
  /**
   * Specifies the set of change types for this persistent search control.
   *
   * @param  changeTypes  The set of change types for this persistent search
   *                      control.
   */
  public void setChangeTypes(Set<PersistentSearchChangeType> changeTypes)
  {
    this.changeTypes = changeTypes;
    setValue(encodeValue(changeTypes, changesOnly, returnECs));
  }
  /**
   * Indicates whether to only return changes that match the associated search
   * criteria, or to also return all existing entries that match the filter.
   *
@@ -306,23 +240,6 @@
  /**
   * Specifies whether to only return changes that match teh associated search
   * criteria, or to also return all existing entries that match the filter.
   *
   * @param  changesOnly  Indicates whether to only return changes that match
   *                      the associated search criteria, or to also return all
   *                      existing entries that match the filter.
   */
  public void setChangesOnly(boolean changesOnly)
  {
    this.changesOnly = changesOnly;
    setValue(encodeValue(changeTypes, changesOnly, returnECs));
  }
  /**
   * Indicates whether to include the entry change notification control in
   * entries returned to the client as the result of a change in the Directory
   * Server data.
@@ -338,43 +255,12 @@
  /**
   * Specifies whether to include the entry change notification control in
   * entries returned to the client as a result of a change in the Directory
   * Server data.
   *
   * @param  returnECs  Indicates whether to include the entry change
   *                    notification control in updated entries that match the
   *                    associated search criteria.
   */
  public void setReturnECs(boolean returnECs)
  {
    this.returnECs = returnECs;
    setValue(encodeValue(changeTypes, changesOnly, returnECs));
  }
  /**
   * Retrieves a string representation of this persistent search control.
   *
   * @return  A string representation of this persistent search control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this persistent search control to the
   * provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("PersistentSearchControl(changeTypes=\"");
opendj-sdk/opends/src/server/org/opends/server/controls/ProxiedAuthV1Control.java
@@ -28,31 +28,21 @@
import org.opends.messages.Message;
import java.util.ArrayList;
import java.util.concurrent.locks.Lock;
import java.io.IOException;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.PasswordPolicyState;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.LDAPException;
import org.opends.server.types.LockManager;
import org.opends.server.types.ResultCode;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import static org.opends.server.util.Validator.*;
@@ -69,6 +59,66 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<ProxiedAuthV1Control>
  {
    /**
     * {@inheritDoc}
     */
    public ProxiedAuthV1Control decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      if (!isCritical)
      {
        Message message = ERR_PROXYAUTH1_CONTROL_NOT_CRITICAL.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      if (value == null)
      {
        Message message = ERR_PROXYAUTH1_NO_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      DN authorizationDN;
      try
      {
        reader.readStartSequence();
        authorizationDN = DN.decode(reader.readOctetString());
        reader.readEndSequence();
      }
      catch (Exception e)
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, e);
        }
        Message message =
            ERR_PROXYAUTH1_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
      return new ProxiedAuthV1Control(isCritical, authorizationDN);
    }
    public String getOID()
    {
      return OID_PROXIED_AUTH_V1;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<ProxiedAuthV1Control> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
@@ -77,7 +127,7 @@
  // The raw, unprocessed authorization DN from the control value.
  private ASN1OctetString rawAuthorizationDN;
  private ByteString rawAuthorizationDN;
  // The processed authorization DN from the control value.
  private DN authorizationDN;
@@ -91,14 +141,9 @@
   * @param  rawAuthorizationDN  The raw, unprocessed authorization DN from the
   *                             control value.  It must not be {@code null}.
   */
  public ProxiedAuthV1Control(ASN1OctetString rawAuthorizationDN)
  public ProxiedAuthV1Control(ByteString rawAuthorizationDN)
  {
    super(OID_PROXIED_AUTH_V1, true, encodeValue(rawAuthorizationDN));
    this.rawAuthorizationDN = rawAuthorizationDN;
    authorizationDN = null;
    this(true, rawAuthorizationDN);
  }
@@ -112,13 +157,7 @@
   */
  public ProxiedAuthV1Control(DN authorizationDN)
  {
    super(OID_PROXIED_AUTH_V1, true,
          encodeValue(new ASN1OctetString(authorizationDN.toString())));
    this.authorizationDN = authorizationDN;
    rawAuthorizationDN = new ASN1OctetString(authorizationDN.toString());
    this(true, authorizationDN);
  }
@@ -127,19 +166,15 @@
   * Creates a new instance of the proxied authorization v1 control with the
   * provided information.
   *
   * @param  oid                 The OID to use for this control.
   * @param  isCritical          Indicates whether support for this control
   *                             should be considered a critical part of the
   *                             server processing.
   * @param  controlValue        The encoded value for this control.
   * @param  rawAuthorizationDN  The raw, unprocessed authorization DN from the
   *                             control value.
   */
  private ProxiedAuthV1Control(String oid, boolean isCritical,
                             ASN1OctetString controlValue,
                             ASN1OctetString rawAuthorizationDN)
  public ProxiedAuthV1Control(boolean isCritical, ByteString rawAuthorizationDN)
  {
    super(oid, isCritical, controlValue);
    super(OID_PROXIED_AUTH_V1, isCritical);
    this.rawAuthorizationDN = rawAuthorizationDN;
@@ -150,91 +185,43 @@
  /**
   * Generates an encoded value for this control containing the provided raw
   * authorization DN.
   * Creates a new instance of the proxied authorization v1 control with the
   * provided information.
   *
   * @param  rawAuthorizationDN  The raw, unprocessed authorization DN to use in
   *                             the control value.  It must not be
   *                             {@code null}.
   *
   * @return  The encoded control value.
   * @param  isCritical          Indicates whether support for this control
   *                             should be considered a critical part of the
   *                             server processing.
   * @param  authorizationDN     The authorization DN from the control value.
   *                             It must not be {@code null}.
   */
  private static ASN1OctetString encodeValue(ASN1OctetString rawAuthorizationDN)
  public ProxiedAuthV1Control(boolean isCritical, DN authorizationDN)
  {
    ensureNotNull(rawAuthorizationDN);
    super(OID_PROXIED_AUTH_V1, isCritical);
    ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(1);
    elements.add(rawAuthorizationDN);
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
    this.authorizationDN = authorizationDN;
    rawAuthorizationDN = ByteString.valueOf(authorizationDN.toString());
  }
  /**
   * Creates a new proxied authorization v1 control from the contents of the
   * provided control.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this proxied authorization v1 control.  It must not
   *                  be {@code null}.
   *
   * @return  The proxied authorization v1 control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         proxied authorization v1 control.
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  public static ProxiedAuthV1Control decodeControl(Control control)
         throws LDAPException
  {
    ensureNotNull(control);
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    if (! control.isCritical())
    {
      Message message = ERR_PROXYAUTH1_CONTROL_NOT_CRITICAL.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    writer.writeStartSequence();
    writer.writeOctetString(rawAuthorizationDN);
    writer.writeEndSequence();
    if (! control.hasValue())
    {
      Message message = ERR_PROXYAUTH1_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    ASN1OctetString rawAuthorizationDN;
    try
    {
      ArrayList<ASN1Element> elements =
           ASN1Sequence.decodeAsSequence(control.getValue().value()).elements();
      if (elements.size() != 1)
      {
        Message message =
            ERR_PROXYAUTH1_INVALID_ELEMENT_COUNT.get(elements.size());
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      rawAuthorizationDN = elements.get(0).decodeAsOctetString();
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (Exception e)
    {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
      }
      Message message =
          ERR_PROXYAUTH1_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
    return new ProxiedAuthV1Control(control.getOID(), control.isCritical(),
                                    control.getValue(), rawAuthorizationDN);
    writer.writeEndSequence();
  }
@@ -244,7 +231,7 @@
   *
   * @return  The raw, unprocessed authorization DN from the control value.
   */
  public ASN1OctetString getRawAuthorizationDN()
  public ByteString getRawAuthorizationDN()
  {
    return rawAuthorizationDN;
  }
@@ -252,23 +239,6 @@
  /**
   * Specifies the raw, unprocessed authorization DN for this proxied auth
   * control.
   *
   * @param  rawAuthorizationDN  The raw, unprocessed authorization DN for this
   *                             proxied auth control.
   */
  public void setRawAuthorizationDN(ASN1OctetString rawAuthorizationDN)
  {
    this.rawAuthorizationDN = rawAuthorizationDN;
    setValue(encodeValue(rawAuthorizationDN));
    authorizationDN = null;
  }
  /**
   * Retrieves the authorization DN from the control value.
   *
   * @return  The authorization DN from the control value.
@@ -290,24 +260,6 @@
  /**
   * Specifies the authorization DN for this proxied auth control.
   *
   * @param  authorizationDN  The authorizationDN for this proxied auth control.
   *                          It must not be {@code null}.
   */
  public void setAuthorizationDN(DN authorizationDN)
  {
    ensureNotNull(authorizationDN);
    this.authorizationDN = authorizationDN;
    rawAuthorizationDN = new ASN1OctetString(authorizationDN.toString());
    setValue(encodeValue(rawAuthorizationDN));
  }
  /**
   * Retrieves the authorization entry for this proxied authorization V1
   * control.  It will also perform any necessary password policy checks to
   * ensure that the associated user account is suitable for use in performing
@@ -396,29 +348,16 @@
  /**
   * Retrieves a string representation of this proxied auth v1 control.
   *
   * @return  A string representation of this proxied auth v1 control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this proxied auth v1 control to the
   * provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("ProxiedAuthorizationV1Control(authorizationDN=\"");
    rawAuthorizationDN.toString(buffer);
    buffer.append(rawAuthorizationDN);
    buffer.append("\")");
  }
}
opendj-sdk/opends/src/server/org/opends/server/controls/ProxiedAuthV2Control.java
@@ -30,29 +30,20 @@
import java.util.concurrent.locks.Lock;
import java.io.IOException;
import org.opends.server.api.IdentityMapper;
import org.opends.server.core.DirectoryServer;
import org.opends.server.core.PasswordPolicyState;
import org.opends.server.protocols.asn1.ASN1Exception;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Control;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.LDAPException;
import org.opends.server.types.LockManager;
import org.opends.server.types.ResultCode;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import static org.opends.server.util.Validator.*;
import static org.opends.server.util.Validator.ensureNotNull;
/**
@@ -67,115 +58,45 @@
       extends Control
{
  /**
   * The tracer object for the debug logger.
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private static final DebugTracer TRACER = getTracer();
  // The authorization ID from the control value.
  private ASN1OctetString authorizationID;
  /**
   * Creates a new instance of the proxied authorization v2 control with the
   * provided information.
   *
   * @param  authorizationID  The authorization ID from the control value.
   */
  public ProxiedAuthV2Control(ASN1OctetString authorizationID)
  private static final class Decoder
      implements ControlDecoder<ProxiedAuthV2Control>
  {
    super(OID_PROXIED_AUTH_V2, true, authorizationID);
    ensureNotNull(authorizationID);
    this.authorizationID = authorizationID;
  }
  /**
   * Creates a new instance of the proxied authorization v2 control with the
   * provided information.
   *
   * @param  oid              The OID to use for this control.
   * @param  isCritical       Indicates whether support for this control
   *                          should be considered a critical part of the
   *                          server processing.
   * @param  authorizationID  The authorization ID from the control value.
     * {@inheritDoc}
   */
  private ProxiedAuthV2Control(String oid, boolean isCritical,
                             ASN1OctetString authorizationID)
    public ProxiedAuthV2Control decode(boolean isCritical, ByteString value)
        throws DirectoryException
  {
    super(oid, isCritical, authorizationID);
    this.authorizationID = authorizationID;
  }
  /**
   * Creates a new proxied authorization v2 control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this proxied authorization v2 control.  It must not
   *                  be {@code null}.
   *
   * @return  The proxied authorization v2 control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         proxied authorization v2 control.
   */
  public static ProxiedAuthV2Control decodeControl(Control control)
         throws LDAPException
  {
    ensureNotNull(control);
    if (! control.isCritical())
      if (!isCritical)
    {
      Message message = ERR_PROXYAUTH2_CONTROL_NOT_CRITICAL.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
    }
    if (! control.hasValue())
      if (value == null)
    {
      Message message = ERR_PROXYAUTH2_NO_CONTROL_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
    }
    ASN1OctetString authorizationID;
      ASN1Reader reader = ASN1.getReader(value);
      ByteString authorizationID;
    try
    {
      authorizationID =
           ASN1OctetString.decodeAsOctetString(control.getValue().value());
    }
    catch (ASN1Exception ae)
    {
      String lowerAuthZIDStr = toLowerCase(control.getValue().stringValue());
      if (lowerAuthZIDStr.startsWith("dn:") || lowerAuthZIDStr.startsWith("u:"))
      {
        authorizationID = control.getValue();
      }
      else
      {
        if (debugEnabled())
        {
          TRACER.debugCaught(DebugLogLevel.ERROR, ae);
        }
        Message message =
            ERR_PROXYAUTH2_CANNOT_DECODE_VALUE.get(getExceptionMessage(ae));
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message,
                                ae);
      }
        // Try the legacy encoding where the value is wrapped by an
        // extra octet string
        authorizationID = reader.readOctetString();
    }
    catch (Exception e)
    {
        // Try just getting the value.
        authorizationID = value;
        String lowerAuthZIDStr = toLowerCase(authorizationID.toString());
        if (!lowerAuthZIDStr.startsWith("dn:") &&
            !lowerAuthZIDStr.startsWith("u:"))
        {
      if (debugEnabled())
      {
        TRACER.debugCaught(DebugLogLevel.ERROR, e);
@@ -183,11 +104,83 @@
      Message message =
          ERR_PROXYAUTH2_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
          throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message,
              e);
        }
    }
    return new ProxiedAuthV2Control(control.getOID(), control.isCritical(),
                                    authorizationID);
      return new ProxiedAuthV2Control(isCritical, authorizationID);
    }
    public String getOID()
    {
      return OID_PROXIED_AUTH_V2;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<ProxiedAuthV2Control> DECODER =
    new Decoder();
  /**
   * The tracer object for the debug logger.
   */
  private static final DebugTracer TRACER = getTracer();
  // The authorization ID from the control value.
  private ByteString authorizationID;
  /**
   * Creates a new instance of the proxied authorization v2 control with the
   * provided information.
   *
   * @param  authorizationID  The authorization ID from the control value.
   */
  public ProxiedAuthV2Control(ByteString authorizationID)
  {
    this(true, authorizationID);
  }
  /**
   * Creates a new instance of the proxied authorization v2 control with the
   * provided information.
   *
   * @param  isCritical       Indicates whether support for this control
   *                          should be considered a critical part of the
   *                          server processing.
   * @param  authorizationID  The authorization ID from the control value.
   */
  public ProxiedAuthV2Control(boolean isCritical, ByteString authorizationID)
  {
    super(OID_PROXIED_AUTH_V2, isCritical);
    ensureNotNull(authorizationID);
    this.authorizationID = authorizationID;
  }
  /**
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    writer.writeOctetString(authorizationID);
  }
@@ -197,7 +190,7 @@
   *
   * @return  The authorization ID for this proxied authorization V2 control.
   */
  public ASN1OctetString getAuthorizationID()
  public ByteString getAuthorizationID()
  {
    return authorizationID;
  }
@@ -205,28 +198,6 @@
  /**
   * Specifies the authorization ID for this proxied authorization V2 control.
   *
   * @param  authorizationID  The authorization ID for this proxied
   *                          authorization V2 control.
   */
  public void setAuthorizationID(ASN1OctetString authorizationID)
  {
    if (authorizationID == null)
    {
      this.authorizationID = new ASN1OctetString();
      setValue(this.authorizationID);
    }
    else
    {
      this.authorizationID = authorizationID;
      setValue(authorizationID);
    }
  }
  /**
   * Retrieves the authorization entry for this proxied authorization V2
   * control.  It will also perform any necessary password policy checks to
   * ensure that the associated user account is suitable for use in performing
@@ -244,7 +215,7 @@
         throws DirectoryException
  {
    // Check for a zero-length value, which would be for an anonymous user.
    if (authorizationID.value().length == 0)
    if (authorizationID.length() == 0)
    {
      return null;
    }
@@ -252,13 +223,12 @@
    // Get a lowercase string representation.  It must start with either "dn:"
    // or "u:".
    String authzID = authorizationID.stringValue();
    String lowerAuthzID = toLowerCase(authzID);
    String lowerAuthzID = toLowerCase(authorizationID.toString());
    if (lowerAuthzID.startsWith("dn:"))
    {
      // It's a DN, so decode it and see if it exists.  If it's the null DN,
      // then just assume that it does.
      DN authzDN = DN.decode(authzID.substring(3));
      DN authzDN = DN.decode(lowerAuthzID.substring(3));
      if (authzDN.isNullDN())
      {
        return null;
@@ -297,7 +267,7 @@
          if (userEntry == null)
          {
            // The requested user does not exist.
            Message message = ERR_PROXYAUTH2_NO_SUCH_USER.get(authzID);
            Message message = ERR_PROXYAUTH2_NO_SUCH_USER.get(lowerAuthzID);
            throw new DirectoryException(ResultCode.AUTHORIZATION_DENIED,
                                         message);
          }
@@ -339,7 +309,7 @@
      // Use the proxied authorization identity mapper to resolve the username
      // to an entry.
      IdentityMapper proxyMapper =
      IdentityMapper<?> proxyMapper =
           DirectoryServer.getProxiedAuthorizationIdentityMapper();
      if (proxyMapper == null)
      {
@@ -347,10 +317,10 @@
        throw new DirectoryException(ResultCode.AUTHORIZATION_DENIED, message);
      }
      Entry userEntry = proxyMapper.getEntryForID(authzID.substring(2));
      Entry userEntry = proxyMapper.getEntryForID(lowerAuthzID.substring(2));
      if (userEntry == null)
      {
        Message message = ERR_PROXYAUTH2_NO_SUCH_USER.get(authzID);
        Message message = ERR_PROXYAUTH2_NO_SUCH_USER.get(lowerAuthzID);
        throw new DirectoryException(ResultCode.AUTHORIZATION_DENIED, message);
      }
      else
@@ -376,7 +346,7 @@
    }
    else
    {
      Message message = ERR_PROXYAUTH2_INVALID_AUTHZID.get(authzID);
      Message message = ERR_PROXYAUTH2_INVALID_AUTHZID.get(lowerAuthzID);
      throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
    }
  }
@@ -384,29 +354,16 @@
  /**
   * Retrieves a string representation of this proxied auth v2 control.
   *
   * @return  A string representation of this proxied auth v2 control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
  }
  /**
   * Appends a string representation of this proxied auth v2 control to the
   * provided buffer.
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("ProxiedAuthorizationV2Control(authzID=\"");
    authorizationID.toString(buffer);
    buffer.append(authorizationID);
    buffer.append("\")");
  }
}
opendj-sdk/opends/src/server/org/opends/server/controls/ServerSideSortRequestControl.java
@@ -31,19 +31,15 @@
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.IOException;
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.asn1.ASN1Boolean;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.AttributeType;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.SortKey;
import org.opends.server.types.SortOrder;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
@@ -53,7 +49,10 @@
/**
 * This class implements the server-side sort request control as defined in RFC
 * 2891 section 1.1.  The ASN.1 description for the control value is:
 * 2891 section 1.1. The subclass ServerSideSortRequestControl.ClientRequest
 * should be used when encoding this control from a sort order string. This is
 * suitable for client tools that want to encode this control without a
 * SortOrder object. The ASN.1 description for the control value is:
 * <BR><BR>
 * <PRE>
 * SortKeyList ::= SEQUENCE OF SEQUENCE {
@@ -78,140 +77,165 @@
  private static final byte TYPE_REVERSE_ORDER = (byte) 0x81;
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<ServerSideSortRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public ServerSideSortRequestControl decode(boolean isCritical,
                                               ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = INFO_SORTREQ_CONTROL_NO_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        reader.readStartSequence();
        if (!reader.hasNextElement())
        {
          Message message = INFO_SORTREQ_CONTROL_NO_SORT_KEYS.get();
          throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
        }
        ArrayList<SortKey> sortKeys = new ArrayList<SortKey>();
        while(reader.hasNextElement())
        {
          reader.readStartSequence();
          String attrName = toLowerCase(reader.readOctetStringAsString());
          AttributeType attrType =
              DirectoryServer.getAttributeType(attrName, false);
          if (attrType == null)
          {
            Message message = INFO_SORTREQ_CONTROL_UNDEFINED_ATTR.get(attrName);
            throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
          }
          OrderingMatchingRule orderingRule = null;
          boolean ascending = true;
          while(reader.hasNextElement())
          {
            switch (reader.peekType())
            {
              case TYPE_ORDERING_RULE_ID:
                String orderingRuleID =
                               toLowerCase(reader.readOctetStringAsString());
                orderingRule =
                    DirectoryServer.getOrderingMatchingRule(orderingRuleID);
                if (orderingRule == null)
                {
                  Message message =
                      INFO_SORTREQ_CONTROL_UNDEFINED_ORDERING_RULE.
                          get(orderingRuleID);
                  throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                      message);
                }
                break;
              case TYPE_REVERSE_ORDER:
                ascending = ! reader.readBoolean();
                break;
              default:
                Message message = INFO_SORTREQ_CONTROL_INVALID_SEQ_ELEMENT_TYPE.
                    get(byteToHex(reader.peekType()));
                throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
                    message);
            }
          }
          if ((orderingRule == null) &&
              (attrType.getOrderingMatchingRule() == null))
          {
            Message message =
                INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get(attrName);
            throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
                message);
          }
          sortKeys.add(new SortKey(attrType, ascending, orderingRule));
        }
        return new ServerSideSortRequestControl(isCritical,
            new SortOrder(sortKeys.toArray(new SortKey[0])));
      }
      catch (DirectoryException de)
      {
        throw de;
      }
      catch (Exception e)
      {
        Message message =
            INFO_SORTREQ_CONTROL_CANNOT_DECODE_VALUE.get(
                getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
    }
    public String getOID()
    {
      return OID_SERVER_SIDE_SORT_REQUEST_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<ServerSideSortRequestControl> DECODER =
      new Decoder();
  // The sort order associated with this control represented by strings.
  private ArrayList<String[]> decodedKeyList;
  // The sort order associated with this control.
  private SortOrder sortOrder;
  /**
   * Creates a new server-side sort request control based on the provided sort
   * order.
   *
   * @param  sortOrder  The sort order to use for this control.
   */
  public ServerSideSortRequestControl(SortOrder sortOrder)
  {
    super(OID_SERVER_SIDE_SORT_REQUEST_CONTROL, false,
          encodeControlValue(sortOrder));
    this.sortOrder = sortOrder;
  }
  /**
   * Creates a new server-side sort request control based on the definition in
   * the provided sort order string.  This is only intended for client-side use,
   * and controls created with this constructor should not attempt to use the
   * generated sort order for any purpose.
   * the provided sort order string.
   *
   * @param  sortOrderString  The string representation of the sort order to use
   *                          for the control.
   *
   * @param  sortOrderString  The string representation of the sort order to
   *                          use for the control.
   * @throws  LDAPException  If the provided sort order string could not be
   *                         decoded.
   */
  public ServerSideSortRequestControl(String sortOrderString)
         throws LDAPException
  {
    super(OID_SERVER_SIDE_SORT_REQUEST_CONTROL, false,
          encodeControlValue(sortOrderString));
    this.sortOrder = null;
    this(false, sortOrderString);
  }
  /**
   * Creates a new server-side sort request control with the provided
   * information.
   * Creates a new server-side sort request control based on the definition in
   * the provided sort order string.
   *
   * @param  oid           The OID to use for this control.
   * @param  isCritical    Indicates whether support for this control should be
   *                       considered a critical part of the server processing.
   * @param  controlValue  The encoded value for this control.
   * @param  sortOrder     sort order associated with this server-side sort
   *                       control.
   * @param  isCritical    Indicates whether support for this control
   *                       should be considered a critical part of the
   *                       server processing.
   * @param  sortOrderString  The string representation of the sort order to
   *                          use for the control.
   * @throws LDAPException If the provided sort order string could not be
   *                       decoded.
   */
  private ServerSideSortRequestControl(String oid, boolean isCritical,
                                       ASN1OctetString controlValue,
                                       SortOrder sortOrder)
  {
    super(oid, isCritical, controlValue);
    this.sortOrder = sortOrder;
  }
  /**
   * Retrieves the sort order for this server-side sort request control.
   *
   * @return  The sort order for this server-side sort request control.
   */
  public SortOrder getSortOrder()
  {
    return sortOrder;
  }
  /**
   * Encodes the provided sort order object in a manner suitable for use as the
   * value of this control.
   *
   * @param  sortOrder  The sort order to be encoded.
   *
   * @return  The ASN.1 octet string containing the encoded sort order.
   */
  private static ASN1OctetString encodeControlValue(SortOrder sortOrder)
  {
    SortKey[] sortKeys = sortOrder.getSortKeys();
    ArrayList<ASN1Element> keyList =
         new ArrayList<ASN1Element>(sortKeys.length);
    for (SortKey sortKey : sortKeys)
    {
      ArrayList<ASN1Element> elementList = new ArrayList<ASN1Element>(3);
      elementList.add(new ASN1OctetString(
                               sortKey.getAttributeType().getNameOrOID()));
      if (sortKey.getOrderingRule() != null)
      {
        elementList.add(new ASN1OctetString(TYPE_ORDERING_RULE_ID,
                                 sortKey.getOrderingRule().getNameOrOID()));
      }
      if (! sortKey.ascending())
      {
        elementList.add(new ASN1Boolean(TYPE_REVERSE_ORDER, true));
      }
      keyList.add(new ASN1Sequence(elementList));
    }
    return new ASN1OctetString(new ASN1Sequence(keyList).encode());
  }
  /**
   * Encodes the provided sort order string in a manner suitable for use as the
   * value of this control.
   *
   * @param  sortOrderString  The sort order string to be encoded.
   *
   * @return  The ASN.1 octet string containing the encoded sort order.
   *
   * @throws  LDAPException  If the provided sort order string cannot be decoded
   *                         to create the control value.
   */
  private static ASN1OctetString encodeControlValue(String sortOrderString)
  public ServerSideSortRequestControl(boolean isCritical,
                                      String sortOrderString)
          throws LDAPException
  {
    super(OID_SERVER_SIDE_SORT_REQUEST_CONTROL, isCritical);
    StringTokenizer tokenizer = new StringTokenizer(sortOrderString, ",");
    ArrayList<ASN1Element> keyList = new ArrayList<ASN1Element>();
    decodedKeyList = new ArrayList<String[]>();
    while (tokenizer.hasMoreTokens())
    {
      String token = tokenizer.nextToken().trim();
@@ -238,16 +262,11 @@
        if (reverseOrder)
        {
          ArrayList<ASN1Element> elementList = new ArrayList<ASN1Element>(2);
          elementList.add(new ASN1OctetString(token));
          elementList.add(new ASN1Boolean(TYPE_REVERSE_ORDER, reverseOrder));
          keyList.add(new ASN1Sequence(elementList));
          decodedKeyList.add(new String[]{token, null, "r"});
        }
        else
        {
          ArrayList<ASN1Element> elementList = new ArrayList<ASN1Element>(1);
          elementList.add(new ASN1OctetString(token));
          keyList.add(new ASN1Sequence(elementList));
          decodedKeyList.add(new String[]{token, null, null});
        }
      }
      else if (colonPos == 0)
@@ -269,160 +288,91 @@
        if (reverseOrder)
        {
          ArrayList<ASN1Element> elementList = new ArrayList<ASN1Element>(3);
          elementList.add(new ASN1OctetString(attrName));
          elementList.add(new ASN1OctetString(TYPE_ORDERING_RULE_ID, ruleID));
          elementList.add(new ASN1Boolean(TYPE_REVERSE_ORDER, reverseOrder));
          keyList.add(new ASN1Sequence(elementList));
          decodedKeyList.add(new String[]{attrName, ruleID, "r"});
        }
        else
        {
          ArrayList<ASN1Element> elementList = new ArrayList<ASN1Element>(2);
          elementList.add(new ASN1OctetString(attrName));
          elementList.add(new ASN1OctetString(TYPE_ORDERING_RULE_ID, ruleID));
          keyList.add(new ASN1Sequence(elementList));
          decodedKeyList.add(new String[]{attrName, ruleID, null});
        }
      }
    }
    if (keyList.isEmpty())
    if (decodedKeyList.isEmpty())
    {
      Message message = INFO_SORTREQ_CONTROL_NO_SORT_KEYS.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    return new ASN1OctetString(new ASN1Sequence(keyList).encode());
  }
  /**
   * Creates a new server-side sort request control based on the provided sort
   * order.
   *
   * @param  sortOrder  The sort order to use for this control.
   */
  public ServerSideSortRequestControl(SortOrder sortOrder)
  {
    this(false, sortOrder);
  }
  /**
   * Creates a new server-side sort request control from the contents of the
   * provided control.
   * Creates a new server-side sort request control with the provided
   * information.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this server-side sort request control.  It must not
   *                  be {@code null}.
   *
   * @return  The server-side sort request control decoded from the provided
   * @param  isCritical    Indicates whether support for this control should be
   *                       considered a critical part of the server processing.
   * @param  sortOrder     sort order associated with this server-side sort
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         server-side sort request control.
   */
  public static ServerSideSortRequestControl decodeControl(Control control)
         throws LDAPException
  public ServerSideSortRequestControl(boolean isCritical, SortOrder sortOrder)
  {
    ASN1OctetString controlValue = control.getValue();
    if (controlValue == null)
    {
      Message message = INFO_SORTREQ_CONTROL_NO_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    super(OID_SERVER_SIDE_SORT_REQUEST_CONTROL, isCritical);
    try
    {
      ASN1Sequence orderSequence =
           ASN1Sequence.decodeAsSequence(controlValue.value());
      ArrayList<ASN1Element> orderElements = orderSequence.elements();
      SortKey[] sortKeys = new SortKey[orderElements.size()];
      if (sortKeys.length == 0)
      {
        Message message = INFO_SORTREQ_CONTROL_NO_SORT_KEYS.get();
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    this.sortOrder = sortOrder;
      }
      for (int i=0; i < sortKeys.length; i++)
      {
        ASN1Sequence keySequence = orderElements.get(i).decodeAsSequence();
        ArrayList<ASN1Element> keyElements = keySequence.elements();
        String attrName =
             keyElements.get(0).decodeAsOctetString().stringValue().
                  toLowerCase();
        AttributeType attrType = DirectoryServer.getAttributeType(attrName,
                                                                  false);
        if (attrType == null)
        {
          Message message = INFO_SORTREQ_CONTROL_UNDEFINED_ATTR.get(attrName);
          throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
        }
        OrderingMatchingRule orderingRule = null;
        boolean ascending = true;
        for (int j=1; j < keyElements.size(); j++)
        {
          ASN1Element e = keyElements.get(j);
          switch (e.getType())
          {
            case TYPE_ORDERING_RULE_ID:
              String orderingRuleID =
                   e.decodeAsOctetString().stringValue().toLowerCase();
              orderingRule =
                   DirectoryServer.getOrderingMatchingRule(orderingRuleID);
              if (orderingRule == null)
              {
                Message message = INFO_SORTREQ_CONTROL_UNDEFINED_ORDERING_RULE.
                    get(orderingRuleID);
                throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
              }
              break;
            case TYPE_REVERSE_ORDER:
              ascending = ! e.decodeAsBoolean().booleanValue();
              break;
            default:
              Message message = INFO_SORTREQ_CONTROL_INVALID_SEQ_ELEMENT_TYPE.
                  get(byteToHex(e.getType()));
              throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
          }
        }
        if ((orderingRule == null) &&
            (attrType.getOrderingMatchingRule() == null))
        {
          Message message =
              INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get(attrName);
          throw new LDAPException(LDAPResultCode.CONSTRAINT_VIOLATION, message);
        }
        sortKeys[i] = new SortKey(attrType, ascending, orderingRule);
      }
      return new ServerSideSortRequestControl(control.getOID(),
                                              control.isCritical(),
                                              controlValue,
                                              new SortOrder(sortKeys));
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (Exception e)
    {
      Message message =
          INFO_SORTREQ_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
  }
  /**
   * Retrieves a string representation of this server-side sort request control.
   * Retrieves the sort order for this server-side sort request control.
   *
   * @return  A string representation of this server-side sort request control.
   * @return  The sort order for this server-side sort request control.
   * @throws  DirectoryException if an error occurs while retriving the
   *          sort order.
   */
  public String toString()
  public SortOrder getSortOrder() throws DirectoryException
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
    if(sortOrder == null)
    {
      sortOrder = decodeSortOrderFromString();
  }
    return sortOrder;
  }
  /**
   * Writes this control's value to an ASN.1 writer. The value (if any) must
   * be written as an ASN1OctetString.
   *
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    if(decodedKeyList != null)
    {
      // This control was created with a sort order string so encode using
      // that.
      writeValueFromString(writer);
    }
    else
    {
      // This control must have been created with a typed sort order object
      // so encode using that.
      writeValueFromSortOrder(writer);
    }
  }
  /**
   * Appends a string representation of this server-side sort request control
@@ -430,16 +380,160 @@
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("ServerSideSortRequestControl(");
    if(sortOrder == null)
    {
      buffer.append("SortOrder(");
    if (sortOrder != null)
      if (decodedKeyList.size() > 0)
      {
        decodedKeyToString(decodedKeyList.get(0), buffer);
        for (int i=1; i < decodedKeyList.size(); i++)
        {
          buffer.append(",");
          decodedKeyToString(decodedKeyList.get(i), buffer);
        }
      }
      buffer.append(")");
    }
    else
    {
      buffer.append(sortOrder);
    }
    buffer.append(")");
  }
  private void decodedKeyToString(String[] decodedKey, StringBuilder buffer)
  {
    buffer.append("SortKey(");
    if (decodedKey[2] == null)
    {
      buffer.append("+");
    }
    else
    {
      buffer.append("-");
    }
    buffer.append(decodedKey[0]);
    if (decodedKey[1] != null)
    {
      buffer.append(":");
      buffer.append(decodedKey[1]);
    }
    buffer.append(")");
  }
  private SortOrder decodeSortOrderFromString() throws DirectoryException
  {
    ArrayList<SortKey> sortKeys = new ArrayList<SortKey>();
    for(String[] decodedKey : decodedKeyList)
    {
      AttributeType attrType =
          DirectoryServer.getAttributeType(decodedKey[0].toLowerCase(), false);
      if (attrType == null)
      {
        Message message =
            INFO_SORTREQ_CONTROL_UNDEFINED_ATTR.get(decodedKey[0]);
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      OrderingMatchingRule orderingRule = null;
      if(decodedKey[1] != null)
      {
        orderingRule =
            DirectoryServer.getOrderingMatchingRule(
                decodedKey[1].toLowerCase());
        if (orderingRule == null)
        {
          Message message =
              INFO_SORTREQ_CONTROL_UNDEFINED_ORDERING_RULE.
                  get(decodedKey[1]);
          throw new DirectoryException(ResultCode.PROTOCOL_ERROR,
              message);
        }
      }
      boolean ascending = true;
      if(decodedKey[2] != null && decodedKey[2].equals("r"))
      {
        ascending = false;
      }
      if ((orderingRule == null) &&
          (attrType.getOrderingMatchingRule() == null))
      {
        Message message =
            INFO_SORTREQ_CONTROL_NO_ORDERING_RULE_FOR_ATTR.get(
                decodedKey[0]);
        throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION,
            message);
      }
      sortKeys.add(new SortKey(attrType, ascending, orderingRule));
    }
    return new SortOrder(sortKeys.toArray(new SortKey[0]));
  }
  private void writeValueFromString(ASN1Writer writer) throws IOException
  {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    for(String[] strs : decodedKeyList)
    {
      writer.writeStartSequence();
      // Attr name will always be present
      writer.writeOctetString(strs[0]);
      // Rule ID might not be present
      if(strs[1] != null)
      {
        writer.writeOctetString(TYPE_ORDERING_RULE_ID, strs[1]);
      }
      // Reverse if present
      if(strs[2] != null)
      {
        writer.writeBoolean(TYPE_REVERSE_ORDER, true);
      }
      writer.writeEndSequence();
    }
    writer.writeEndSequence();
    writer.writeEndSequence();
  }
  private void writeValueFromSortOrder(ASN1Writer writer) throws IOException
  {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    for (SortKey sortKey : sortOrder.getSortKeys())
    {
      writer.writeStartSequence();
      writer.writeOctetString(sortKey.getAttributeType().getNameOrOID());
      if (sortKey.getOrderingRule() != null)
      {
        writer.writeOctetString(TYPE_ORDERING_RULE_ID,
            sortKey.getOrderingRule().getNameOrOID());
      }
      if (! sortKey.ascending())
      {
        writer.writeBoolean(TYPE_REVERSE_ORDER, true);
      }
      writer.writeEndSequence();
    }
    writer.writeEndSequence();
    writer.writeEndSequence();
  }
}
opendj-sdk/opends/src/server/org/opends/server/controls/ServerSideSortResponseControl.java
@@ -28,16 +28,15 @@
import org.opends.messages.Message;
import java.io.IOException;
import java.util.ArrayList;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Enumerated;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ByteString;
import org.opends.server.types.ResultCode;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
@@ -79,6 +78,63 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<ServerSideSortResponseControl>
  {
    /**
     * {@inheritDoc}
     */
    public ServerSideSortResponseControl decode(boolean isCritical,
                                                ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = INFO_SORTRES_CONTROL_NO_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        reader.readStartSequence();
        int resultCode = (int)reader.readInteger();
        String attributeType = null;
        if(reader.hasNextElement())
        {
          attributeType = reader.readOctetStringAsString();
        }
        return new ServerSideSortResponseControl(isCritical,
            resultCode,
            attributeType);
      }
      catch (Exception e)
      {
        Message message =
            INFO_SORTRES_CONTROL_CANNOT_DECODE_VALUE.get(
                getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
    }
    public String getOID()
    {
      return OID_SERVER_SIDE_SORT_RESPONSE_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<ServerSideSortResponseControl> DECODER =
    new Decoder();
  /**
   * The BER type to use when encoding the attribute type element.
   */
  private static final byte TYPE_ATTRIBUTE_TYPE = (byte) 0x80;
@@ -103,11 +159,7 @@
   */
  public ServerSideSortResponseControl(int resultCode, String attributeType)
  {
    super(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL, false,
          encodeControlValue(resultCode, attributeType));
    this.resultCode    = resultCode;
    this.attributeType = attributeType;
    this(false, resultCode, attributeType);
  }
@@ -116,19 +168,16 @@
   * Creates a new server-side sort response control with the provided
   * information.
   *
   * @param  oid            The OID to use for this control.
   * @param  isCritical     Indicates whether support for this control should be
   *                        considered a critical part of the server processing.
   * @param  controlValue   The encoded value for this control.
   * @param  resultCode     The result code for the sort result.
   * @param  attributeType  The attribute type for the sort result.
   */
  private ServerSideSortResponseControl(String oid, boolean isCritical,
                                        ASN1OctetString controlValue,
  public ServerSideSortResponseControl(boolean isCritical,
                                        int resultCode,
                                        String attributeType)
  {
    super(oid, isCritical, controlValue);
    super(OID_SERVER_SIDE_SORT_RESPONSE_CONTROL, isCritical);
    this.resultCode    = resultCode;
    this.attributeType = attributeType;
@@ -162,93 +211,25 @@
  /**
   * Encodes the provided set of result codes and attribute types in a manner
   * suitable for use as the value of this control.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  resultCode     The result code for the sort result.
   * @param  attributeType  The attribute type for the sort result, or
   *                        {@code null} if there is none.
   *
   * @return  The ASN.1 octet string containing the encoded sort result.
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private static ASN1OctetString encodeControlValue(int resultCode,
                                                    String attributeType)
  {
    ArrayList<ASN1Element> elements = new ArrayList<ASN1Element>(2);
    elements.add(new ASN1Enumerated(resultCode));
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    writer.writeInteger(resultCode);
    if (attributeType != null)
    {
      elements.add(new ASN1OctetString(TYPE_ATTRIBUTE_TYPE, attributeType));
      writer.writeOctetString(TYPE_ATTRIBUTE_TYPE, attributeType);
    }
    writer.writeEndSequence();
    return new ASN1OctetString(new ASN1Sequence(elements).encode());
  }
  /**
   * Creates a new server-side sort response control from the contents of the
   * provided control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this server-side sort response control.  It must
   *                  not be {@code null}.
   *
   * @return  The server-side sort response control decoded from the provided
   *          control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid
   *                         server-side sort response control.
   */
  public static ServerSideSortResponseControl decodeControl(Control control)
         throws LDAPException
  {
    ASN1OctetString controlValue = control.getValue();
    if (controlValue == null)
    {
      Message message = INFO_SORTRES_CONTROL_NO_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    try
    {
      ArrayList<ASN1Element> elements =
           ASN1Sequence.decodeAsSequence(control.getValue().value()).elements();
      int resultCode = elements.get(0).decodeAsEnumerated().intValue();
      String attributeType = null;
      if (elements.size() > 1)
      {
        attributeType = elements.get(1).decodeAsOctetString().stringValue();
      }
      return new ServerSideSortResponseControl(control.getOID(),
                                               control.isCritical(),
                                               control.getValue(), resultCode,
                                               attributeType);
    }
    catch (Exception e)
    {
      Message message =
          INFO_SORTRES_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
  }
  /**
   * Retrieves a string representation of this server-side sort response
   * control.
   *
   * @return  A string representation of this server-side sort response control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
    writer.writeEndSequence();
  }
@@ -259,6 +240,7 @@
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("ServerSideSortResponseControl(resultCode=");
opendj-sdk/opends/src/server/org/opends/server/controls/SubtreeDeleteControl.java
@@ -26,21 +26,103 @@
 */
package org.opends.server.controls;
import org.opends.server.types.Control;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
import java.io.IOException;
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.types.ByteString;
import org.opends.server.types.Control;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ResultCode;
/**
 * This class implements the subtree delete control.
 * This class implements the subtree delete control defined in
 * draft-armijo-ldap-treedelete. It makes it possible for clients to
 * delete subtrees of entries.
 */
public class SubtreeDeleteControl extends Control
{
  /**
   * Creates a new instance of Subtree Delete control with the
   * default settings.
   * ControlDecoder implementation to decode this control from a
   * ByteString.
   */
  public SubtreeDeleteControl()
  private final static class Decoder implements
      ControlDecoder<SubtreeDeleteControl>
  {
    super(OID_SUBTREE_DELETE_CONTROL, false);
    /**
     * {@inheritDoc}
     */
    public SubtreeDeleteControl decode(boolean isCritical,
        ByteString value) throws DirectoryException
    {
      if (value != null)
      {
        Message message =
            ERR_SUBTREE_DELETE_INVALID_CONTROL_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      return new SubtreeDeleteControl(isCritical);
    }
    public String getOID()
    {
      return OID_SUBTREE_DELETE_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<SubtreeDeleteControl> DECODER =
      new Decoder();
  /**
   * Creates a new subtree delete control.
   *
   * @param isCritical
   *          Indicates whether the control should be considered
   *          critical for the operation processing.
   */
  public SubtreeDeleteControl(boolean isCritical)
  {
    super(OID_SUBTREE_DELETE_CONTROL, isCritical);
  }
  /**
   * {@inheritDoc}
   */
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException
  {
    // Nothing to do.
  }
  /**
   * {@inheritDoc}
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("SubtreeDeleteControl()");
  }
}
opendj-sdk/opends/src/server/org/opends/server/controls/VLVRequestControl.java
@@ -28,17 +28,15 @@
import org.opends.messages.Message;
import java.io.IOException;
import java.util.ArrayList;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.ByteString;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ByteString;
import org.opends.server.types.ResultCode;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
@@ -67,6 +65,95 @@
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<VLVRequestControl>
  {
    /**
     * {@inheritDoc}
     */
    public VLVRequestControl decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = INFO_VLVREQ_CONTROL_NO_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        reader.readStartSequence();
        int beforeCount = (int)reader.readInteger();
        int afterCount  = (int)reader.readInteger();
        int offset = 0;
        int contentCount = 0;
        ByteString greaterThanOrEqual = null;
        byte targetType = reader.peekType();
        switch (targetType)
        {
          case TYPE_TARGET_BYOFFSET:
            reader.readStartSequence();
            offset = (int)reader.readInteger();
            contentCount = (int)reader.readInteger();
            reader.readEndSequence();
            break;
          case TYPE_TARGET_GREATERTHANOREQUAL:
            greaterThanOrEqual = reader.readOctetString();
            break;
          default:
            Message message = INFO_VLVREQ_CONTROL_INVALID_TARGET_TYPE.get(
                byteToHex(targetType));
            throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
        }
        ByteString contextID = null;
        if (reader.hasNextElement())
        {
          contextID = reader.readOctetString();
        }
        if(targetType == TYPE_TARGET_BYOFFSET)
        {
          return new VLVRequestControl(isCritical, beforeCount,
              afterCount, offset, contentCount, contextID);
        }
        return new VLVRequestControl(isCritical, beforeCount,
            afterCount, greaterThanOrEqual, contextID);
      }
      catch (DirectoryException de)
      {
        throw de;
      }
      catch (Exception e)
      {
        Message message =
            INFO_VLVREQ_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
    }
    public String getOID()
    {
      return OID_VLV_REQUEST_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<VLVRequestControl> DECODER =
    new Decoder();
  /**
   * The BER type to use when encoding the byOffset target element.
   */
  public static final byte TYPE_TARGET_BYOFFSET = (byte) 0xA0;
@@ -119,7 +206,7 @@
  public VLVRequestControl(int beforeCount, int afterCount, int offset,
                           int contentCount)
  {
    this(beforeCount, afterCount, offset, contentCount, null);
    this(false, beforeCount, afterCount, offset, contentCount, null);
  }
@@ -127,6 +214,7 @@
  /**
   * Creates a new VLV request control with the provided information.
   *
   * @param  isCritical    Indicates whether or not the control is critical.
   * @param  beforeCount   The number of entries before the target offset to
   *                       retrieve in the results page.
   * @param  afterCount    The number of entries after the target offset to
@@ -142,12 +230,10 @@
   *                       the server did not include a context ID in the
   *                       last response.
   */
  public VLVRequestControl(int beforeCount, int afterCount, int offset,
                           int contentCount, ByteString contextID)
  public VLVRequestControl(boolean isCritical, int beforeCount, int afterCount,
                           int offset, int contentCount, ByteString contextID)
  {
    super(OID_VLV_REQUEST_CONTROL, false,
          encodeControlValue(beforeCount, afterCount, offset, contentCount,
                             contextID));
    super(OID_VLV_REQUEST_CONTROL, isCritical);
    this.beforeCount  = beforeCount;
    this.afterCount   = afterCount;
@@ -174,7 +260,7 @@
  public VLVRequestControl(int beforeCount, int afterCount,
                           ByteString greaterThanOrEqual)
  {
    this(beforeCount, afterCount, greaterThanOrEqual, null);
    this(false, beforeCount, afterCount, greaterThanOrEqual, null);
  }
@@ -182,6 +268,8 @@
  /**
   * Creates a new VLV request control with the provided information.
   *
   * @param  isCritical          Indicates whether the control should be
   *                             considered critical.
   * @param  beforeCount         The number of entries before the target
   *                             assertion value.
   * @param  afterCount          The number of entries after the target
@@ -195,13 +283,11 @@
   *                             response or the server did not include a
   *                             context ID in the last response.
   */
  public VLVRequestControl(int beforeCount, int afterCount,
  public VLVRequestControl(boolean isCritical, int beforeCount, int afterCount,
                           ByteString greaterThanOrEqual,
                           ByteString contextID)
  {
    super(OID_VLV_REQUEST_CONTROL, false,
          encodeControlValue(beforeCount, afterCount, greaterThanOrEqual,
                             contextID));
    super(OID_VLV_REQUEST_CONTROL, isCritical);
    this.beforeCount        = beforeCount;
    this.afterCount         = afterCount;
@@ -214,46 +300,6 @@
  /**
   * Creates a new VLV request control with the provided information.
   *
   * @param  oid                 The OID for the control.
   * @param  isCritical          Indicates whether the control should be
   *                             considered critical.
   * @param  controlValue        The pre-encoded value for the control.
   * @param  beforeCount         The number of entries before the target
   *                             assertion value.
   * @param  afterCount          The number of entries after the target
   *                             assertion value.
   * @param  greaterThanOrEqual  The greaterThanOrEqual target assertion value
   *                             that indicates where to start the page of
   *                             results.
   * @param  contextID           The context ID provided by the server in the
   *                             last VLV response for the same set of criteria,
   *                             or {@code null} if there was no previous VLV
   *                             response or the server did not include a
   *                             context ID in the last response.
   */
  private VLVRequestControl(String oid, boolean isCritical,
                            ASN1OctetString controlValue, int beforeCount,
                            int afterCount, byte targetType,
                            int offset, int contentCount,
                            ByteString greaterThanOrEqual,
                            ByteString contextID)
  {
    super(oid, isCritical, controlValue);
    this.beforeCount        = beforeCount;
    this.afterCount         = afterCount;
    this.targetType         = targetType;
    this.offset             = offset;
    this.contentCount       = contentCount;
    this.greaterThanOrEqual = greaterThanOrEqual;
    this.contextID          = contextID;
  }
  /**
   * Retrieves the number of entries before the target offset or assertion value
   * to include in the results page.
   *
@@ -358,188 +404,38 @@
  /**
   * Encodes the provided information in a manner suitable for use as the value
   * of this control.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  beforeCount   The number of entries before the target offset to
   *                       retrieve in the results page.
   * @param  afterCount    The number of entries after the target offset to
   *                       retrieve in the results page.
   * @param  offset        The offset in the result set to target for the
   *                       beginning of the page of results.
   * @param  contentCount  The content count returned by the server in the last
   *                       phase of the VLV request, or zero for a new VLV
   *                       request session.
   * @param  contextID     The context ID provided by the server in the last
   *                       VLV response for the same set of criteria, or
   *                       {@code null} if there was no previous VLV response or
   *                       the server did not include a context ID in the
   *                       last response.
   *
   * @return  The ASN.1 octet string containing the encoded sort order.
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private static ASN1OctetString encodeControlValue(int beforeCount,
                                      int afterCount, int offset,
                                      int contentCount, ByteString contextID)
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    writer.writeInteger(beforeCount);
    writer.writeInteger(afterCount);
    if(targetType == TYPE_TARGET_BYOFFSET)
  {
    ArrayList<ASN1Element> vlvElements = new ArrayList<ASN1Element>(4);
    vlvElements.add(new ASN1Integer(beforeCount));
    vlvElements.add(new ASN1Integer(afterCount));
    ArrayList<ASN1Element> targetElements = new ArrayList<ASN1Element>(2);
    targetElements.add(new ASN1Integer(offset));
    targetElements.add(new ASN1Integer(contentCount));
    vlvElements.add(new ASN1Sequence(TYPE_TARGET_BYOFFSET, targetElements));
      writer.writeStartSequence(TYPE_TARGET_BYOFFSET);
      writer.writeInteger(offset);
      writer.writeInteger(contentCount);
      writer.writeEndSequence();
    }
    else
    {
      writer.writeOctetString(TYPE_TARGET_GREATERTHANOREQUAL,
          greaterThanOrEqual);
    }
    if (contextID != null)
    {
      vlvElements.add(contextID.toASN1OctetString());
      writer.writeOctetString(contextID);
    }
    writer.writeEndSequence();
    return new ASN1OctetString(new ASN1Sequence(vlvElements).encode());
  }
  /**
   * Encodes the provided information in a manner suitable for use as the value
   * of this control.
   *
   * @param  beforeCount         The number of entries before the target
   *                             assertion value.
   * @param  afterCount          The number of entries after the target
   *                             assertion value.
   * @param  greaterThanOrEqual  The greaterThanOrEqual target assertion value
   *                             that indicates where to start the page of
   *                             results.
   * @param  contextID           The context ID provided by the server in the
   *                             last VLV response for the same set of criteria,
   *                             or {@code null} if there was no previous VLV
   *                             response or the server did not include a
   *                             context ID in the last response.
   *
   * @return  The ASN.1 octet string containing the encoded sort order.
   */
  private static ASN1OctetString encodeControlValue(int beforeCount,
                                      int afterCount,
                                      ByteString greaterThanOrEqual,
                                      ByteString contextID)
  {
    ArrayList<ASN1Element> vlvElements = new ArrayList<ASN1Element>(4);
    vlvElements.add(new ASN1Integer(beforeCount));
    vlvElements.add(new ASN1Integer(afterCount));
    vlvElements.add(new ASN1OctetString(TYPE_TARGET_GREATERTHANOREQUAL,
                                        greaterThanOrEqual.value()));
    if (contextID != null)
    {
      vlvElements.add(contextID.toASN1OctetString());
    }
    return new ASN1OctetString(new ASN1Sequence(vlvElements).encode());
  }
  /**
   * Creates a new VLV request control from the contents of the provided
   * control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this VLV request control.  It must not be
   *                  {@code null}.
   *
   * @return  The VLV request control decoded from the provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid VLV
   *                         request control.
   */
  public static VLVRequestControl decodeControl(Control control)
         throws LDAPException
  {
    ASN1OctetString controlValue = control.getValue();
    if (controlValue == null)
    {
      Message message = INFO_VLVREQ_CONTROL_NO_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    try
    {
      ASN1Sequence vlvSequence =
           ASN1Sequence.decodeAsSequence(controlValue.value());
      ArrayList<ASN1Element> elements = vlvSequence.elements();
      if ((elements.size() < 3) || (elements.size() > 4))
      {
        Message message =
            INFO_VLVREQ_CONTROL_INVALID_ELEMENT_COUNT.get(elements.size());
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      int beforeCount = elements.get(0).decodeAsInteger().intValue();
      int afterCount  = elements.get(1).decodeAsInteger().intValue();
      ASN1Element targetElement = elements.get(2);
      int offset = 0;
      int contentCount = 0;
      ASN1OctetString greaterThanOrEqual = null;
      byte targetType = targetElement.getType();
      switch (targetType)
      {
        case TYPE_TARGET_BYOFFSET:
          ArrayList<ASN1Element> targetElements =
               targetElement.decodeAsSequence().elements();
          offset = targetElements.get(0).decodeAsInteger().intValue();
          contentCount = targetElements.get(1).decodeAsInteger().intValue();
          break;
        case TYPE_TARGET_GREATERTHANOREQUAL:
          greaterThanOrEqual = targetElement.decodeAsOctetString();
          break;
        default:
          Message message = INFO_VLVREQ_CONTROL_INVALID_TARGET_TYPE.get(
              byteToHex(targetType));
          throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      ASN1OctetString contextID = null;
      if (elements.size() == 4)
      {
        contextID = elements.get(3).decodeAsOctetString();
      }
      return new VLVRequestControl(control.getOID(), control.isCritical(),
                                   controlValue, beforeCount, afterCount,
                                   targetType, offset, contentCount,
                                   greaterThanOrEqual, contextID);
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (Exception e)
    {
      Message message =
          INFO_VLVREQ_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
  }
  /**
   * Retrieves a string representation of this VLV request control.
   *
   * @return  A string representation of this VLV request control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
    writer.writeEndSequence();
  }
@@ -550,6 +446,7 @@
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("VLVRequestControl(beforeCount=");
opendj-sdk/opends/src/server/org/opends/server/controls/VLVResponseControl.java
@@ -28,18 +28,12 @@
import org.opends.messages.Message;
import java.io.IOException;
import java.util.ArrayList;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Enumerated;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.ByteString;
import org.opends.server.types.Control;
import org.opends.server.types.LDAPException;
import org.opends.server.protocols.asn1.*;
import static org.opends.server.protocols.asn1.ASN1Constants.
    UNIVERSAL_OCTET_STRING_TYPE;
import org.opends.server.types.*;
import static org.opends.messages.ProtocolMessages.*;
import static org.opends.server.util.ServerConstants.*;
@@ -75,6 +69,65 @@
public class VLVResponseControl
       extends Control
{
  /**
   * ControlDecoder implentation to decode this control from a ByteString.
   */
  private final static class Decoder
      implements ControlDecoder<VLVResponseControl>
  {
    /**
     * {@inheritDoc}
     */
    public VLVResponseControl decode(boolean isCritical, ByteString value)
        throws DirectoryException
    {
      if (value == null)
      {
        Message message = INFO_VLVRES_CONTROL_NO_VALUE.get();
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message);
      }
      ASN1Reader reader = ASN1.getReader(value);
      try
      {
        reader.readStartSequence();
        int targetPosition = (int)reader.readInteger();
        int contentCount   = (int)reader.readInteger();
        int vlvResultCode  = (int)reader.readInteger();
        ByteString contextID = null;
        if (reader.hasNextElement())
        {
          contextID = reader.readOctetString();
        }
        return new VLVResponseControl(isCritical, targetPosition,
            contentCount, vlvResultCode, contextID);
      }
      catch (Exception e)
      {
        Message message =
            INFO_VLVRES_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
        throw new DirectoryException(ResultCode.PROTOCOL_ERROR, message, e);
      }
    }
    /**
     * {@inheritDoc}
     */
    public String getOID()
    {
      return OID_VLV_RESPONSE_CONTROL;
    }
  }
  /**
   * The Control Decoder that can be used to decode this control.
   */
  public static final ControlDecoder<VLVResponseControl> DECODER =
    new Decoder();
  // The context ID for this VLV response control.
  private ByteString contextID;
@@ -100,7 +153,7 @@
  public VLVResponseControl(int targetPosition, int contentCount,
                            int vlvResultCode)
  {
    this(targetPosition, contentCount, vlvResultCode, null);
    this(false, targetPosition, contentCount, vlvResultCode, null);
  }
@@ -108,46 +161,19 @@
  /**
   * Creates a new VLV response control with the provided information.
   *
   * @param  targetPosition  The position of the target entry in the result set.
   * @param  contentCount    The content count estimating the total number of
   *                         entries in the result set.
   * @param  vlvResultCode   The result code for the VLV operation.
   * @param  contextID       The context ID for this VLV response control.
   */
  public VLVResponseControl(int targetPosition, int contentCount,
                            int vlvResultCode, ByteString contextID)
  {
    super(OID_VLV_RESPONSE_CONTROL, false,
          encodeControlValue(targetPosition, contentCount, vlvResultCode,
                             contextID));
    this.targetPosition = targetPosition;
    this.contentCount   = contentCount;
    this.vlvResultCode  = vlvResultCode;
    this.contextID      = contextID;
  }
  /**
   * Creates a new VLV response control with the provided information.
   *
   * @param  oid             The OID for the control.
   * @param  isCritical      Indicates whether the control should be considered
   *                         critical.
   * @param  controlValue    The pre-encoded value for the control.
   * @param  targetPosition  The position of the target entry in the result set.
   * @param  contentCount    The content count estimating the total number of
   *                         entries in the result set.
   * @param  vlvResultCode   The result code for the VLV operation.
   * @param  contextID       The context ID for this VLV response control.
   */
  private VLVResponseControl(String oid, boolean isCritical,
                             ASN1OctetString controlValue, int targetPosition,
  public VLVResponseControl(boolean isCritical, int targetPosition,
                             int contentCount, int vlvResultCode,
                             ByteString contextID)
  {
    super(oid, isCritical, controlValue);
    super(OID_VLV_RESPONSE_CONTROL, isCritical);
    this.targetPosition = targetPosition;
    this.contentCount   = contentCount;
@@ -209,110 +235,27 @@
  /**
   * Encodes the provided information in a manner suitable for use as the value
   * of this control.
   * Writes this control's value to an ASN.1 writer. The value (if any) must be
   * written as an ASN1OctetString.
   *
   * @param  targetPosition  The position of the target entry in the result set.
   * @param  contentCount    The content count estimating the total number of
   *                         entries in the result set.
   * @param  vlvResultCode   The result code for the VLV operation.
   * @param  contextID       The context ID for this VLV response control.
   *
   * @return  The ASN.1 octet string containing the encoded sort order.
   * @param writer The ASN.1 writer to use.
   * @throws IOException If a problem occurs while writing to the stream.
   */
  private static ASN1OctetString encodeControlValue(int targetPosition,
                                      int contentCount, int vlvResultCode,
                                      ByteString contextID)
  {
    ArrayList<ASN1Element> vlvElements = new ArrayList<ASN1Element>(4);
    vlvElements.add(new ASN1Integer(targetPosition));
    vlvElements.add(new ASN1Integer(contentCount));
    vlvElements.add(new ASN1Enumerated(vlvResultCode));
  @Override
  protected void writeValue(ASN1Writer writer) throws IOException {
    writer.writeStartSequence(UNIVERSAL_OCTET_STRING_TYPE);
    writer.writeStartSequence();
    writer.writeInteger(targetPosition);
    writer.writeInteger(contentCount);
    writer.writeInteger(vlvResultCode);
    if (contextID != null)
    {
      vlvElements.add(contextID.toASN1OctetString());
      writer.writeOctetString(contextID);
    }
    writer.writeEndSequence();
    return new ASN1OctetString(new ASN1Sequence(vlvElements).encode());
  }
  /**
   * Creates a new VLV response control from the contents of the provided
   * control.
   *
   * @param  control  The generic control containing the information to use to
   *                  create this VLV response control.  It must not be
   *                  {@code null}.
   *
   * @return  The VLV response control decoded from the provided control.
   *
   * @throws  LDAPException  If this control cannot be decoded as a valid VLV
   *                         response control.
   */
  public static VLVResponseControl decodeControl(Control control)
         throws LDAPException
  {
    ASN1OctetString controlValue = control.getValue();
    if (controlValue == null)
    {
      Message message = INFO_VLVRES_CONTROL_NO_VALUE.get();
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
    }
    try
    {
      ASN1Sequence vlvSequence =
           ASN1Sequence.decodeAsSequence(controlValue.value());
      ArrayList<ASN1Element> elements = vlvSequence.elements();
      if ((elements.size() < 3) || (elements.size() > 4))
      {
        Message message =
            INFO_VLVRES_CONTROL_INVALID_ELEMENT_COUNT.get(elements.size());
        throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message);
      }
      int targetPosition = elements.get(0).decodeAsInteger().intValue();
      int contentCount   = elements.get(1).decodeAsInteger().intValue();
      int vlvResultCode  = elements.get(2).decodeAsEnumerated().intValue();
      ASN1OctetString contextID = null;
      if (elements.size() == 4)
      {
        contextID = elements.get(3).decodeAsOctetString();
      }
      return new VLVResponseControl(control.getOID(), control.isCritical(),
                                    controlValue, targetPosition, contentCount,
                                    vlvResultCode, contextID);
    }
    catch (LDAPException le)
    {
      throw le;
    }
    catch (Exception e)
    {
      Message message =
          INFO_VLVRES_CONTROL_CANNOT_DECODE_VALUE.get(getExceptionMessage(e));
      throw new LDAPException(LDAPResultCode.PROTOCOL_ERROR, message, e);
    }
  }
  /**
   * Retrieves a string representation of this VLV request control.
   *
   * @return  A string representation of this VLV request control.
   */
  public String toString()
  {
    StringBuilder buffer = new StringBuilder();
    toString(buffer);
    return buffer.toString();
    writer.writeEndSequence();
  }
@@ -323,6 +266,7 @@
   *
   * @param  buffer  The buffer to which the information should be appended.
   */
  @Override
  public void toString(StringBuilder buffer)
  {
    buffer.append("VLVResponseControl(targetPosition=");
opendj-sdk/opends/src/server/org/opends/server/core/AddOperation.java
@@ -29,13 +29,7 @@
import java.util.List;
import java.util.Map;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeType;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.Operation;
import org.opends.server.types.RawAttribute;
import org.opends.server.types.*;
/**
 * This interface defines an operation that may be used to add a new entry to
opendj-sdk/opends/src/server/org/opends/server/core/AddOperationBasis.java
@@ -52,7 +52,6 @@
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.types.*;
import org.opends.server.types.operation.PostResponseAddOperation;
@@ -175,14 +174,14 @@
    this.userAttributes        = userAttributes;
    this.operationalAttributes = operationalAttributes;
    rawEntryDN = new ASN1OctetString(entryDN.toString());
    rawEntryDN = ByteString.valueOf(entryDN.toString());
    rawAttributes = new ArrayList<RawAttribute>();
    ArrayList<ASN1OctetString> ocValues = new ArrayList<ASN1OctetString>();
    ArrayList<ByteString> ocValues = new ArrayList<ByteString>();
    for (String s : objectClasses.values())
    {
      ocValues.add(new ASN1OctetString(s));
      ocValues.add(ByteString.valueOf(s));
    }
    LDAPAttribute ocAttr = new LDAPAttribute(ATTR_OBJECTCLASS, ocValues);
opendj-sdk/opends/src/server/org/opends/server/core/AddOperationWrapper.java
@@ -29,12 +29,7 @@
import java.util.List;
import java.util.Map;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeType;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.RawAttribute;
import org.opends.server.types.*;
/**
opendj-sdk/opends/src/server/org/opends/server/core/BindOperation.java
@@ -27,13 +27,7 @@
package org.opends.server.core;
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.AuthenticationInfo;
import org.opends.server.types.AuthenticationType;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.Operation;
import org.opends.server.types.*;
/**
@@ -132,7 +126,7 @@
   * @return  The SASL credentials for this bind operation, or <CODE>null</CODE>
   *          if there are none or if the bind does not use SASL authentication.
   */
  public abstract ASN1OctetString getSASLCredentials();
  public abstract ByteString getSASLCredentials();
  /**
   * Specifies the SASL credentials for this bind operation.
@@ -142,7 +136,7 @@
   *                          <CODE>null</CODE> if there are none.
   */
  public abstract void setSASLCredentials(String saslMechanism,
      ASN1OctetString saslCredentials);
      ByteString saslCredentials);
  /**
   * Retrieves the set of server SASL credentials to include in the bind
@@ -151,7 +145,7 @@
   * @return  The set of server SASL credentials to include in the bind
   *          response, or <CODE>null</CODE> if there are none.
   */
  public abstract ASN1OctetString getServerSASLCredentials();
  public abstract ByteString getServerSASLCredentials();
  /**
   * Specifies the set of server SASL credentials to include in the bind
@@ -161,7 +155,7 @@
   *                                include in the bind response.
   */
  public abstract void setServerSASLCredentials(
      ASN1OctetString serverSASLCredentials);
      ByteString serverSASLCredentials);
  /**
   * Retrieves the user entry associated with the SASL authentication attempt.
opendj-sdk/opends/src/server/org/opends/server/core/BindOperationBasis.java
@@ -52,14 +52,11 @@
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.*;
import org.opends.server.types.operation.PreParseBindOperation;
import org.opends.server.workflowelement.localbackend.*;
/**
 * This class defines an operation that may be used to authenticate a user to
 * the Directory Server.  Note that for security restrictions, response messages
@@ -80,10 +77,10 @@
  private static final DebugTracer TRACER = DebugLogger.getTracer();
  // The credentials used for SASL authentication.
  private ASN1OctetString saslCredentials;
  private ByteString saslCredentials;
  // The server SASL credentials provided to the client in the response.
  private ASN1OctetString serverSASLCredentials;
  private ByteString serverSASLCredentials;
  // The authentication info for this bind operation.
  private AuthenticationInfo authInfo = null;
@@ -151,7 +148,7 @@
    if (rawBindDN == null)
    {
      this.rawBindDN = new ASN1OctetString();
      this.rawBindDN = ByteString.empty();
    }
    else
    {
@@ -160,7 +157,7 @@
    if (simplePassword == null)
    {
      this.simplePassword = new ASN1OctetString();
      this.simplePassword = ByteString.empty();
    }
    else
    {
@@ -199,7 +196,7 @@
  public BindOperationBasis(ClientConnection clientConnection, long operationID,
                       int messageID, List<Control> requestControls,
                       String protocolVersion, ByteString rawBindDN,
                       String saslMechanism, ASN1OctetString saslCredentials)
                       String saslMechanism, ByteString saslCredentials)
  {
    super(clientConnection, operationID, messageID, requestControls);
@@ -212,7 +209,7 @@
    if (rawBindDN == null)
    {
      this.rawBindDN = new ASN1OctetString();
      this.rawBindDN = ByteString.empty();
    }
    else
    {
@@ -262,16 +259,16 @@
    if (bindDN == null)
    {
      rawBindDN = new ASN1OctetString();
      rawBindDN = ByteString.empty();
    }
    else
    {
      rawBindDN = new ASN1OctetString(bindDN.toString());
      rawBindDN = ByteString.valueOf(bindDN.toString());
    }
    if (simplePassword == null)
    {
      this.simplePassword = new ASN1OctetString();
      this.simplePassword = ByteString.empty();
    }
    else
    {
@@ -308,7 +305,7 @@
  public BindOperationBasis(ClientConnection clientConnection, long operationID,
                       int messageID, List<Control> requestControls,
                       String protocolVersion, DN bindDN,
                       String saslMechanism, ASN1OctetString saslCredentials)
                       String saslMechanism, ByteString saslCredentials)
  {
    super(clientConnection, operationID, messageID, requestControls);
@@ -322,11 +319,11 @@
    if (bindDN == null)
    {
      rawBindDN = new ASN1OctetString();
      rawBindDN = ByteString.empty();
    }
    else
    {
      rawBindDN = new ASN1OctetString(bindDN.toString());
      rawBindDN = ByteString.valueOf(bindDN.toString());
    }
    responseControls       = new ArrayList<Control>(0);
@@ -363,7 +360,7 @@
  {
    if (rawBindDN == null)
    {
      this.rawBindDN = new ASN1OctetString();
      this.rawBindDN = ByteString.empty();
    }
    else
    {
@@ -414,7 +411,7 @@
  {
    if (simplePassword == null)
    {
      this.simplePassword = new ASN1OctetString();
      this.simplePassword = ByteString.empty();
    }
    else
    {
@@ -437,7 +434,7 @@
  /**
   * {@inheritDoc}
   */
  public final ASN1OctetString getSASLCredentials()
  public final ByteString getSASLCredentials()
  {
    return saslCredentials;
  }
@@ -446,7 +443,7 @@
   * {@inheritDoc}
   */
  public final void setSASLCredentials(String saslMechanism,
                                       ASN1OctetString saslCredentials)
                                       ByteString saslCredentials)
  {
    this.saslMechanism   = saslMechanism;
    this.saslCredentials = saslCredentials;
@@ -458,7 +455,7 @@
  /**
   * {@inheritDoc}
   */
  public final ASN1OctetString getServerSASLCredentials()
  public final ByteString getServerSASLCredentials()
  {
    return serverSASLCredentials;
  }
@@ -466,7 +463,7 @@
  /**
   * {@inheritDoc}
   */
  public final void setServerSASLCredentials(ASN1OctetString
  public final void setServerSASLCredentials(ByteString
                                                  serverSASLCredentials)
  {
    this.serverSASLCredentials = serverSASLCredentials;
opendj-sdk/opends/src/server/org/opends/server/core/BindOperationWrapper.java
@@ -28,13 +28,7 @@
import org.opends.messages.Message;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.AuthenticationInfo;
import org.opends.server.types.AuthenticationType;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.*;
/**
@@ -110,7 +104,7 @@
  /**
   * {@inheritDoc}
   */
  public ASN1OctetString getSASLCredentials()
  public ByteString getSASLCredentials()
  {
    return bind.getSASLCredentials();
  }
@@ -126,7 +120,7 @@
  /**
   * {@inheritDoc}
   */
  public ASN1OctetString getServerSASLCredentials()
  public ByteString getServerSASLCredentials()
  {
    return bind.getServerSASLCredentials();
  }
@@ -190,7 +184,7 @@
   * {@inheritDoc}
   */
  public void setSASLCredentials(String saslMechanism,
      ASN1OctetString saslCredentials)
      ByteString saslCredentials)
  {
    bind.setSASLCredentials(saslMechanism, saslCredentials);
  }
@@ -198,7 +192,7 @@
  /**
   * {@inheritDoc}
   */
  public void setServerSASLCredentials(ASN1OctetString serverSASLCredentials)
  public void setServerSASLCredentials(ByteString serverSASLCredentials)
  {
    bind.setServerSASLCredentials(serverSASLCredentials);
  }
opendj-sdk/opends/src/server/org/opends/server/core/CompareOperation.java
@@ -26,10 +26,7 @@
 */
package org.opends.server.core;
import org.opends.server.types.AttributeType;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.Operation;
import org.opends.server.types.*;
/**
opendj-sdk/opends/src/server/org/opends/server/core/CompareOperationBasis.java
@@ -41,7 +41,6 @@
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.*;
import org.opends.server.types.operation.PostResponseCompareOperation;
import org.opends.server.types.operation.PreParseCompareOperation;
@@ -151,7 +150,7 @@
    this.assertionValue = assertionValue;
    responseControls       = new ArrayList<Control>();
    rawEntryDN             = new ASN1OctetString(entryDN.toString());
    rawEntryDN             = ByteString.valueOf(entryDN.toString());
    rawAttributeType       = attributeType.getNameOrOID();
    cancelRequest          = null;
    proxiedAuthorizationDN = null;
opendj-sdk/opends/src/server/org/opends/server/core/DefaultCompressedSchema.java
@@ -31,7 +31,6 @@
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.Map;
@@ -42,21 +41,10 @@
import org.opends.messages.Message;
import org.opends.server.api.CompressedSchema;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1Element;
import org.opends.server.protocols.asn1.ASN1Integer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.asn1.ASN1Reader;
import org.opends.server.protocols.asn1.ASN1Sequence;
import org.opends.server.protocols.asn1.ASN1;
import org.opends.server.protocols.asn1.ASN1Writer;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.Attributes;
import org.opends.server.types.ByteArray;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.ObjectClass;
import org.opends.server.types.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
@@ -87,21 +75,22 @@
  private AtomicInteger ocCounter;
  // The map between encoded representations and attribute types.
  private ConcurrentHashMap<ByteArray,AttributeType> atDecodeMap;
  private ConcurrentHashMap<ByteSequence,AttributeType> atDecodeMap;
  // The map between encoded representations and attribute options.
  private ConcurrentHashMap<ByteArray,Set<String>> aoDecodeMap;
  private ConcurrentHashMap<ByteSequence,Set<String>> aoDecodeMap;
  // The map between encoded representations and object class sets.
  private ConcurrentHashMap<ByteArray,Map<ObjectClass,String>> ocDecodeMap;
  private ConcurrentHashMap<ByteSequence,Map<ObjectClass,String>> ocDecodeMap;
  // The map between attribute descriptions and their encoded
  // representations.
  private ConcurrentHashMap<AttributeType,
               ConcurrentHashMap<Set<String>,ByteArray>> adEncodeMap;
  private final ConcurrentHashMap<AttributeType,
                ConcurrentHashMap<Set<String>, ByteSequence>> adEncodeMap;
  // The map between object class sets and encoded representations.
  private ConcurrentHashMap<Map<ObjectClass,String>,ByteArray> ocEncodeMap;
  private final ConcurrentHashMap<Map<ObjectClass,String>,
      ByteSequence> ocEncodeMap;
@@ -110,12 +99,14 @@
   */
  public DefaultCompressedSchema()
  {
    atDecodeMap = new ConcurrentHashMap<ByteArray, AttributeType>();
    aoDecodeMap = new ConcurrentHashMap<ByteArray, Set<String>>();
    ocDecodeMap = new ConcurrentHashMap<ByteArray, Map<ObjectClass, String>>();
    atDecodeMap = new ConcurrentHashMap<ByteSequence, AttributeType>();
    aoDecodeMap = new ConcurrentHashMap<ByteSequence, Set<String>>();
    ocDecodeMap =
        new ConcurrentHashMap<ByteSequence, Map<ObjectClass, String>>();
    adEncodeMap = new ConcurrentHashMap
      <AttributeType, ConcurrentHashMap<Set<String>, ByteArray>>();
    ocEncodeMap = new ConcurrentHashMap<Map<ObjectClass, String>, ByteArray>();
      <AttributeType, ConcurrentHashMap<Set<String>, ByteSequence>>();
    ocEncodeMap = new ConcurrentHashMap<Map<ObjectClass, String>,
        ByteSequence>();
    adCounter = new AtomicInteger(1);
    ocCounter = new AtomicInteger(1);
@@ -130,7 +121,7 @@
   */
  private void load()
  {
    ASN1Reader reader = null;
    FileInputStream inputStream = null;
    try
    {
@@ -144,41 +135,40 @@
      {
        return;
      }
      FileInputStream inputStream = new FileInputStream(path);
      reader = new ASN1Reader(inputStream);
      inputStream = new FileInputStream(path);
      ASN1Reader reader = ASN1.getReader(inputStream);
      // The first element in the file should be a sequence of object class
      // sets.  Each object class set will itself be a sequence of octet
      // strings, where the first one is the token and the remaining elements
      // are the names of the associated object classes.
      ASN1Sequence ocSequence = reader.readElement().decodeAsSequence();
      for (ASN1Element element : ocSequence.elements())
      reader.readStartSequence();
      while(reader.hasNextElement())
      {
        ArrayList<ASN1Element> elements = element.decodeAsSequence().elements();
        ASN1OctetString os = elements.get(0).decodeAsOctetString();
        ByteArray token = new ByteArray(os.value());
        reader.readStartSequence();
        ByteSequence token = reader.readOctetString();
        LinkedHashMap<ObjectClass,String> ocMap =
             new LinkedHashMap<ObjectClass,String>(elements.size()-1);
        for (int i=1; i < elements.size(); i++)
             new LinkedHashMap<ObjectClass,String>();
        while(reader.hasNextElement())
        {
          os = elements.get(i).decodeAsOctetString();
          String ocName = os.stringValue();
          String ocName = reader.readOctetStringAsString();
          String lowerName = toLowerCase(ocName);
          ObjectClass oc = DirectoryServer.getObjectClass(lowerName, true);
          ocMap.put(oc, ocName);
        }
        reader.readEndSequence();
        ocEncodeMap.put(ocMap, token);
        ocDecodeMap.put(token, ocMap);
      }
      reader.readEndSequence();
      // The second element in the file should be an integer element that holds
      // the value to use to initialize the object class counter.
      ASN1Element counterElement = reader.readElement();
      ocCounter.set(counterElement.decodeAsInteger().intValue());
      ocCounter.set((int)reader.readInteger());
      // The third element in the file should be a sequence of attribute
@@ -186,35 +176,32 @@
      // itself be a sequence of octet strings, where the first one is the
      // token, the second is the attribute name, and all remaining elements are
      // the attribute options.
      ASN1Sequence adSequence = reader.readElement().decodeAsSequence();
      for (ASN1Element element : adSequence.elements())
      reader.readStartSequence();
      while(reader.hasNextElement())
      {
        ArrayList<ASN1Element> elements = element.decodeAsSequence().elements();
        ASN1OctetString os = elements. get(0).decodeAsOctetString();
        ByteArray token = new ByteArray(os.value());
        os = elements.get(1).decodeAsOctetString();
        String attrName = os.stringValue();
        reader.readStartSequence();
        ByteSequence token = reader.readOctetString();
        String attrName = reader.readOctetStringAsString();
        String lowerName = toLowerCase(attrName);
        AttributeType attrType =
             DirectoryServer.getAttributeType(lowerName, true);
        LinkedHashSet<String> options =
             new LinkedHashSet<String>(elements.size()-2);
        for (int i=2; i < elements.size(); i++)
            new LinkedHashSet<String>();
        while(reader.hasNextElement())
        {
          os = elements.get(i).decodeAsOctetString();
          options.add(os.stringValue());
          options.add(reader.readOctetStringAsString());
        }
        reader.readEndSequence();
        atDecodeMap.put(token, attrType);
        aoDecodeMap.put(token, options);
        ConcurrentHashMap<Set<String>, ByteArray> map = adEncodeMap
        ConcurrentHashMap<Set<String>, ByteSequence> map = adEncodeMap
            .get(attrType);
        if (map == null)
        {
          map = new ConcurrentHashMap<Set<String>, ByteArray>(1);
          map = new ConcurrentHashMap<Set<String>, ByteSequence>(1);
          map.put(options, token);
          adEncodeMap.put(attrType, map);
        }
@@ -223,12 +210,12 @@
          map.put(options, token);
        }
      }
      reader.readEndSequence();
      // The fourth element in the file should be an integer element that holds
      // the value to use to initialize the attribute description counter.
      counterElement = reader.readElement();
      adCounter.set(counterElement.decodeAsInteger().intValue());
      adCounter.set((int)reader.readInteger());
    }
    catch (Exception e)
    {
@@ -244,9 +231,9 @@
    {
      try
      {
        if (reader != null)
        if (inputStream != null)
        {
          reader.close();
          inputStream.close();
        }
      }
      catch (Exception e)
@@ -270,7 +257,7 @@
  private void save()
          throws DirectoryException
  {
    ASN1Writer writer = null;
    FileOutputStream outputStream = null;
    try
    {
      // Determine the location of the "live" compressed schema data file, and
@@ -281,39 +268,34 @@
                    COMPRESSED_SCHEMA_FILE_NAME;
      String tempPath = path + ".tmp";
      FileOutputStream outputStream = new FileOutputStream(tempPath);
      writer = new ASN1Writer(outputStream);
      outputStream = new FileOutputStream(tempPath);
      ASN1Writer writer = ASN1.getWriter(outputStream);
      // The first element in the file should be a sequence of object class
      // sets.  Each object class set will itself be a sequence of octet
      // strings, where the first one is the token and the remaining elements
      // are the names of the associated object classes.
      ArrayList<ASN1Element> ocElements =
           new ArrayList<ASN1Element>(ocDecodeMap.size());
      for (Map.Entry<ByteArray,Map<ObjectClass,String>> mapEntry :
      writer.writeStartSequence();
      for (Map.Entry<ByteSequence,Map<ObjectClass,String>> mapEntry :
           ocDecodeMap.entrySet())
      {
        ByteArray token = mapEntry.getKey();
        writer.writeStartSequence();
        writer.writeOctetString(mapEntry.getKey());
        Map<ObjectClass,String> ocMap = mapEntry.getValue();
        ArrayList<ASN1Element> elements =
             new ArrayList<ASN1Element>(ocMap.size()+1);
        elements.add(new ASN1OctetString(token.array()));
        for (String ocName : ocMap.values())
        {
          elements.add(new ASN1OctetString(ocName));
          writer.writeOctetString(ocName);
        }
        ocElements.add(new ASN1Sequence(elements));
        writer.writeEndSequence();
      }
      writer.writeElement(new ASN1Sequence(ocElements));
      writer.writeEndSequence();
      // The second element in the file should be an integer element that holds
      // the value to use to initialize the object class counter.
      writer.writeElement(new ASN1Integer(ocCounter.get()));
      writer.writeInteger(ocCounter.get());
      // The third element in the file should be a sequence of attribute
@@ -321,34 +303,31 @@
      // itself be a sequence of octet strings, where the first one is the
      // token, the second is the attribute name, and all remaining elements are
      // the attribute options.
      ArrayList<ASN1Element> adElements =
           new ArrayList<ASN1Element>(atDecodeMap.size());
      for (ByteArray token : atDecodeMap.keySet())
      writer.writeStartSequence();
      for (ByteSequence token : atDecodeMap.keySet())
      {
        writer.writeStartSequence();
        AttributeType attrType = atDecodeMap.get(token);
        Set<String> options = aoDecodeMap.get(token);
        ArrayList<ASN1Element> elements =
             new ArrayList<ASN1Element>(options.size()+2);
        elements.add(new ASN1OctetString(token.array()));
        elements.add(new ASN1OctetString(attrType.getNameOrOID()));
        writer.writeOctetString(token);
        writer.writeOctetString(attrType.getNameOrOID());
        for (String option : options)
        {
          elements.add(new ASN1OctetString(option));
          writer.writeOctetString(option);
        }
        adElements.add(new ASN1Sequence(elements));
        writer.writeEndSequence();
      }
      writer.writeElement(new ASN1Sequence(adElements));
      writer.writeEndSequence();
      // The fourth element in the file should be an integer element that holds
      // the value to use to initialize the attribute description counter.
      writer.writeElement(new ASN1Integer(adCounter.get()));
      writer.writeInteger(adCounter.get());
      // Close the writer and swing the temp file into place.
      writer.close();
      outputStream.close();
      File liveFile = new File(path);
      File tempFile = new File(tempPath);
@@ -379,9 +358,9 @@
    {
      try
      {
        if (writer != null)
        if (outputStream != null)
        {
          writer.close();
          outputStream.close();
        }
      }
      catch (Exception e)
@@ -400,29 +379,27 @@
   * {@inheritDoc}
   */
  @Override()
  public byte[] encodeObjectClasses(Map<ObjectClass,String> objectClasses)
  public void encodeObjectClasses(ByteStringBuilder entryBuffer,
                                  Map<ObjectClass,String> objectClasses)
         throws DirectoryException
  {
    ByteArray encodedClasses = ocEncodeMap.get(objectClasses);
    ByteSequence encodedClasses = ocEncodeMap.get(objectClasses);
    if (encodedClasses == null)
    {
      synchronized (ocEncodeMap)
      {
        int setValue = ocCounter.getAndIncrement();
        byte[] array = encodeInt(setValue);
        encodedClasses = new ByteArray(array);
        encodedClasses = ByteString.wrap(encodeInt(setValue));
        ocEncodeMap.put(objectClasses, encodedClasses);
        ocDecodeMap.put(encodedClasses, objectClasses);
        save();
        return array;
      }
    }
    else
    {
      return encodedClasses.array();
    }
    entryBuffer.appendBERLength(encodedClasses.length());
    encodedClasses.copyTo(entryBuffer);
  }
@@ -432,15 +409,15 @@
   */
  @Override()
  public Map<ObjectClass,String> decodeObjectClasses(
                                      byte[] encodedObjectClasses)
         throws DirectoryException
      ByteSequenceReader entryBufferReader) throws DirectoryException
  {
    ByteArray byteArray = new ByteArray(encodedObjectClasses);
    int tokenLength = entryBufferReader.getBERLength();
    ByteSequence byteArray = entryBufferReader.getByteSequence(tokenLength);
    Map<ObjectClass,String> ocMap = ocDecodeMap.get(byteArray);
    if (ocMap == null)
    {
      Message message = ERR_COMPRESSEDSCHEMA_UNKNOWN_OC_TOKEN.get(
                             bytesToHex(encodedObjectClasses));
      Message message = ERR_COMPRESSEDSCHEMA_UNKNOWN_OC_TOKEN.get(byteArray
          .toByteString().toHex());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                   message);
    }
@@ -456,23 +433,22 @@
   * {@inheritDoc}
   */
  @Override()
  public byte[] encodeAttribute(Attribute attribute)
         throws DirectoryException
  public void encodeAttribute(ByteStringBuilder entryBuffer,
                              Attribute attribute) throws DirectoryException
  {
    AttributeType type = attribute.getAttributeType();
    Set<String> options = attribute.getOptions();
    ConcurrentHashMap<Set<String>, ByteArray> map = adEncodeMap.get(type);
    ConcurrentHashMap<Set<String>, ByteSequence> map = adEncodeMap.get(type);
    if (map == null)
    {
      byte[] array;
      ByteString byteArray;
      synchronized (adEncodeMap)
      {
        map = new ConcurrentHashMap<Set<String>,ByteArray>(1);
        map = new ConcurrentHashMap<Set<String>, ByteSequence>(1);
        int intValue = adCounter.getAndIncrement();
        array = encodeInt(intValue);
        ByteArray byteArray = new ByteArray(array);
        byteArray = ByteString.wrap(encodeInt(intValue));
        map.put(options,byteArray);
        adEncodeMap.put(type, map);
@@ -481,32 +457,26 @@
        save();
      }
      return encodeAttribute(array, attribute);
      encodeAttribute(entryBuffer, byteArray, attribute);
    }
    else
    {
      ByteArray byteArray = map.get(options);
      ByteSequence byteArray = map.get(options);
      if (byteArray == null)
      {
        byte[] array;
        synchronized (map)
        {
          int intValue = adCounter.getAndIncrement();
          array = encodeInt(intValue);
          byteArray = new ByteArray(array);
          byteArray = ByteString.wrap(encodeInt(intValue));
          map.put(options,byteArray);
          atDecodeMap.put(byteArray, type);
          aoDecodeMap.put(byteArray, options);
          save();
        }
      }
        return encodeAttribute(array, attribute);
      }
      else
      {
        return encodeAttribute(byteArray.array(), attribute);
      }
      encodeAttribute(entryBuffer, byteArray, attribute);
    }
  }
@@ -516,50 +486,27 @@
   * Encodes the information in the provided attribute to a byte
   * array.
   *
   * @param  buffer     The byte buffer to encode the attribute into.
   * @param  adArray    The byte array that is a placeholder for the
   *                    attribute type and set of options.
   * @param  attribute  The attribute to be encoded.
   *
   * @return  An encoded representation of the provided attribute.
   */
  private byte[] encodeAttribute(byte[] adArray, Attribute attribute)
  private void encodeAttribute(ByteStringBuilder buffer, ByteSequence adArray,
                               Attribute attribute)
  {
    int totalValuesLength = 0;
    byte[][] subArrays = new  byte[attribute.size()*2][];
    int pos = 0;
    // Write the length of the adArray followed by the adArray.
    buffer.appendBERLength(adArray.length());
    adArray.copyTo(buffer);
    // Write the number of attributes
    buffer.appendBERLength(attribute.size());
    // Write the attribute values as length / value pairs
    for (AttributeValue v : attribute)
    {
      byte[] vBytes = v.getValueBytes();
      byte[] lBytes = ASN1Element.encodeLength(vBytes.length);
      subArrays[pos++] = lBytes;
      subArrays[pos++] = vBytes;
      totalValuesLength += lBytes.length + vBytes.length;
      buffer.appendBERLength(v.getValue().length());
      buffer.append(v.getValue());
    }
    byte[] adArrayLength = ASN1Element.encodeLength(adArray.length);
    byte[] countBytes = ASN1Element.encodeLength(attribute.size());
    int totalLength = adArrayLength.length + adArray.length +
                      countBytes.length + totalValuesLength;
    byte[] array = new byte[totalLength];
    System.arraycopy(adArrayLength, 0, array, 0,
                     adArrayLength.length);
    pos = adArrayLength.length;
    System.arraycopy(adArray, 0, array, pos, adArray.length);
    pos += adArray.length;
    System.arraycopy(countBytes, 0, array, pos, countBytes.length);
    pos += countBytes.length;
    for (int i=0; i < subArrays.length; i++)
    {
      System.arraycopy(subArrays[i], 0, array, pos,
                       subArrays[i].length);
      pos += subArrays[i].length;
    }
    return array;
  }
@@ -568,75 +515,43 @@
   * {@inheritDoc}
   */
  @Override()
  public Attribute decodeAttribute(byte[] encodedEntry, int startPos,
                                   int length)
  public Attribute decodeAttribute(ByteSequenceReader entryBufferReader)
         throws DirectoryException
  {
    // Figure out how many bytes are in the token that is the placeholder for
    // the attribute description.
    int pos = startPos;
    int adArrayLength = encodedEntry[pos] & 0x7F;
    if (adArrayLength != encodedEntry[pos++])
    {
      int numLengthBytes = adArrayLength;
      adArrayLength = 0;
      for (int i=0; i < numLengthBytes; i++, pos++)
      {
        adArrayLength = (adArrayLength << 8) | (encodedEntry[pos] & 0xFF);
      }
    }
    int adArrayLength = entryBufferReader.getBERLength();
    // Get the attribute description token and make sure it resolves to an
    // attribute type and option set.
    ByteArray adArray = new ByteArray(new byte[adArrayLength]);
    System.arraycopy(encodedEntry, pos, adArray.array(), 0, adArrayLength);
    pos += adArrayLength;
    ByteSequence adArray = entryBufferReader.getByteSequence(adArrayLength);
    AttributeType attrType = atDecodeMap.get(adArray);
    Set<String> options = aoDecodeMap.get(adArray);
    if ((attrType == null) || (options == null))
    {
      Message message = ERR_COMPRESSEDSCHEMA_UNRECOGNIZED_AD_TOKEN.get(
                             bytesToHex(adArray.array()));
      Message message = ERR_COMPRESSEDSCHEMA_UNRECOGNIZED_AD_TOKEN.get(adArray
          .toByteString().toHex());
      throw new DirectoryException(DirectoryServer.getServerErrorResultCode(),
                                   message);
    }
    // Determine the number of values for the attribute.
    int numValues = encodedEntry[pos] & 0x7F;
    if (numValues != encodedEntry[pos++])
    {
      int numValuesBytes = numValues;
      numValues = 0;
      for (int i=0; i < numValuesBytes; i++, pos++)
      {
        numValues = (numValues << 8) | (encodedEntry[pos] & 0xFF);
      }
    }
    int numValues = entryBufferReader.getBERLength();
    // For the common case of a single value with no options, generate
    // less garbage.
    if (numValues == 1 && options.isEmpty())
    {
      int valueLength = encodedEntry[pos] & 0x7F;
      if (valueLength != encodedEntry[pos++])
      {
        int valueLengthBytes = valueLength;
        valueLength = 0;
        for (int j = 0; j < valueLengthBytes; j++, pos++)
        {
          valueLength = (valueLength << 8) | (encodedEntry[pos] & 0xFF);
        }
      }
      int valueLength = entryBufferReader.getBERLength();
      byte[] valueBytes = new byte[valueLength];
      System.arraycopy(encodedEntry, pos, valueBytes, 0, valueLength);
      return Attributes.create(attrType, new AttributeValue(attrType,
          new ASN1OctetString(valueBytes)));
      ByteString valueBytes =
          entryBufferReader.getByteSequence(valueLength).toByteString();
      return Attributes.create(attrType,
          AttributeValues.create(attrType,valueBytes));
    }
    else
    {
@@ -646,22 +561,12 @@
      builder.setInitialCapacity(numValues);
      for (int i = 0; i < numValues; i++)
      {
        int valueLength = encodedEntry[pos] & 0x7F;
        if (valueLength != encodedEntry[pos++])
        {
          int valueLengthBytes = valueLength;
          valueLength = 0;
          for (int j = 0; j < valueLengthBytes; j++, pos++)
          {
            valueLength = (valueLength << 8) | (encodedEntry[pos] & 0xFF);
          }
        }
        int valueLength = entryBufferReader.getBERLength();
        byte[] valueBytes = new byte[valueLength];
        System.arraycopy(encodedEntry, pos, valueBytes, 0, valueLength);
        pos += valueLength;
        builder.add(new AttributeValue(attrType,
            new ASN1OctetString(valueBytes)));
        ByteString valueBytes =
            entryBufferReader.getByteSequence(valueLength).toByteString();
        builder.add(AttributeValues.create(attrType,
            valueBytes));
      }
      return builder.toAttribute();
opendj-sdk/opends/src/server/org/opends/server/core/DeleteOperationBasis.java
@@ -47,7 +47,6 @@
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.*;
import org.opends.server.types.operation.PostResponseDeleteOperation;
import org.opends.server.types.operation.PreParseDeleteOperation;
@@ -137,7 +136,7 @@
    this.entryDN = entryDN;
    rawEntryDN       = new ASN1OctetString(entryDN.toString());
    rawEntryDN       = ByteString.valueOf(entryDN.toString());
    responseControls = new ArrayList<Control>();
    cancelRequest    = null;
    changeNumber     = -1;
opendj-sdk/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -26,11 +26,60 @@
 */
package org.opends.server.core;
import static org.opends.messages.ConfigMessages.*;
import static org.opends.messages.CoreMessages.*;
import static org.opends.messages.ToolMessages.*;
import static org.opends.server.config.ConfigConstants.*;
import static org.opends.server.loggers.AccessLogger.*;
import static org.opends.server.loggers.ErrorLogger.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import static org.opends.server.schema.SchemaConstants.*;
import static org.opends.server.util.DynamicConstants.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import static org.opends.server.util.Validator.*;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.InetAddress;
import java.text.DecimalFormat;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import org.opends.messages.Message;
import org.opends.messages.MessageDescriptor;
import org.opends.server.admin.AdministrationDataSync;
import org.opends.server.admin.ClassLoaderProvider;
import org.opends.server.admin.server.ServerManagementContext;
import org.opends.server.admin.std.meta.GlobalCfgDefn.WorkflowConfigurationMode;
import org.opends.server.admin.std.server.*;
import org.opends.server.admin.std.server.AlertHandlerCfg;
import org.opends.server.admin.std.server.AttributeSyntaxCfg;
import org.opends.server.admin.std.server.ConnectionHandlerCfg;
import org.opends.server.admin.std.server.CryptoManagerCfg;
import org.opends.server.admin.std.server.DirectoryStringAttributeSyntaxCfg;
import org.opends.server.admin.std.server.MonitorProviderCfg;
import org.opends.server.admin.std.server.PasswordValidatorCfg;
import org.opends.server.admin.std.server.RootCfg;
import org.opends.server.admin.std.server.RootDSEBackendCfg;
import org.opends.server.admin.std.server.SynchronizationProviderCfg;
import org.opends.server.api.AccessControlHandler;
import org.opends.server.api.AccountStatusNotificationHandler;
import org.opends.server.api.AlertGenerator;
import org.opends.server.api.AlertHandler;
@@ -53,13 +102,14 @@
import org.opends.server.api.EqualityMatchingRule;
import org.opends.server.api.ExportTaskListener;
import org.opends.server.api.ExtendedOperationHandler;
import org.opends.server.api.Extension;
import org.opends.server.api.IdentityMapper;
import org.opends.server.api.ImportTaskListener;
import org.opends.server.api.InitializationCompletedListener;
import org.opends.server.api.InvokableComponent;
import org.opends.server.api.KeyManagerProvider;
import org.opends.server.api.Extension;
import org.opends.server.api.MatchingRule;
import org.opends.server.api.MatchingRuleFactory;
import org.opends.server.api.MonitorProvider;
import org.opends.server.api.OrderingMatchingRule;
import org.opends.server.api.PasswordGenerator;
@@ -72,14 +122,10 @@
import org.opends.server.api.SynchronizationProvider;
import org.opends.server.api.TrustManagerProvider;
import org.opends.server.api.WorkQueue;
import org.opends.server.api.AccessControlHandler;
import org.opends.server.api.plugin.PluginType;
import org.opends.server.api.plugin.PluginResult;
import org.opends.server.api.plugin.PluginType;
import org.opends.server.api.ExtensibleMatchingRule;
import org.opends.server.backends.RootDSEBackend;
import static org.opends.server.config.ConfigConstants.DN_CONFIG_ROOT;
import static org.opends.server.config.ConfigConstants.DN_MONITOR_ROOT;
import static org.opends.server.config.ConfigConstants.ENV_VAR_INSTALL_ROOT;
import org.opends.server.config.ConfigEntry;
import org.opends.server.config.ConfigException;
import org.opends.server.config.JMXMBean;
@@ -87,22 +133,22 @@
import org.opends.server.controls.PasswordPolicyResponseControl;
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.core.networkgroups.NetworkGroupConfigManager;
import org.opends.server.crypto.CryptoManagerImpl;
import org.opends.server.crypto.CryptoManagerSync;
import org.opends.server.extensions.ConfigFileHandler;
import org.opends.server.extensions.JMXAlertHandler;
import static org.opends.server.loggers.AccessLogger.*;
import static org.opends.server.loggers.ErrorLogger.*;
import org.opends.server.loggers.*;
import static org.opends.server.loggers.debug.DebugLogger.*;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.loggers.ErrorLogger;
import org.opends.server.loggers.RetentionPolicy;
import org.opends.server.loggers.RotationPolicy;
import org.opends.server.loggers.TextErrorLogPublisher;
import org.opends.server.loggers.TextWriter;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.loggers.debug.TextDebugLogPublisher;
import org.opends.messages.MessageDescriptor;
import org.opends.messages.Message;
import static org.opends.messages.CoreMessages.*;
import static org.opends.messages.ToolMessages.*;
import org.opends.server.monitors.BackendMonitor;
import org.opends.server.monitors.ConnectionHandlerMonitor;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalConnectionHandler;
import org.opends.server.schema.AttributeTypeSyntax;
import org.opends.server.schema.BinarySyntax;
import org.opends.server.schema.BooleanEqualityMatchingRuleFactory;
@@ -134,10 +180,10 @@
import org.opends.server.schema.OctetStringEqualityMatchingRuleFactory;
import org.opends.server.schema.OctetStringOrderingMatchingRuleFactory;
import org.opends.server.schema.OctetStringSubstringMatchingRuleFactory;
import static org.opends.server.schema.SchemaConstants.*;
import org.opends.server.schema.TelephoneNumberEqualityMatchingRuleFactory;
import org.opends.server.schema.TelephoneNumberSubstringMatchingRuleFactory;
import org.opends.server.schema.TelephoneNumberSyntax;
import org.opends.server.servicetag.ServiceTagRegistration;
import org.opends.server.tools.ConfigureWindowsService;
import org.opends.server.types.AbstractOperation;
import org.opends.server.types.AcceptRejectWarn;
@@ -146,17 +192,18 @@
import org.opends.server.types.AttributeValue;
import org.opends.server.types.BackupConfig;
import org.opends.server.types.Control;
import org.opends.server.crypto.CryptoManagerImpl;
import org.opends.server.types.DITContentRule;
import org.opends.server.types.DITStructureRule;
import org.opends.server.types.DN;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryEnvironmentConfig;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Entry;
import org.opends.server.types.HostPort;
import org.opends.server.types.InitializationException;
import org.opends.server.types.LDIFExportConfig;
import org.opends.server.types.LDIFImportConfig;
import org.opends.server.types.LockManager;
import org.opends.server.types.MatchingRuleUse;
import org.opends.server.types.Modification;
import org.opends.server.types.NameForm;
@@ -170,12 +217,6 @@
import org.opends.server.types.Schema;
import org.opends.server.types.VirtualAttributeRule;
import org.opends.server.types.WritabilityMode;
import org.opends.server.types.DirectoryEnvironmentConfig;
import org.opends.server.types.LockManager;
import static org.opends.server.util.DynamicConstants.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.*;
import static org.opends.server.util.Validator.ensureNotNull;
import org.opends.server.util.MultiOutputStream;
import org.opends.server.util.RuntimeInformation;
import org.opends.server.util.SetupUtils;
@@ -189,28 +230,8 @@
import org.opends.server.util.args.StringArgument;
import org.opends.server.workflowelement.WorkflowElement;
import org.opends.server.workflowelement.WorkflowElementConfigManager;
import
  org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement;
import org.opends.server.protocols.internal.InternalConnectionHandler;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.crypto.CryptoManagerSync;
import org.opends.server.servicetag.ServiceTagRegistration;
import static org.opends.messages.ConfigMessages.*;
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
import java.net.InetAddress;
import java.text.DecimalFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.CopyOnWriteArraySet;
import org.opends.server.api.MatchingRuleFactory;
import org.opends.server.workflowelement.
    localbackend.LocalBackendWorkflowElement;
/**
@@ -642,7 +663,7 @@
  private MonitorConfigManager monitorConfigManager;
  // The operating system on which the server is running.
  private OperatingSystem operatingSystem;
  private final OperatingSystem operatingSystem;
  // The configuration handler used to manage the password generators.
  private PasswordGeneratorConfigManager passwordGeneratorConfigManager;
@@ -731,7 +752,7 @@
  // The mappings between the names and WorkflowElements
  // registered with the Directory Server
  private ConcurrentHashMap<String, WorkflowElement> workflowElements =
  private final ConcurrentHashMap<String, WorkflowElement> workflowElements =
          new ConcurrentHashMap<String, WorkflowElement>();
  // The workflow configuration mode (auto or manual).
@@ -2358,7 +2379,7 @@
        workflowID,
        baseDN,
        rootWE.getWorkflowElementID(),
        (WorkflowElement) rootWE);
        rootWE);
    workflowImpl.register();
    return workflowImpl;
@@ -3044,7 +3065,7 @@
      if (serverRoot != null)
      {
        File instanceRoot =
          directoryServer.environmentConfig.getInstanceRootFromServerRoot(
          DirectoryEnvironmentConfig.getInstanceRootFromServerRoot(
              serverRoot);
        if (instanceRoot != null)
        {
@@ -5278,8 +5299,7 @@
      directoryServer.defaultPasswordPolicyConfig = null;
    }
    PasswordPolicyConfig config
            = directoryServer.passwordPolicies.remove(configEntryDN);
    directoryServer.passwordPolicies.remove(configEntryDN);
  }
@@ -8076,9 +8096,8 @@
      directoryServer.shuttingDown = true;
    }
    ConfigEntry rootConfigEntry = null;
    try {
      rootConfigEntry = directoryServer.configHandler.getConfigRootEntry();
      directoryServer.configHandler.getConfigRootEntry();
    } catch (Exception e) {
    }
@@ -9544,7 +9563,7 @@
  public static DN getMonitorProviderDN(MonitorProvider provider)
  {
    String monitorName = provider.getMonitorInstanceName();
    AttributeType cnType = getAttributeType(ATTR_COMMON_NAME);
    getAttributeType(ATTR_COMMON_NAME);
    DN monitorRootDN;
    try
    {
@@ -9848,7 +9867,7 @@
    synchronized (directoryServer)
    {
      if (directoryServer.workflowElements.containsKey(workflowElementID)) {
        Message message = ERR_REGISTER_WORKFLOW_ELEMENT_ALREADY_EXISTS.get(
        ERR_REGISTER_WORKFLOW_ELEMENT_ALREADY_EXISTS.get(
                workflowElementID);
      } else {
        directoryServer.workflowElements.put(workflowElementID, we);
opendj-sdk/opends/src/server/org/opends/server/core/ExtendedOperation.java
@@ -26,9 +26,8 @@
 */
package org.opends.server.core;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.Operation;
import org.opends.server.types.ByteString;
/**
@@ -56,7 +55,7 @@
   * @return  The value for the request associated with this extended
   *          operation.
   */
  public ASN1OctetString getRequestValue();
  public ByteString getRequestValue();
@@ -84,7 +83,7 @@
   *
   * @return  The value to include in the response to the client.
   */
  public ASN1OctetString getResponseValue();
  public ByteString getResponseValue();
@@ -94,7 +93,7 @@
   * @param  responseValue  The value to include in the response to
   *                        the client.
   */
  public void setResponseValue(ASN1OctetString responseValue);
  public void setResponseValue(ByteString responseValue);
  /**
   * Indicates that the response for this extended operation has been sent from
opendj-sdk/opends/src/server/org/opends/server/core/ExtendedOperationBasis.java
@@ -35,7 +35,6 @@
import org.opends.server.api.ClientConnection;
import org.opends.server.api.ExtendedOperationHandler;
import org.opends.server.api.plugin.PluginResult;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.operation.PostOperationExtendedOperation;
import org.opends.server.types.operation.PostResponseExtendedOperation;
import org.opends.server.types.operation.PreOperationExtendedOperation;
@@ -71,10 +70,10 @@
  private static final DebugTracer TRACER = DebugLogger.getTracer();
  // The value for the request associated with this extended operation.
  private ASN1OctetString requestValue;
  private ByteString requestValue;
  // The value for the response associated with this extended operation.
  private ASN1OctetString responseValue;
  private ByteString responseValue;
  // Indicates whether a response has yet been sent for this operation.
  private boolean responseSent;
@@ -107,7 +106,7 @@
  public ExtendedOperationBasis(ClientConnection clientConnection,
                           long operationID,
                           int messageID, List<Control> requestControls,
                           String requestOID, ASN1OctetString requestValue)
                           String requestOID, ByteString requestValue)
  {
    super(clientConnection, operationID, messageID, requestControls);
@@ -162,7 +161,7 @@
  /**
   * {@inheritDoc}
   */
  public final ASN1OctetString getRequestValue()
  public final ByteString getRequestValue()
  {
    return requestValue;
  }
@@ -176,7 +175,7 @@
   * @param  requestValue  The value for the request associated with this
   *                       extended operation.
   */
  public final void setRequestValue(ASN1OctetString requestValue)
  public final void setRequestValue(ByteString requestValue)
  {
    this.requestValue = requestValue;
  }
@@ -206,7 +205,7 @@
  /**
   * {@inheritDoc}
   */
  public final ASN1OctetString getResponseValue()
  public final ByteString getResponseValue()
  {
    return responseValue;
  }
@@ -216,7 +215,7 @@
  /**
   * {@inheritDoc}
   */
  public final void setResponseValue(ASN1OctetString responseValue)
  public final void setResponseValue(ByteString responseValue)
  {
    this.responseValue = responseValue;
  }
@@ -469,10 +468,10 @@
            pluginConfigManager.invokePreOperationExtendedPlugins(this);
        if(!preOpResult.continueProcessing())
        {
          setResultCode(preParseResult.getResultCode());
          appendErrorMessage(preParseResult.getErrorMessage());
          setMatchedDN(preParseResult.getMatchedDN());
          setReferralURLs(preParseResult.getReferralURLs());
          setResultCode(preOpResult.getResultCode());
          appendErrorMessage(preOpResult.getErrorMessage());
          setMatchedDN(preOpResult.getMatchedDN());
          setReferralURLs(preOpResult.getReferralURLs());
          return;
        }
opendj-sdk/opends/src/server/org/opends/server/core/GroupManager.java
@@ -49,6 +49,7 @@
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.internal.InternalSearchOperation;
import org.opends.server.protocols.ldap.LDAPControl;
import org.opends.server.types.ConfigChangeResult;
import org.opends.server.types.Control;
import org.opends.server.types.DebugLogLevel;
@@ -581,7 +582,7 @@
         InternalClientConnection.getRootConnection();
    LinkedList<Control> requestControls = new LinkedList<Control>();
    requestControls.add(new Control(OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE,
    requestControls.add(new LDAPControl(OID_INTERNAL_GROUP_MEMBERSHIP_UPDATE,
                                    false));
    for (DN configEntryDN : groupImplementations.keySet())
    {
opendj-sdk/opends/src/server/org/opends/server/core/ModifyDNOperation.java
@@ -27,12 +27,8 @@
package org.opends.server.core;
import java.util.List;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.Modification;
import org.opends.server.types.Operation;
import org.opends.server.types.RDN;
import org.opends.server.types.*;
import org.opends.server.types.operation.SubordinateModifyDNOperation;
/**
opendj-sdk/opends/src/server/org/opends/server/core/ModifyDNOperationBasis.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.core;
import org.opends.messages.MessageBuilder;
@@ -33,7 +33,6 @@
import org.opends.server.api.ClientConnection;
import org.opends.server.api.plugin.PluginResult;
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.types.operation.PostResponseModifyDNOperation;
import org.opends.server.types.operation.PreParseModifyDNOperation;
import static org.opends.server.core.CoreConstants.*;
@@ -176,8 +175,8 @@
    this.deleteOldRDN = deleteOldRDN;
    this.newSuperior  = newSuperior;
    rawEntryDN = new ASN1OctetString(entryDN.toString());
    rawNewRDN  = new ASN1OctetString(newRDN.toString());
    rawEntryDN = ByteString.valueOf(entryDN.toString());
    rawNewRDN  = ByteString.valueOf(newRDN.toString());
    if (newSuperior == null)
    {
@@ -185,7 +184,7 @@
    }
    else
    {
      rawNewSuperior = new ASN1OctetString(newSuperior.toString());
      rawNewSuperior = ByteString.valueOf(newSuperior.toString());
    }
    responseControls = new ArrayList<Control>();
@@ -270,7 +269,7 @@
    {
      if (newRDN == null)
      {
        newRDN = RDN.decode(rawNewRDN.stringValue());
        newRDN = RDN.decode(rawNewRDN.toString());
      }
    }
    catch (DirectoryException de)
@@ -444,7 +443,7 @@
    }
    else
    {
      newSuperiorStr = rawNewSuperior.stringValue();
      newSuperiorStr = rawNewSuperior.toString();
    }
    return new String[][]
@@ -572,6 +571,7 @@
   * managing synchronization, and any other work that might need to
   * be done in the course of processing.
   */
  @Override
  public final void run()
  {
    setResultCode(ResultCode.UNDEFINED);
opendj-sdk/opends/src/server/org/opends/server/core/ModifyDNOperationWrapper.java
@@ -27,11 +27,8 @@
package org.opends.server.core;
import java.util.List;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.Modification;
import org.opends.server.types.RDN;
import org.opends.server.types.*;
/**
 * This abstract class wraps/decorates a given moddn operation.
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperation.java
@@ -28,12 +28,7 @@
import java.util.List;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Modification;
import org.opends.server.types.Operation;
import org.opends.server.types.RawModification;
import org.opends.server.types.*;
/**
 * This interface defines an operation used to modify an entry in
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperationBasis.java
@@ -46,7 +46,6 @@
import org.opends.server.core.networkgroups.NetworkGroup;
import org.opends.server.loggers.debug.DebugLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.protocols.ldap.LDAPModification;
import org.opends.server.types.*;
@@ -150,7 +149,7 @@
    this.entryDN       = entryDN;
    this.modifications = modifications;
    rawEntryDN = new ASN1OctetString(entryDN.toString());
    rawEntryDN = ByteString.valueOf(entryDN.toString());
    rawModifications = new ArrayList<RawModification>(modifications.size());
    for (Modification m : modifications)
opendj-sdk/opends/src/server/org/opends/server/core/ModifyOperationWrapper.java
@@ -28,11 +28,8 @@
import java.util.List;
import org.opends.server.types.ByteString;
import org.opends.server.types.DN;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.Modification;
import org.opends.server.types.RawModification;
import org.opends.server.types.*;
/**
opendj-sdk/opends/src/server/org/opends/server/core/OperationWrapper.java
@@ -34,6 +34,7 @@
import org.opends.server.api.ClientConnection;
import org.opends.server.types.*;
import org.opends.server.controls.ControlDecoder;
/**
@@ -296,6 +297,15 @@
  /**
   * {@inheritDoc}
   */
  public <T extends Control> T getRequestControl(
      ControlDecoder<T> d)throws DirectoryException
  {
    return operation.getRequestControl(d);
  }
  /**
   * {@inheritDoc}
   */
  public String[][] getRequestLogElements()
  {
    return operation.getRequestLogElements();
opendj-sdk/opends/src/server/org/opends/server/core/PasswordPolicy.java
@@ -50,13 +50,8 @@
import org.opends.server.api.PasswordValidator;
import org.opends.server.config.ConfigException;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.schema.GeneralizedTimeSyntax;
import org.opends.server.types.AttributeType;
import org.opends.server.types.ByteString;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DN;
import org.opends.server.types.InitializationException;
import org.opends.server.types.*;
import static org.opends.messages.CoreMessages.*;
import static org.opends.server.config.ConfigConstants.*;
@@ -502,7 +497,7 @@
    {
      if (requireChangeBy != null)
      {
        ByteString valueString = new ASN1OctetString(requireChangeBy);
        ByteString valueString = ByteString.valueOf(requireChangeBy);
        GeneralizedTimeSyntax syntax =
             (GeneralizedTimeSyntax)
opendj-sdk/opends/src/server/org/opends/server/core/PasswordPolicyState.java
@@ -52,31 +52,12 @@
import org.opends.server.api.PasswordValidator;
import org.opends.server.loggers.ErrorLogger;
import org.opends.server.loggers.debug.DebugTracer;
import org.opends.server.protocols.asn1.ASN1OctetString;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.ldap.LDAPAttribute;
import org.opends.server.schema.AuthPasswordSyntax;
import org.opends.server.schema.GeneralizedTimeSyntax;
import org.opends.server.schema.UserPasswordSyntax;
import org.opends.server.types.AccountStatusNotification;
import org.opends.server.types.AccountStatusNotificationProperty;
import org.opends.server.types.AccountStatusNotificationType;
import org.opends.server.types.Attribute;
import org.opends.server.types.AttributeBuilder;
import org.opends.server.types.AttributeType;
import org.opends.server.types.AttributeValue;
import org.opends.server.types.Attributes;
import org.opends.server.types.ByteString;
import org.opends.server.types.ConditionResult;
import org.opends.server.types.DebugLogLevel;
import org.opends.server.types.DirectoryException;
import org.opends.server.types.DN;
import org.opends.server.types.Entry;
import org.opends.server.types.Modification;
import org.opends.server.types.ModificationType;
import org.opends.server.types.Operation;
import org.opends.server.types.RawModification;
import org.opends.server.types.ResultCode;
import org.opends.server.types.*;
import org.opends.server.util.TimeThread;
import static org.opends.server.config.ConfigConstants.*;
@@ -317,12 +298,12 @@
          {
            TRACER.debugError("Could not parse password policy subentry " +
                "DN %s for user %s: %s",
                       v.getStringValue(), userDNString,
                       v.getValue().toString(), userDNString,
                       stackTraceToSingleLineString(e));
          }
          Message message = ERR_PWPSTATE_CANNOT_DECODE_SUBENTRY_VALUE_AS_DN.get(
              v.getStringValue(), userDNString, e.getMessage());
              v.getValue().toString(), userDNString, e.getMessage());
          if (useDefaultOnError)
          {
            ErrorLogger.logError(message);
@@ -400,7 +381,7 @@
      {
        if (a.isEmpty()) continue;
        stringValue = a.iterator().next().getStringValue();
        stringValue = a.iterator().next().getValue().toString();
        break ;
      }
    }
@@ -466,12 +447,12 @@
            TRACER.debugWarning("Unable to decode value %s for attribute %s " +
                "in user entry %s: %s",
                v.getStringValue(), attributeType.getNameOrOID(),
                v.getValue().toString(), attributeType.getNameOrOID(),
                userDNString, stackTraceToSingleLineString(e));
          }
          Message message = ERR_PWPSTATE_CANNOT_DECODE_GENERALIZED_TIME.
              get(v.getStringValue(), attributeType.getNameOrOID(),
              get(v.getValue().toString(), attributeType.getNameOrOID(),
                  userDNString, String.valueOf(e));
          throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                       message, e);
@@ -534,12 +515,12 @@
              TRACER.debugWarning("Unable to decode value %s for attribute %s" +
                  "in user entry %s: %s",
                  v.getStringValue(), attributeType.getNameOrOID(),
                  v.getValue().toString(), attributeType.getNameOrOID(),
                  userDNString, stackTraceToSingleLineString(e));
            }
            Message message = ERR_PWPSTATE_CANNOT_DECODE_GENERALIZED_TIME.
                get(v.getStringValue(), attributeType.getNameOrOID(),
                get(v.getValue().toString(), attributeType.getNameOrOID(),
                    userDNString, String.valueOf(e));
            throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX,
                                         message, e);
@@ -586,7 +567,7 @@
        if (a.isEmpty()) continue;
        String valueString
             = toLowerCase(a.iterator().next().getStringValue());
             = toLowerCase(a.iterator().next().getValue().toString());
        if (valueString.equals("true") || valueString.equals("yes") ||
            valueString.equals("on") || valueString.equals("1"))
@@ -1212,7 +1193,7 @@
            valuesToRemove = new LinkedHashSet<AttributeValue>();
          }
          valuesToRemove.add(new AttributeValue(type,
          valuesToRemove.add(AttributeValues.create(type,
                                              GeneralizedTimeSyntax.format(l)));
        }
      }
@@ -1231,7 +1212,7 @@
            for (Long l : authFailureTimes)
            {
              builder.add(
                   new AttributeValue(type, GeneralizedTimeSyntax.format(l)));
                 AttributeValues.create(type, GeneralizedTimeSyntax.format(l)));
            }
            ArrayList<Attribute> keepList = new ArrayList<Attribute>(1);
            keepList.add(builder.toAttribute());
@@ -1308,13 +1289,14 @@
    AttributeBuilder builder = new AttributeBuilder(type);
    for (Long l : failureTimes)
    {
      builder.add(new AttributeValue(type, GeneralizedTimeSyntax.format(l)));
      builder.add(AttributeValues.create(type,
          GeneralizedTimeSyntax.format(l)));
    }
    ArrayList<Attribute> attrList = new ArrayList<Attribute>(1);
    attrList.add(builder.toAttribute());
    Attribute addAttr = Attributes.create(type, new AttributeValue(type,
    Attribute addAttr = Attributes.create(type, AttributeValues.create(type,
        GeneralizedTimeSyntax.format(highestFailureTime)));
    if (updateEntry)
@@ -1374,7 +1356,7 @@
    for (Long l : authFailureTimes)
    {
      builder
          .add(new AttributeValue(type, GeneralizedTimeSyntax.format(l)));
          .add(AttributeValues.create(type, GeneralizedTimeSyntax.format(l)));
    }
    Attribute a = builder.toAttribute();
@@ -1516,7 +1498,7 @@
                                  OP_ATTR_PWPOLICY_LOCKED_TIME);
    }
    Attribute a = Attributes.create(type, new AttributeValue(type,
    Attribute a = Attributes.create(type, AttributeValues.create(type,
        GeneralizedTimeSyntax.format(failureLockedTime)));
    if (updateEntry)
@@ -1769,7 +1751,7 @@
      {
        if (a.isEmpty()) continue;
        String valueString = a.iterator().next().getStringValue();
        String valueString = a.iterator().next().getValue().toString();
        try
        {
@@ -3011,7 +2993,7 @@
      AttributeBuilder builder = new AttributeBuilder(type);
      for (Long l : graceTimes)
      {
        builder.add(new AttributeValue(type, GeneralizedTimeSyntax
        builder.add(AttributeValues.create(type, GeneralizedTimeSyntax
            .format(l)));
      }
@@ -3022,7 +3004,7 @@
    }
    else
    {
      Attribute addAttr = Attributes.create(type, new AttributeValue(
      Attribute addAttr = Attributes.create(type, AttributeValues.create(
          type, GeneralizedTimeSyntax.format(highestGraceTime)));
      modifications.add(new Modification(ModificationType.ADD, addAttr, true));
@@ -3058,7 +3040,7 @@
    for (Long l : graceLoginTimes)
    {
      builder
          .add(new AttributeValue(type, GeneralizedTimeSyntax.format(l)));
          .add(AttributeValues.create(type, GeneralizedTimeSyntax.format(l)));
    }
    Attribute a = builder.toAttribute();
@@ -3146,12 +3128,12 @@
          if (usesAuthPasswordSyntax)
          {
            pwComponents =
                 AuthPasswordSyntax.decodeAuthPassword(v.getStringValue());
                 AuthPasswordSyntax.decodeAuthPassword(v.getValue().toString());
          }
          else
          {
            String[] userPwComponents =
                 UserPasswordSyntax.decodeUserPassword(v.getStringValue());
                 UserPasswordSyntax.decodeUserPassword(v.getValue().toString());
            pwComponents = new StringBuilder[userPwComponents.length];
            for (int i = 0; i < userPwComponents.length; ++i)
            {
@@ -3182,7 +3164,7 @@
                               pwComponents[1].toString(),
                               pwComponents[2].toString())
                         : scheme.getPlaintextValue(
                               new ASN1OctetString(pwComponents[1].toString()));
                ByteString.valueOf(pwComponents[1].toString()));
            clearPasswords.add(clearValue);
          }
        }
@@ -3244,12 +3226,12 @@
          if (usesAuthPasswordSyntax)
          {
            pwComponents =
                 AuthPasswordSyntax.decodeAuthPassword(v.getStringValue());
                 AuthPasswordSyntax.decodeAuthPassword(v.getValue().toString());
          }
          else
          {
            String[] userPwComponents =
                 UserPasswordSyntax.decodeUserPassword(v.getStringValue());
                 UserPasswordSyntax.decodeUserPassword(v.getValue().toString());
            pwComponents = new StringBuilder[userPwComponents.length];
            for (int i = 0; i < userPwComponents.length; ++i)
            {
@@ -3278,7 +3260,7 @@
                                                  pwComponents[1].toString(),
                                                  pwComponents[2].toString())
                     : scheme.passwordMatches(password,
                               new ASN1OctetString(pwComponents[1].toString()));
              ByteString.valueOf(pwComponents[1].toString()));
          if (passwordMatches)
          {
            if (debugEnabled())
@@ -3493,12 +3475,12 @@
          if (usesAuthPasswordSyntax)
          {
            pwComponents =
                 AuthPasswordSyntax.decodeAuthPassword(v.getStringValue());
                 AuthPasswordSyntax.decodeAuthPassword(v.getValue().toString());
          }
          else
          {
            String[] userPwComponents =
                 UserPasswordSyntax.decodeUserPassword(v.getStringValue());
                 UserPasswordSyntax.decodeUserPassword(v.getValue().toString());
            pwComponents = new StringBuilder[userPwComponents.length];
            for (int i = 0; i < userPwComponents.length; ++i)
            {
@@ -3527,7 +3509,7 @@
                                                  pwComponents[1].toString(),
                                                  pwComponents[2].toString())
                     : scheme.passwordMatches(password,
                               new ASN1OctetString(pwComponents[1].toString()));
              ByteString.valueOf(pwComponents[1].toString()));
          if (passwordMatches)
          {
            if (passwordPolicy.isDefaultStorageScheme(schemeName))
@@ -3591,7 +3573,8 @@
          ByteString encodedPassword = (usesAuthPasswordSyntax)
                                       ? s.encodeAuthPassword(password)
                                       : s.encodePasswordWithScheme(password);
          AttributeValue v = new AttributeValue(type, encodedPassword);
          AttributeValue v =
              AttributeValues.create(type, encodedPassword);
          addedValues.add(v);
          updatedValues.add(v);
        }
@@ -3800,7 +3783,7 @@
      {
        for (AttributeValue v : a)
        {
          String histStr = v.getStringValue();
          String histStr = v.getValue().toString();
          int    hashPos = histStr.indexOf('#');
          if (hashPos <= 0)
          {
@@ -3822,7 +3805,7 @@
            {
              long timestamp =
                   GeneralizedTimeSyntax.decodeGeneralizedTimeValue(
                        new ASN1OctetString(histStr.substring(0, hashPos)));
                       ByteString.valueOf(histStr.substring(0, hashPos)));
              historyMap.put(timestamp, v);
            }
            catch (Exception e)
@@ -3871,7 +3854,7 @@
    // we only care about the syntax OID and encoded password.
    try
    {
      String histStr  = historyValue.getStringValue();
      String histStr  = historyValue.getValue().toString();
      int    hashPos1 = histStr.indexOf('#');
      if (hashPos1 <= 0)
      {
@@ -3935,7 +3918,7 @@
        PasswordStorageScheme<?> scheme =
             DirectoryServer.getPasswordStorageScheme(userPWComponents[0]);
        if (scheme.passwordMatches(password,
                                   new ASN1OctetString(userPWComponents[1])))
            ByteString.valueOf(userPWComponents[1])))
        {
          if (debugEnabled())
          {
@@ -4001,7 +3984,7 @@
      {
        for (AttributeValue v : a)
        {
          addPasswordToHistory(v.getStringValue());
          addPasswordToHistory(v.getValue().toString());
        }
      }
    }
@@ -4060,8 +4043,8 @@
        if (debugEnabled())
        {
          TRACER.debugInfo("Removing history value " + v.getStringValue() +
              " to preserve the history count.");
          TRACER.debugInfo("Removing history value " +
              v.getValue().toString() + " to preserve the history count.");
        }
      }
@@ -4094,7 +4077,8 @@
          if (debugEnabled())
          {
            TRACER.debugInfo("Removing history value " + v.getStringValue() +
            TRACER.debugInfo("Removing history value " +
                v.getValue().toString() +
                " to preserve the history duration.");
          }
        }
@@ -4177,7 +4161,7 @@
      {
        for (AttributeValue v : a)
        {
          historyValues.add(v.getStringValue());
          historyValues.add(v.getValue().toString());
        }
      }
    }
@@ -4334,7 +4318,7 @@
    InternalClientConnection conn =
         InternalClientConnection.getRootConnection();
    ModifyOperation internalModify =
         conn.processModify(new ASN1OctetString(userDNString), modList);
         conn.processModify(ByteString.valueOf(userDNString), modList);
    ResultCode resultCode = internalModify.getResultCode();
    if (resultCode != ResultCode.SUCCESS)
opendj-sdk/opends/src/server/org/opends/server/core/PluginConfigManager.java
@@ -982,7 +982,7 @@
      {
        DN dn = p.getPluginEntryDN();
        String lowerName =
             toLowerCase(dn.getRDN().getAttributeValue(0).getStringValue());
            toLowerCase(dn.getRDN().getAttributeValue(0).getValue().toString());
        if (initialPluginNames.contains(lowerName))
        {
          initialPlugins.put(lowerName, p);
@@ -1002,7 +1002,7 @@
      // the correct category.
      DN dn = plugin.getPluginEntryDN();
      String lowerName =
           toLowerCase(dn.getRDN().getAttributeValue(0).getStringValue());
           toLowerCase(dn.getRDN().getAttributeValue(0).getValue().toString());
      if (initialPluginNames.contains(lowerName))
      {
        initialPlugins.put(lowerName, plugin);
opendj-sdk/opends/src/server/org/opends/server/core/SchemaConfigManager.java
@@ -825,7 +825,7 @@
            }
            Message message = WARN_CONFIG_SCHEMA_CANNOT_PARSE_ATTR_TYPE.get(
                    schemaFile, v.getStringValue() + ":  " +
                    schemaFile, v.getValue().toString() + ":  " +
                    getExceptionMessage(e));
            if (failOnError)
            {
@@ -920,7 +920,7 @@
            Message message = WARN_CONFIG_SCHEMA_CANNOT_PARSE_OC.get(
                    schemaFile,
                    v.getStringValue() + ":  " + getExceptionMessage(e));
                    v.getValue().toString() + ":  " + getExceptionMessage(e));
            if (failOnError)
            {
@@ -1011,7 +1011,7 @@
            }
            Message message = WARN_CONFIG_SCHEMA_CANNOT_PARSE_NAME_FORM.get(
                    schemaFile,  v.getStringValue() + ":  " +
                    schemaFile,  v.getValue().toString() + ":  " +
                    getExceptionMessage(e));
            if (failOnError)
@@ -1105,7 +1105,7 @@
            }
            Message message = WARN_CONFIG_SCHEMA_CANNOT_PARSE_DCR.get(
                    schemaFile,v.getStringValue() + ":  " +
                    schemaFile,v.getValue().toString() + ":  " +
                    getExceptionMessage(e));
            if (failOnError)
@@ -1199,7 +1199,7 @@
            }
            Message message = WARN_CONFIG_SCHEMA_CANNOT_PARSE_DSR.get(
                    schemaFile, v.getStringValue() + ":  " +
                    schemaFile, v.getValue().toString() + ":  " +
                                        getExceptionMessage(e));
            if (failOnError)
@@ -1294,7 +1294,7 @@
            Message message = WARN_CONFIG_SCHEMA_CANNOT_PARSE_MRU.get(
                    schemaFile,
                    v.getStringValue() + ":  " +
                    v.getValue().toString() + ":  " +
                    getExceptionMessage(e));
            if (failOnError)
Diff truncated after the above file
opendj-sdk/opends/src/server/org/opends/server/core/SearchOperation.java opendj-sdk/opends/src/server/org/opends/server/core/SearchOperationBasis.java opendj-sdk/opends/src/server/org/opends/server/core/SearchOperationWrapper.java opendj-sdk/opends/src/server/org/opends/server/core/UnbindOperationBasis.java opendj-sdk/opends/src/server/org/opends/server/core/networkgroups/NetworkGroup.java opendj-sdk/opends/src/server/org/opends/server/core/networkgroups/ResourceLimitsPolicyFactory.java opendj-sdk/opends/src/server/org/opends/server/crypto/CryptoManagerImpl.java opendj-sdk/opends/src/server/org/opends/server/crypto/CryptoManagerSync.java opendj-sdk/opends/src/server/org/opends/server/crypto/GetSymmetricKeyExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/extensions/AESPasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/AnonymousSASLMechanismHandler.java opendj-sdk/opends/src/server/org/opends/server/extensions/AttributeValuePasswordValidator.java opendj-sdk/opends/src/server/org/opends/server/extensions/Base64PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/BlowfishPasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandler.java opendj-sdk/opends/src/server/org/opends/server/extensions/CancelExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/extensions/CharacterSetPasswordValidator.java opendj-sdk/opends/src/server/org/opends/server/extensions/ClearPasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/ConfigFileHandler.java opendj-sdk/opends/src/server/org/opends/server/extensions/ConnectionSecurityProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/CryptPasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/DictionaryPasswordValidator.java opendj-sdk/opends/src/server/org/opends/server/extensions/DynamicGroup.java opendj-sdk/opends/src/server/org/opends/server/extensions/EntryDNVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/EntryUUIDVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/ExactMatchIdentityMapper.java opendj-sdk/opends/src/server/org/opends/server/extensions/ExternalSASLMechanismHandler.java opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java opendj-sdk/opends/src/server/org/opends/server/extensions/FingerprintCertificateMapper.java opendj-sdk/opends/src/server/org/opends/server/extensions/GSSAPISASLMechanismHandler.java opendj-sdk/opends/src/server/org/opends/server/extensions/GetConnectionIDExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/extensions/HasSubordinatesVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/InternalConnectionSecurityProvider.java (deleted) opendj-sdk/opends/src/server/org/opends/server/extensions/IsMemberOfVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/LengthBasedPasswordValidator.java opendj-sdk/opends/src/server/org/opends/server/extensions/MD5PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/MemberVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/NullConnectionSecurityProvider.java (deleted) opendj-sdk/opends/src/server/org/opends/server/extensions/NumSubordinatesVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/extensions/PlainSASLMechanismHandler.java opendj-sdk/opends/src/server/org/opends/server/extensions/RC4PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/RandomPasswordGenerator.java opendj-sdk/opends/src/server/org/opends/server/extensions/RedirectingByteChannel.java opendj-sdk/opends/src/server/org/opends/server/extensions/RegularExpressionIdentityMapper.java opendj-sdk/opends/src/server/org/opends/server/extensions/RepeatedCharactersPasswordValidator.java opendj-sdk/opends/src/server/org/opends/server/extensions/SASLByteChannel.java opendj-sdk/opends/src/server/org/opends/server/extensions/SASLContext.java opendj-sdk/opends/src/server/org/opends/server/extensions/SASLSecurityProvider.java (deleted) opendj-sdk/opends/src/server/org/opends/server/extensions/SHA1PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/SMTPAccountStatusNotificationHandler.java opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedMD5PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA1PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA256PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA384PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/SaltedSHA512PasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/SimilarityBasedPasswordValidator.java opendj-sdk/opends/src/server/org/opends/server/extensions/StartTLSExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/extensions/StaticGroup.java opendj-sdk/opends/src/server/org/opends/server/extensions/SubjectDNToUserAttributeCertificateMapper.java opendj-sdk/opends/src/server/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/TLSByteChannel.java opendj-sdk/opends/src/server/org/opends/server/extensions/TLSCapableConnection.java opendj-sdk/opends/src/server/org/opends/server/extensions/TLSConnectionSecurityProvider.java (deleted) opendj-sdk/opends/src/server/org/opends/server/extensions/TripleDESPasswordStorageScheme.java opendj-sdk/opends/src/server/org/opends/server/extensions/UniqueCharactersPasswordValidator.java opendj-sdk/opends/src/server/org/opends/server/extensions/UserAttributeNotificationMessageTemplateElement.java opendj-sdk/opends/src/server/org/opends/server/extensions/UserDefinedVirtualAttributeProvider.java opendj-sdk/opends/src/server/org/opends/server/extensions/VirtualStaticGroup.java opendj-sdk/opends/src/server/org/opends/server/extensions/WhoAmIExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/loggers/TextAccessLogPublisher.java opendj-sdk/opends/src/server/org/opends/server/loggers/TextAuditLogPublisher.java opendj-sdk/opends/src/server/org/opends/server/loggers/debug/DebugTracer.java opendj-sdk/opends/src/server/org/opends/server/loggers/debug/TextDebugLogPublisher.java opendj-sdk/opends/src/server/org/opends/server/loggers/debug/TraceSettings.java opendj-sdk/opends/src/server/org/opends/server/monitors/BackendMonitor.java opendj-sdk/opends/src/server/org/opends/server/monitors/ClientConnectionMonitorProvider.java opendj-sdk/opends/src/server/org/opends/server/monitors/ConnectionHandlerMonitor.java opendj-sdk/opends/src/server/org/opends/server/monitors/MemoryUsageMonitorProvider.java opendj-sdk/opends/src/server/org/opends/server/monitors/StackTraceMonitorProvider.java opendj-sdk/opends/src/server/org/opends/server/monitors/SystemInfoMonitorProvider.java opendj-sdk/opends/src/server/org/opends/server/monitors/VersionMonitorProvider.java opendj-sdk/opends/src/server/org/opends/server/plugins/ChangeNumberControlPlugin.java opendj-sdk/opends/src/server/org/opends/server/plugins/EntryUUIDPlugin.java opendj-sdk/opends/src/server/org/opends/server/plugins/LastModPlugin.java opendj-sdk/opends/src/server/org/opends/server/plugins/PasswordPolicyImportPlugin.java opendj-sdk/opends/src/server/org/opends/server/plugins/ReferentialIntegrityPlugin.java opendj-sdk/opends/src/server/org/opends/server/plugins/SevenBitCleanPlugin.java opendj-sdk/opends/src/server/org/opends/server/plugins/UniqueAttributePlugin.java opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileStack.java opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfileViewer.java opendj-sdk/opends/src/server/org/opends/server/plugins/profiler/ProfilerThread.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Boolean.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReader.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelWriter.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReader.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Element.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Enumerated.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReader.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Integer.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Long.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Null.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1OctetString.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1OutputStreamWriter.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Reader.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Sequence.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Set.java (deleted) opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ASN1Writer.java opendj-sdk/opends/src/server/org/opends/server/protocols/asn1/ByteSequenceOutputStream.java opendj-sdk/opends/src/server/org/opends/server/protocols/internal/InternalClientConnection.java opendj-sdk/opends/src/server/org/opends/server/protocols/internal/InternalLDAPInputStream.java opendj-sdk/opends/src/server/org/opends/server/protocols/internal/InternalLDAPOutputStream.java opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/JmxClientConnection.java opendj-sdk/opends/src/server/org/opends/server/protocols/jmx/RmiAuthenticator.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/AbandonRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/AddRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/AddResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/BindRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/BindResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/CompareRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/CompareResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/DeleteRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/DeleteResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ExtendedRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ExtendedResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/IntermediateResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPAttribute.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPClientConnection.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPConnectionHandler.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPControl.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPFilter.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPMessage.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPReader.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPRequestHandler.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyDNRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyDNResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ModifyResponseProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/ProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchResultDoneProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchResultEntryProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/SearchResultReferenceProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/protocols/ldap/UnbindRequestProtocolOp.java opendj-sdk/opends/src/server/org/opends/server/replication/common/ServerState.java opendj-sdk/opends/src/server/org/opends/server/replication/plugin/HistVal.java opendj-sdk/opends/src/server/org/opends/server/replication/plugin/Historical.java opendj-sdk/opends/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java opendj-sdk/opends/src/server/org/opends/server/replication/plugin/PersistentServerState.java opendj-sdk/opends/src/server/org/opends/server/replication/plugin/ReplicationRepairRequestControl.java opendj-sdk/opends/src/server/org/opends/server/replication/protocol/AddMsg.java opendj-sdk/opends/src/server/org/opends/server/replication/protocol/DeleteMsg.java opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyCommonMsg.java opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyDNMsg.java opendj-sdk/opends/src/server/org/opends/server/replication/protocol/ModifyMsg.java opendj-sdk/opends/src/server/org/opends/server/replication/protocol/MonitorMsg.java opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationBackend.java opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationMonitor.java opendj-sdk/opends/src/server/org/opends/server/schema/AbsoluteSubtreeSpecificationSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/AciSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/AttributeTypeSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/AuthPasswordEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/AuthPasswordExactEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/AuthPasswordSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/BinarySyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/BitStringEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/BitStringSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/BooleanEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/BooleanSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactIA5EqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactIA5SubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseExactSubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreIA5EqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreIA5SubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreListEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreListSubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CaseIgnoreSubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/CertificateListSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/CertificatePairSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/CertificateSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/CollationMatchingRuleFactory.java opendj-sdk/opends/src/server/org/opends/server/schema/CountryStringSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/DITContentRuleSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/DITStructureRuleSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/DeliveryMethodSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/DirectoryStringFirstComponentEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/DirectoryStringSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/DistinguishedNameEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/DistinguishedNameSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/DoubleMetaphoneApproximateMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/EnhancedGuideSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/FaxNumberSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/FaxSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/GeneralizedTimeEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/GeneralizedTimeOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/GeneralizedTimeSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/GuideSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/IA5StringSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/IntegerEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/IntegerFirstComponentEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/IntegerOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/IntegerSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/JPEGSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/LDAPSyntaxDescriptionSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/MatchingRuleSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/MatchingRuleUseSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/NameAndOptionalUIDSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/NameFormSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringSubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/NumericStringSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/OIDSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/ObjectClassSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/ObjectIdentifierEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/ObjectIdentifierFirstComponentEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringSubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/OctetStringSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/OtherMailboxSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/PostalAddressSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/PresentationAddressEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/PresentationAddressSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/PrintableStringSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/ProtocolInformationEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/ProtocolInformationSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/RFC3672SubtreeSpecificationSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/RelativeSubtreeSpecificationSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/SubstringAssertionSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/SupportedAlgorithmSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/TelephoneNumberEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/TelephoneNumberSubstringMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/TelephoneNumberSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/TeletexTerminalIdentifierSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/TelexNumberSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/UTCTimeSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/UUIDEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/UUIDOrderingMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/UUIDSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/UniqueMemberEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordExactEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/schema/UserPasswordSyntax.java opendj-sdk/opends/src/server/org/opends/server/schema/WordEqualityMatchingRule.java opendj-sdk/opends/src/server/org/opends/server/tasks/AddSchemaFileTask.java opendj-sdk/opends/src/server/org/opends/server/tasks/BackupTask.java opendj-sdk/opends/src/server/org/opends/server/tasks/DisconnectClientTask.java opendj-sdk/opends/src/server/org/opends/server/tasks/ShutdownTask.java opendj-sdk/opends/src/server/org/opends/server/tasks/TaskUtils.java opendj-sdk/opends/src/server/org/opends/server/tools/BackUpDB.java opendj-sdk/opends/src/server/org/opends/server/tools/ConsoleDebugLogPublisher.java opendj-sdk/opends/src/server/org/opends/server/tools/DBTest.java opendj-sdk/opends/src/server/org/opends/server/tools/EncodePassword.java opendj-sdk/opends/src/server/org/opends/server/tools/ExportLDIF.java opendj-sdk/opends/src/server/org/opends/server/tools/ImportLDIF.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPAuthenticationHandler.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPCompare.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPConnection.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPDelete.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPModify.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPPasswordModify.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPReader.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPSearch.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPToolOptions.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPToolUtils.java opendj-sdk/opends/src/server/org/opends/server/tools/LDAPWriter.java opendj-sdk/opends/src/server/org/opends/server/tools/LDIFDiff.java opendj-sdk/opends/src/server/org/opends/server/tools/LDIFModify.java opendj-sdk/opends/src/server/org/opends/server/tools/ManageAccount.java opendj-sdk/opends/src/server/org/opends/server/tools/RestoreDB.java opendj-sdk/opends/src/server/org/opends/server/tools/StopDS.java opendj-sdk/opends/src/server/org/opends/server/tools/VerboseTracer.java (deleted) opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/Branch.java opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/TemplateEntry.java opendj-sdk/opends/src/server/org/opends/server/tools/tasks/TaskClient.java opendj-sdk/opends/src/server/org/opends/server/tools/tasks/TaskEntry.java opendj-sdk/opends/src/server/org/opends/server/types/AbstractOperation.java opendj-sdk/opends/src/server/org/opends/server/types/AccountStatusNotification.java opendj-sdk/opends/src/server/org/opends/server/types/AttributeBuilder.java opendj-sdk/opends/src/server/org/opends/server/types/AttributeType.java opendj-sdk/opends/src/server/org/opends/server/types/AttributeValue.java opendj-sdk/opends/src/server/org/opends/server/types/AttributeValues.java opendj-sdk/opends/src/server/org/opends/server/types/Attributes.java opendj-sdk/opends/src/server/org/opends/server/types/ByteArray.java (deleted) opendj-sdk/opends/src/server/org/opends/server/types/ByteSequence.java opendj-sdk/opends/src/server/org/opends/server/types/ByteSequenceReader.java opendj-sdk/opends/src/server/org/opends/server/types/ByteString.java opendj-sdk/opends/src/server/org/opends/server/types/ByteStringBuilder.java opendj-sdk/opends/src/server/org/opends/server/types/ByteStringFactory.java (deleted) opendj-sdk/opends/src/server/org/opends/server/types/CommonSchemaElements.java opendj-sdk/opends/src/server/org/opends/server/types/Control.java opendj-sdk/opends/src/server/org/opends/server/types/CryptoManager.java opendj-sdk/opends/src/server/org/opends/server/types/DITContentRule.java opendj-sdk/opends/src/server/org/opends/server/types/DITStructureRule.java opendj-sdk/opends/src/server/org/opends/server/types/DN.java opendj-sdk/opends/src/server/org/opends/server/types/Entry.java opendj-sdk/opends/src/server/org/opends/server/types/EntryEncodeConfig.java opendj-sdk/opends/src/server/org/opends/server/types/IntermediateResponse.java opendj-sdk/opends/src/server/org/opends/server/types/MatchingRuleUse.java opendj-sdk/opends/src/server/org/opends/server/types/NameForm.java opendj-sdk/opends/src/server/org/opends/server/types/ObjectClass.java opendj-sdk/opends/src/server/org/opends/server/types/Operation.java opendj-sdk/opends/src/server/org/opends/server/types/RDN.java opendj-sdk/opends/src/server/org/opends/server/types/RawAttribute.java opendj-sdk/opends/src/server/org/opends/server/types/RawFilter.java opendj-sdk/opends/src/server/org/opends/server/types/RawModification.java opendj-sdk/opends/src/server/org/opends/server/types/RecordingInputStream.java opendj-sdk/opends/src/server/org/opends/server/types/RecordingOutputStream.java opendj-sdk/opends/src/server/org/opends/server/types/Schema.java opendj-sdk/opends/src/server/org/opends/server/types/SearchFilter.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PluginOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostOperationBindOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostOperationExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseAddOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseBindOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseCompareOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseDeleteOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseModifyDNOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseModifyOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PostResponseSearchOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreOperationBindOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreOperationExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseAddOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseBindOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseCompareOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseDeleteOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseExtendedOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseModifyDNOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/PreParseModifyOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/SearchEntrySearchOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/SearchReferenceSearchOperation.java opendj-sdk/opends/src/server/org/opends/server/types/operation/SubordinateModifyDNOperation.java opendj-sdk/opends/src/server/org/opends/server/util/Base64.java opendj-sdk/opends/src/server/org/opends/server/util/LDIFReader.java opendj-sdk/opends/src/server/org/opends/server/util/LDIFWriter.java opendj-sdk/opends/src/server/org/opends/server/util/ServerConstants.java opendj-sdk/opends/src/server/org/opends/server/util/SizeLimitInputStream.java opendj-sdk/opends/src/server/org/opends/server/util/StaticUtils.java opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendCompareOperation.java opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendDeleteOperation.java opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyDNOperation.java opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java opendj-sdk/opends/src/server/org/opends/server/workflowelement/localbackend/LocalBackendSearchOperation.java opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_targetattr.xml opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/aci_targetfilter.xml opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/aci/multiple_aci_tests.xml opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/dsml/dsml_test.xml opendj-sdk/opends/tests/staf-tests/functional-tests/testcases/replication/changelog/changelog.xml opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/quicksetup/TestUtilities.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/TestCaseUtils.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/RelativeInheritedDefaultBehaviorProviderTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/TestCfg.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/client/ldap/MockLDAPConnection.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/admin/server/DefaultBehaviorTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/api/PasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/authorization/dseecompat/TargetTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/GenericBackendTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/SchemaTestMatchingRule.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestBackendImpl.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestImportJob.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestJebFormat.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestRebuildJob.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestVLVIndex.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/backends/jeb/TestVerifyJob.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/MatchedValuesControlTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/PasswordControlTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/PasswordPolicyControlTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/PersistentSearchControlTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/ProxiedAuthV1ControlTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/ProxiedAuthV2ControlTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/ServerSideSortControlTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/controls/VLVControlTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/AbandonOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/AddOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/BindOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/CompareOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/DeleteOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/IdleTimeLimitTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/ModifyOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/OperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/PluginConfigManagerTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/RejectUnauthReqTests.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/SearchOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/TestModifyDNOperation.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/WorkflowConfigurationTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/MockClientConnection.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/core/networkgroups/NetworkGroupTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/crypto/GetSymmetricKeyExtendedOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/AnonymousSASLMechanismHandlerTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/AttributeValuePasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/CRAMMD5SASLMechanismHandlerTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/CancelExtendedOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/CharacterSetPasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/DictionaryPasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/DigestMD5SASLMechanismHandlerTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/EntryDNVirtualAttributeProviderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/EntryUUIDVirtualAttributeProviderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/ExactMatchIdentityMapperTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/ExternalSASLMechanismHandlerTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/HasSubordinatesVirtualAttributeProviderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/InternalConnectionSecurityProviderTestCase.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/IsMemberOfVirtualAttributeProviderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/LengthBasedPasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/NullConnectionSecurityProviderTestCase.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/NumSubordinatesVirtualAttributeProviderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/PasswordModifyExtendedOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/PasswordStorageSchemeTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/PlainSASLMechanismHandlerTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/RepeatedCharactersPasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/SaltedSHA1PasswordStorageSchemeTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/SimilarityBasedPasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/SubschemaSubentryVirtualAttributeProviderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/TestPasswordValidator.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/UniqueCharactersPasswordValidatorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/UserDefinedVirtualAttributeProviderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/VirtualStaticGroupTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/WhoAmIExtendedOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/monitors/InternalSearchMonitorTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/DelayPreOpPlugin.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/DisconnectClientPlugin.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/EntryUUIDPluginTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/LDAPADListPluginTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/LastModPluginTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/PasswordPolicyImportPluginTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/ShortCircuitPlugin.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/plugins/UniqueAttributePluginTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelReaderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ByteChannelWriterTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ByteSequenceReaderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1InputStreamReaderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1OutputStreamWriterTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1ReaderTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/ASN1WriterTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/SocketReadThread.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/SocketWriteThread.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Boolean.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Element.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Enumerated.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Exception.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Integer.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Long.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Null.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1OctetString.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1ReaderAndWriter.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Sequence.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/asn1/TestASN1Set.java (deleted) opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/internal/InternalLDAPSocketTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/internal/InternalSearchOperationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LDAPBinaryOptionTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LDAPv2TestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/LdapTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestAbandonRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestAddRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestBindResponseProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestCompareRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestDeleteRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestLDAPFilter.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyDNRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestSearchProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestSearchResultEntryProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/protocols/ldap/TestUnbindRequestProtocolOp.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/GenerationIdTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AssuredReplicationPluginTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AttrInfoTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalCsnOrderingTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ModifyConflictTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ValueInfoTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ApproximatematchingRule.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/AttributeSyntaxTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/AttributeTypeSyntaxTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/AuthPasswordEqualityMatchingRuleTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/BitStringSyntaxTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/CollationMatchingRuleTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/ConfigurableAttributeSyntaxTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/EqualLengthApproximateMatchingRule.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/EqualityMatchingRuleTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/OrderingMatchingRuleTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/SubstringMatchingRuleTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/schema/UserPasswordEqualityMatchingRuleTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/DisconnectClientTaskTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/tasks/DummyTask.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPAuthenticationHandlerTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/AttributeBuilderTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteSequenceReaderTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteSequenceTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteStringBuilderTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/ByteStringTest.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/PrivilegeTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/SearchFilterTests.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestAttributeType.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestAttributeValue.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestDN.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestEntry.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestRDN.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/types/VirtualAttributeTestCase.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/util/TestLDIFReader.java opendj-sdk/opends/tests/unit-tests-testng/src/server/org/opends/server/util/TestStaticUtils.java