From d79928cc7cd9a3edf6f6a4dcf213234015cd0590 Mon Sep 17 00:00:00 2001
From: Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Fri, 29 Jan 2016 15:01:25 +0000
Subject: [PATCH] DirectoryServer.java: Renamed getAttributeTypeOrDefault(String) to getAttributeType(String)
---
opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java | 3
opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java | 6
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java | 2
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java | 2
opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java | 4
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargAttrFilterList.java | 2
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java | 2
opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java | 12
opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTargetTask.java | 4
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java | 2
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java | 2
opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java | 4
opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicy.java | 2
opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java | 2
opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java | 4
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java | 2
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/ParentInheritance.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java | 10
opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java | 2
opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java | 2
opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java | 10
opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java | 10
opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java | 6
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java | 9
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java | 6
opendj-server-legacy/src/main/java/org/opends/server/tasks/ResetChangeNumberTask.java | 4
opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java | 4
opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java | 2
opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java | 20
opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetAttrTestCase.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfAbsentTag.java | 16 -
opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java | 24 +-
opendj-server-legacy/src/main/java/org/opends/server/config/ConfigEntry.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java | 2
opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java | 6
opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/extensions/ExternalSASLMechanismHandler.java | 4
opendj-server-legacy/src/test/java/org/opends/server/backends/SchemaBackendTestCase.java | 8
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java | 2
opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java | 2
opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java | 30 +-
opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java | 6
opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java | 6
opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java | 3
opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTask.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tasks/PurgeConflictsHistoricalTask.java | 4
opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerSync.java | 6
opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java | 2
opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java | 4
opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java | 10
opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java | 9
opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java | 42 +-
opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java | 2
opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/AttributeValueTag.java | 16 -
opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java | 8
opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java | 32 +-
opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java | 28 +-
opendj-server-legacy/src/main/java/org/opends/server/tasks/ShutdownTask.java | 4
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java | 10
opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java | 2
opendj-server-legacy/src/main/java/org/opends/server/admin/AdministrationDataSync.java | 8
opendj-server-legacy/src/main/java/org/opends/server/tasks/SetGenerationIdTask.java | 4
opendj-server-legacy/src/main/java/org/opends/server/extensions/VirtualStaticGroup.java | 2
opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java | 8
opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java | 2
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java | 24 +-
opendj-server-legacy/src/test/java/org/opends/server/types/AttributeTypeTest.java | 4
opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java | 4
opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java | 2
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciListenerManager.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java | 6
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfPresentTag.java | 16 -
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargetAttr.java | 2
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java | 2
opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java | 4
opendj-server-legacy/src/main/java/org/opends/server/controls/GetEffectiveRightsRequestControl.java | 2
opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java | 8
opendj-server-legacy/src/main/java/org/opends/server/tasks/RebuildTask.java | 4
opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java | 4
opendj-server-legacy/src/main/java/org/opends/server/tasks/DisconnectClientTask.java | 6
opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java | 9
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java | 8
opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java | 2
opendj-server-legacy/src/main/java/org/opends/server/backends/task/RecurringTask.java | 2
opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java | 4
opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java | 2
opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java | 2
98 files changed, 284 insertions(+), 327 deletions(-)
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
index ac857dc..bb36660 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/datamodel/CustomSearchResult.java
@@ -319,7 +319,7 @@
}
else
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrName);
AttributeBuilder builder = new AttributeBuilder(attribute, true);
for (Object value : getAttributeValues(attrName))
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
index 6e65977..1187183 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/ManageTasksPanel.java
@@ -694,7 +694,7 @@
}
else
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrName);
AttributeBuilder builder = new AttributeBuilder(attribute, true);
for (Object value : csr.getAttributeValues(attrName))
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
index 5161805..9d1350c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/util/Utilities.java
@@ -1488,7 +1488,7 @@
*/
public static String getRDNString(String attrName, String attrValue)
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrName);
RDN rdn = new RDN(attrType, attrName, ByteString.valueOfUtf8(attrValue));
return rdn.toString();
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/AdministrationDataSync.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/AdministrationDataSync.java
index 192e3d9..8779018 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/AdministrationDataSync.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/AdministrationDataSync.java
@@ -109,8 +109,8 @@
return;
}
- AttributeType attrType1 = DirectoryServer.getAttributeTypeOrDefault("adminport".toLowerCase());
- AttributeType attrType2 = DirectoryServer.getAttributeTypeOrDefault("adminEnabled".toLowerCase());
+ AttributeType attrType1 = DirectoryServer.getAttributeType("adminport");
+ AttributeType attrType2 = DirectoryServer.getAttributeType("adminEnabled");
LinkedList<Modification> mods = new LinkedList<>();
mods.add(new Modification(ModificationType.REPLACE, Attributes.create(attrType1, adminPort)));
@@ -137,7 +137,7 @@
String val = getAttr("cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config", "ds-cfg-enabled");
if (val != null)
{
- ldapsPortEnable = "true".equals(val.toLowerCase());
+ ldapsPortEnable = "true".equalsIgnoreCase(val);
}
if (ldapPort == null && ldapsPort == null)
{
@@ -257,7 +257,7 @@
adminConnectorEntry = result.getFirst();
}
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrName);
List<Attribute> attrs = adminConnectorEntry.getAttribute(attrType);
if (!attrs.isEmpty())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java
index 73ba94b..4eb96b1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/AttributeTypePropertyDefinition.java
@@ -163,7 +163,7 @@
String name = value.trim();
AttributeType type = isCheckSchema
? DirectoryServer.getAttributeTypeOrNull(name)
- : DirectoryServer.getAttributeTypeOrDefault(name);
+ : DirectoryServer.getAttributeType(name);
if (type == null) {
throw PropertyException.illegalPropertyValueException(this, value);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java
index e476de8..789adbd 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/ManagedObjectPath.java
@@ -151,7 +151,7 @@
// Now add the single RDN representing the named instance.
String type = profile.getRelationChildRDNType(r);
- AttributeType atype = DirectoryServer.getAttributeTypeOrDefault(type.toLowerCase());
+ AttributeType atype = DirectoryServer.getAttributeType(type);
ByteString avalue = ByteString.valueOfUtf8(name);
dn = dn.child(RDN.create(atype, avalue));
}
@@ -168,7 +168,7 @@
// Now add the single RDN representing the instance.
String type = profile.getRelationChildRDNType(r);
- AttributeType atype = DirectoryServer.getAttributeTypeOrDefault(type.toLowerCase());
+ AttributeType atype = DirectoryServer.getAttributeType(type);
ByteString avalue = ByteString.valueOfUtf8(d.getName());
dn = dn.child(RDN.create(atype, avalue));
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java b/opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
index 089b230..0fd5357 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/admin/server/ServerManagementContext.java
@@ -870,7 +870,7 @@
// undefined. We should log a warning here if this is the case
// since the attribute should have been defined.
String attrID = LDAPProfile.getInstance().getAttributeName(d, pd);
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(attrID);
+ AttributeType type = DirectoryServer.getAttributeType(attrID);
List<Attribute> attributes = configEntry.getEntry().getAttribute(type);
List<ByteString> results = new LinkedList<>();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicy.java b/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicy.java
index 312ed63..fec7980 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicy.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicy.java
@@ -75,7 +75,7 @@
{
// First check to see if the ds-pwp-password-policy-dn is present.
String userDNString = userEntry.getName().toString();
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_POLICY_DN);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_POLICY_DN);
for (Attribute a : userEntry.getAttribute(type))
{
if (a.isEmpty())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java b/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java
index e148c66..204adf2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/AuthenticationPolicyState.java
@@ -281,7 +281,7 @@
*/
public boolean isDisabled()
{
- final AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_ACCOUNT_DISABLED);
+ final AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_ACCOUNT_DISABLED);
try
{
isDisabled = getBoolean(userEntry, type);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
index 89f5294..be0c658 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/CompressedSchema.java
@@ -553,7 +553,7 @@
private AttributeDescription loadAttributeToMaps(final int id, final String attributeName,
final Iterable<String> attributeOptions, final Mappings mappings)
{
- final AttributeType type = DirectoryServer.getAttributeTypeOrDefault(attributeName);
+ final AttributeType type = DirectoryServer.getAttributeType(attributeName);
final Set<String> options = getOptions(attributeOptions);
final AttributeDescription ad = AttributeDescriptions.create(type, options);
exclusiveLock.lock();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java
index dae178e..7d6ffff 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciEffectiveRights.java
@@ -274,7 +274,7 @@
}
else
{
- nonRightsAttrs.add(DirectoryServer.getAttributeTypeOrDefault(a));
+ nonRightsAttrs.add(DirectoryServer.getAttributeType(a));
}
}
}
@@ -406,7 +406,7 @@
// Only add the aclRights information if the aclRights attribute type was seen.
if(hasAttrMask(mask, ACL_RIGHTS)) {
String typeStr = aclRightsAttributeLevelStr + ";" + a.getNameOrOID();
- AttributeType attributeType = DirectoryServer.getAttributeTypeOrDefault(typeStr);
+ AttributeType attributeType = DirectoryServer.getAttributeType(typeStr);
Attribute attr = Attributes.create(attributeType, evalInfo.toString());
//It is possible that the user might have specified the same attributes
//in both the search and the specific attribute part of the control.
@@ -641,7 +641,7 @@
if(hasAttrMask(mask,ACL_RIGHTS_INFO)) {
//Build the attribute type.
String typeStr = aclRightsInfoAttrLogsStr + ";" + rightStr + ";" + aType.getNameOrOID();
- AttributeType attributeType = DirectoryServer.getAttributeTypeOrDefault(typeStr);
+ AttributeType attributeType = DirectoryServer.getAttributeType(typeStr);
Attribute attr = Attributes.create(attributeType, container.getEvalSummary());
// The attribute type might have already been added, probably
// not but it is possible.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
index b2a81c7..3e552d6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciHandler.java
@@ -124,10 +124,10 @@
*/
private static void initStatics()
{
- aciType = getAttributeTypeOrDefault("aci");
- globalAciType = getAttributeTypeOrDefault(ATTR_AUTHZ_GLOBAL_ACI);
- debugSearchIndex = getAttributeTypeOrDefault(SuffixContainer.ATTR_DEBUG_SEARCH_INDEX);
- refAttrType = getAttributeTypeOrDefault(ATTR_REFERRAL_URL);
+ aciType = getAttributeType("aci");
+ globalAciType = getAttributeType(ATTR_AUTHZ_GLOBAL_ACI);
+ debugSearchIndex = getAttributeType(SuffixContainer.ATTR_DEBUG_SEARCH_INDEX);
+ refAttrType = getAttributeType(ATTR_REFERRAL_URL);
try
{
@@ -310,7 +310,7 @@
baseName = toLowerCase(rawAttributeType);
}
- container.setCurrentAttributeType(getAttributeTypeOrDefault(baseName));
+ container.setCurrentAttributeType(getAttributeType(baseName));
container.setCurrentAttributeValue(operation.getAssertionValue());
return isAllowed(container, operation);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciListenerManager.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciListenerManager.java
index 17b12ed..0e8fe74 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciListenerManager.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/AciListenerManager.java
@@ -394,7 +394,7 @@
// Check to make sure that the backend has a presence index defined
// for the ACI attribute. If it does not, then log a warning message
// because this processing could be very expensive.
- AttributeType aciType = DirectoryServer.getAttributeTypeOrDefault("aci");
+ AttributeType aciType = DirectoryServer.getAttributeType("aci");
if (backend.getEntryCount() > 0
&& !backend.isIndexed(aciType, IndexType.PRESENCE))
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/ParentInheritance.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/ParentInheritance.java
index fb97625..db510c8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/ParentInheritance.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/ParentInheritance.java
@@ -220,7 +220,7 @@
* @return The attribute type.
*/
public AttributeType getAttributeType() {
- return DirectoryServer.getAttributeTypeOrDefault(attrTypeStr.toLowerCase());
+ return DirectoryServer.getAttributeType(attrTypeStr);
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargAttrFilterList.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargAttrFilterList.java
index 475a630..a620442 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargAttrFilterList.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargAttrFilterList.java
@@ -132,7 +132,7 @@
attributeName=attributeName.substring(0, semicolon);
}
String filterString=matcher.group(filterPos);
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attributeName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attributeName);
SearchFilter filter;
//Check if it is a valid filter and add it to the list map if ok.
try {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargetAttr.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargetAttr.java
index 6122b72..e28657e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargetAttr.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/TargetAttr.java
@@ -132,7 +132,7 @@
throw new AciException(message);
}
} else {
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attribute);
+ AttributeType attrType = DirectoryServer.getAttributeType(attribute);
if(attrType.isOperational())
{
opAttributes.add(attrType);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java
index 0961109..729b2ea 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/authorization/dseecompat/UserAttr.java
@@ -202,7 +202,7 @@
private EnumEvalResult evalVAL(AciEvalContext evalCtx) {
EnumEvalResult matched= EnumEvalResult.FALSE;
boolean undefined=false;
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrStr);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrStr);
final SearchRequest request = newSearchRequest(evalCtx.getClientDN(), SearchScope.BASE_OBJECT);
InternalSearchOperation op = getRootConnection().processSearch(request);
LinkedList<SearchResultEntry> result = op.getSearchEntries();
@@ -230,7 +230,7 @@
private EnumEvalResult evalURL(AciEvalContext evalCtx) {
EnumEvalResult matched= EnumEvalResult.FALSE;
boolean undefined=false;
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrStr);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrStr);
List<Attribute> attrs=evalCtx.getResourceEntry().getAttribute(attrType);
if(!attrs.isEmpty()) {
for(Attribute a : attrs) {
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java
index 6a7355d..e6101f1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/BackupBackend.java
@@ -281,7 +281,7 @@
int numEntries = 1;
AttributeType backupPathType =
- DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
+ DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
for (File dir : backupDirectories.keySet())
{
@@ -398,7 +398,7 @@
Entry backupDirEntry = getBackupDirectoryEntry(entryDN);
AttributeType t =
- DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
+ DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
List<Attribute> attrList = backupDirEntry.getAttribute(t);
if (!attrList.isEmpty())
{
@@ -493,7 +493,7 @@
throws DirectoryException
{
// Make sure that the DN specifies a backup directory.
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
+ AttributeType t = DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
ByteString v = entryDN.rdn().getAttributeValue(t);
if (v == null)
{
@@ -542,7 +542,7 @@
LinkedHashMap<AttributeType,List<Attribute>> userAttrs = new LinkedHashMap<>(3);
userAttrs.put(t, asList(t, v));
- t = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_BACKEND_DN);
+ t = DirectoryServer.getAttributeType(ATTR_BACKUP_BACKEND_DN);
userAttrs.put(t, asList(t, ByteString.valueOfUtf8(backupDirectory.getConfigEntryDN().toString())));
Entry e = new Entry(entryDN, ocMap, userAttrs, opAttrs);
@@ -568,7 +568,7 @@
throws DirectoryException
{
// First, get the backup ID from the entry DN.
- AttributeType idType = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_ID);
+ AttributeType idType = DirectoryServer.getAttributeType(ATTR_BACKUP_ID);
ByteString idValue = entryDN.rdn().getAttributeValue(idType);
if (idValue == null) {
throw newConstraintViolation(ERR_BACKUP_NO_BACKUP_ID_IN_DN.get(entryDN));
@@ -581,7 +581,7 @@
throw newConstraintViolation(ERR_BACKUP_NO_BACKUP_PARENT_DN.get(entryDN));
}
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
+ AttributeType t = DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
ByteString v = parentDN.rdn().getAttributeValue(t);
if (v == null) {
throw newConstraintViolation(ERR_BACKUP_NO_BACKUP_DIR_IN_DN.get(entryDN));
@@ -630,7 +630,7 @@
Date backupDate = backupInfo.getBackupDate();
if (backupDate != null) {
- t = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DATE);
+ t = DirectoryServer.getAttributeType(ATTR_BACKUP_DATE);
userAttrs.put(t,
asList(t, ByteString.valueOfUtf8(GeneralizedTimeSyntax.format(backupDate))));
}
@@ -641,7 +641,7 @@
HashSet<String> dependencies = backupInfo.getDependencies();
if (dependencies != null && !dependencies.isEmpty()) {
- t = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DEPENDENCY);
+ t = DirectoryServer.getAttributeType(ATTR_BACKUP_DEPENDENCY);
AttributeBuilder builder = new AttributeBuilder(t);
builder.addAllStrings(dependencies);
userAttrs.put(t, builder.toAttributeList());
@@ -660,7 +660,7 @@
HashMap<String, String> properties = backupInfo.getBackupProperties();
if (properties != null && !properties.isEmpty()) {
for (Map.Entry<String, String> e : properties.entrySet()) {
- t = DirectoryServer.getAttributeTypeOrDefault(toLowerCase(e.getKey()));
+ t = DirectoryServer.getAttributeType(toLowerCase(e.getKey()));
userAttrs.put(t, asList(t, ByteString.valueOfUtf8(e.getValue())));
}
}
@@ -672,13 +672,13 @@
private void putByteString(LinkedHashMap<AttributeType, List<Attribute>> userAttrs, String attrName, byte[] value)
{
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType t = DirectoryServer.getAttributeType(attrName);
userAttrs.put(t, asList(t, ByteString.wrap(value)));
}
private void putBoolean(LinkedHashMap<AttributeType, List<Attribute>> attrsMap, String attrName, boolean value)
{
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType t = DirectoryServer.getAttributeType(attrName);
attrsMap.put(t, asList(t, createBooleanValue(value)));
}
@@ -764,7 +764,7 @@
if (scope != SearchScope.BASE_OBJECT && !backupDirectories.isEmpty())
{
AttributeType backupPathType =
- DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
+ DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
for (File dir : backupDirectories.keySet())
{
// Check to see if the descriptor file exists. If not, then skip this
@@ -818,7 +818,7 @@
if (scope != SearchScope.BASE_OBJECT)
{
AttributeType t =
- DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
+ DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
List<Attribute> attrList = backupDirEntry.getAttribute(t);
returnEntries(searchOperation, baseDN, filter, attrList);
}
@@ -858,7 +858,7 @@
{
File dir = new File(v.toString());
BackupDirectory backupDirectory = backupDirectories.get(dir).getBackupDirectory();
- AttributeType idType = DirectoryServer.getAttributeTypeOrDefault(ATTR_BACKUP_ID);
+ AttributeType idType = DirectoryServer.getAttributeType(ATTR_BACKUP_ID);
for (String backupID : backupDirectory.getBackups().keySet())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java
index 485c6ef..c3e8767 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/ChangelogBackend.java
@@ -200,10 +200,10 @@
/** The attribute type for the "creatorsName" attribute. */
private static final AttributeType CREATORS_NAME_TYPE =
- DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_CREATORS_NAME_LC);
+ DirectoryServer.getAttributeType(OP_ATTR_CREATORS_NAME_LC);
/** The attribute type for the "modifiersName" attribute. */
private static final AttributeType MODIFIERS_NAME_TYPE =
- DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_MODIFIERS_NAME_LC);
+ DirectoryServer.getAttributeType(OP_ATTR_MODIFIERS_NAME_LC);
/** The base DN for the external change log. */
public static final DN CHANGELOG_BASE_DN;
@@ -720,7 +720,7 @@
private SearchFilter buildSearchFilterFrom(final DN baseDN, final String attrName)
{
final RDN rdn = baseDN.rdn();
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrName);
final ByteString attrValue = rdn.getAttributeValue(attrType);
if (attrValue != null)
{
@@ -1502,7 +1502,7 @@
final Map<AttributeType, List<Attribute>> userAttrs,
final Map<AttributeType, List<Attribute>> operationalAttrs, final boolean addByType)
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrNameUppercase);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrNameUppercase);
final Attribute a = addByType
? Attributes.create(attrType, attrValue)
: Attributes.create(attrNameUppercase, attrValue);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
index 2fc9ad6..23ed22d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/RootDSEBackend.java
@@ -583,7 +583,7 @@
*/
private Attribute createAttribute(String name, Collection<? extends Object> values)
{
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(name);
+ AttributeType type = DirectoryServer.getAttributeType(name);
AttributeBuilder builder = new AttributeBuilder(type, name);
builder.addAllStrings(values);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
index 6198e7e..6989716 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/SchemaBackend.java
@@ -217,20 +217,20 @@
configEntryDN = configEntry.getDN();
// Get all of the attribute types that we will use for schema elements.
- attributeTypesType = getAttributeTypeOrDefault(ATTR_ATTRIBUTE_TYPES_LC);
- objectClassesType = getAttributeTypeOrDefault(ATTR_OBJECTCLASSES_LC);
- matchingRulesType = getAttributeTypeOrDefault(ATTR_MATCHING_RULES_LC);
- ldapSyntaxesType = getAttributeTypeOrDefault(ATTR_LDAP_SYNTAXES_LC);
- ditContentRulesType = getAttributeTypeOrDefault(ATTR_DIT_CONTENT_RULES_LC);
- ditStructureRulesType = getAttributeTypeOrDefault(ATTR_DIT_STRUCTURE_RULES_LC);
- matchingRuleUsesType = getAttributeTypeOrDefault(ATTR_MATCHING_RULE_USE_LC);
- nameFormsType = getAttributeTypeOrDefault(ATTR_NAME_FORMS_LC);
+ attributeTypesType = getAttributeType(ATTR_ATTRIBUTE_TYPES_LC);
+ objectClassesType = getAttributeType(ATTR_OBJECTCLASSES_LC);
+ matchingRulesType = getAttributeType(ATTR_MATCHING_RULES_LC);
+ ldapSyntaxesType = getAttributeType(ATTR_LDAP_SYNTAXES_LC);
+ ditContentRulesType = getAttributeType(ATTR_DIT_CONTENT_RULES_LC);
+ ditStructureRulesType = getAttributeType(ATTR_DIT_STRUCTURE_RULES_LC);
+ matchingRuleUsesType = getAttributeType(ATTR_MATCHING_RULE_USE_LC);
+ nameFormsType = getAttributeType(ATTR_NAME_FORMS_LC);
// Initialize the lastmod attributes.
- creatorsNameType = getAttributeTypeOrDefault(OP_ATTR_CREATORS_NAME_LC);
- createTimestampType = getAttributeTypeOrDefault(OP_ATTR_CREATE_TIMESTAMP_LC);
- modifiersNameType = getAttributeTypeOrDefault(OP_ATTR_MODIFIERS_NAME_LC);
- modifyTimestampType = getAttributeTypeOrDefault(OP_ATTR_MODIFY_TIMESTAMP_LC);
+ creatorsNameType = getAttributeType(OP_ATTR_CREATORS_NAME_LC);
+ createTimestampType = getAttributeType(OP_ATTR_CREATE_TIMESTAMP_LC);
+ modifiersNameType = getAttributeType(OP_ATTR_MODIFIERS_NAME_LC);
+ modifyTimestampType = getAttributeType(OP_ATTR_MODIFY_TIMESTAMP_LC);
// Construct the set of objectclasses to include in the schema entry.
schemaObjectClasses = new LinkedHashMap<>(3);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java
index 7651a14..b806d4a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/TrustStoreBackend.java
@@ -435,7 +435,7 @@
throws DirectoryException
{
// Make sure that the DN specifies a certificate alias.
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(ATTR_CRYPTO_KEY_ID);
+ AttributeType t = DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID);
ByteString v = entryDN.rdn().getAttributeValue(t);
if (v == null)
{
@@ -478,7 +478,7 @@
userAttrs.put(t, Attributes.createAsList(t, v));
- t = DirectoryServer.getAttributeTypeOrDefault(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE);
+ t = DirectoryServer.getAttributeType(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE);
AttributeBuilder builder = new AttributeBuilder(t);
builder.setOption("binary");
builder.add(certValue);
@@ -601,7 +601,7 @@
if (scope != SearchScope.BASE_OBJECT && aliases.length != 0)
{
- AttributeType certAliasType = DirectoryServer.getAttributeTypeOrDefault(ATTR_CRYPTO_KEY_ID);
+ AttributeType certAliasType = DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID);
for (String alias : aliases)
{
DN certDN = makeChildDN(this.baseDN, certAliasType, alias);
@@ -1184,7 +1184,7 @@
DN entryDN = entry.getName();
// Make sure that the DN specifies a certificate alias.
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(ATTR_CRYPTO_KEY_ID);
+ AttributeType t = DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID);
ByteString v = entryDN.rdn().getAttributeValue(t);
if (v == null)
{
@@ -1311,7 +1311,7 @@
throws DirectoryException
{
// Make sure that the DN specifies a certificate alias.
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(ATTR_CRYPTO_KEY_ID);
+ AttributeType t = DirectoryServer.getAttributeType(ATTR_CRYPTO_KEY_ID);
ByteString v = entryDN.rdn().getAttributeValue(t);
if (v == null)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/RecurringTask.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/RecurringTask.java
index 9d89b13..6901f9c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/RecurringTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/RecurringTask.java
@@ -243,7 +243,7 @@
private Attribute getSingleAttribute(Entry taskEntry, String attrName, Arg1<Object> noEntryErrorMsg,
Arg1<Object> multipleEntriesErrorMsg, Arg1<Object> noAttrValueErrorMsg) throws DirectoryException
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrName);
List<Attribute> attrList = taskEntry.getAttribute(attrType);
if (attrList.isEmpty())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
index ca78e72..ca15c5b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/Task.java
@@ -844,7 +844,7 @@
String messageString = buffer.toString();
logMessages.add(messageString);
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_LOG_MESSAGES);
+ AttributeType type = DirectoryServer.getAttributeType(ATTR_TASK_LOG_MESSAGES);
final List<Attribute> attrList = taskEntry.getAttribute(type);
ByteString value = ByteString.valueOfUtf8(messageString);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java
index 641892d..a49102e 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/backends/task/TaskScheduler.java
@@ -1802,7 +1802,7 @@
throws DirectoryException
{
// Get the name of the class that implements the task logic.
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_CLASS);
+ AttributeType attrType = DirectoryServer.getAttributeType(ATTR_TASK_CLASS);
List<Attribute> attrList = entry.getAttribute(attrType);
if (attrList.isEmpty())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigEntry.java
index f4865a5..96efdce 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/ConfigEntry.java
@@ -195,7 +195,7 @@
*/
public ConfigAttribute getConfigAttribute(ConfigAttribute stub) throws ConfigException
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(stub.getName());
+ AttributeType attrType = DirectoryServer.getAttributeType(stub.getName());
List<Attribute> attrList = entry.getAttribute(attrType);
return !attrList.isEmpty() ? stub.getConfigAttribute(attrList) : null;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java b/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
index d19373d..813b269 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/config/JMXMBean.java
@@ -399,7 +399,7 @@
{
// It's possible that this is a monitor attribute rather than a configurable
// one. Check all of those.
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name);
+ AttributeType attrType = DirectoryServer.getAttributeType(name);
for (MonitorProvider<? extends MonitorProviderCfg> monitor : monitorProviders)
{
for (org.opends.server.types.Attribute a : monitor.getMonitorData())
@@ -581,7 +581,7 @@
// It's possible that this is a monitor attribute rather than a
// configurable one. Check all of those.
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name);
+ AttributeType attrType = DirectoryServer.getAttributeType(name);
monitorLoop:
for (MonitorProvider<? extends MonitorProviderCfg> monitor :
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/controls/GetEffectiveRightsRequestControl.java b/opendj-server-legacy/src/main/java/org/opends/server/controls/GetEffectiveRightsRequestControl.java
index 84fc255..0fe2956 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/controls/GetEffectiveRightsRequestControl.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/controls/GetEffectiveRightsRequestControl.java
@@ -120,7 +120,7 @@
reader.readStartSequence();
while(reader.hasNextElement()) {
String attrStr = reader.readOctetStringAsString();
- attrs.add(DirectoryServer.getAttributeTypeOrDefault(attrStr));
+ attrs.add(DirectoryServer.getAttributeType(attrStr));
}
reader.readEndSequence();
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java b/opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java
index 12045b3..b836eb2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/controls/MatchedValuesFilter.java
@@ -839,7 +839,7 @@
{
if (attributeType == null && rawAttributeType != null)
{
- attributeType = DirectoryServer.getAttributeTypeOrDefault(rawAttributeType);
+ attributeType = DirectoryServer.getAttributeType(rawAttributeType);
}
return attributeType;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java b/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java
index 77ec319..6f31157 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/CompareOperationBasis.java
@@ -233,7 +233,7 @@
baseName = toLowerCase(rawAttributeType);
attributeOptions = null;
}
- attributeType = DirectoryServer.getAttributeTypeOrDefault(baseName);
+ attributeType = DirectoryServer.getAttributeType(baseName);
}
/** {@inheritDoc} */
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java b/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
index d0441c2..f2aa8c8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -2526,19 +2526,18 @@
}
/**
- * Retrieves the attribute type for the provided lowercase name or OID. It
+ * Retrieves the attribute type for the provided name or OID. It
* can optionally return a generated "default" version if the requested
* attribute type is not defined in the schema.
*
- * @param lowerName The lowercase name or OID for the attribute type to
- * retrieve.
+ * @param nameOrOid The name or OID for the attribute type to retrieve.
* @return The requested attribute type, or <CODE>null</CODE> if there is no
* attribute with the specified type defined in the server schema and
* a default type should not be returned.
*/
- public static AttributeType getAttributeTypeOrDefault(String lowerName)
+ public static AttributeType getAttributeType(String nameOrOid)
{
- return getAttributeType(lowerName, getDefaultAttributeSyntax());
+ return getAttributeType(nameOrOid, getDefaultAttributeSyntax());
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java b/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java
index ba9fe9b..59de58b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/PasswordPolicyState.java
@@ -343,7 +343,7 @@
private long getGeneralizedTime0(Entry userEntry, String attrName) throws DirectoryException
{
- return getGeneralizedTime(userEntry, DirectoryServer.getAttributeTypeOrDefault(attrName));
+ return getGeneralizedTime(userEntry, DirectoryServer.getAttributeType(attrName));
}
/**
@@ -626,7 +626,7 @@
return authFailureTimes;
}
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_FAILURE_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_FAILURE_TIME);
try
{
authFailureTimes = getGeneralizedTimes(type);
@@ -719,7 +719,7 @@
failureTimes.add(highestFailureTime);
// And the attribute in the user entry
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_FAILURE_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_FAILURE_TIME);
Attribute addAttr = Attributes.create(type, GeneralizedTimeSyntax.format(highestFailureTime));
modifications.add(new Modification(ModificationType.ADD, addAttr, true));
@@ -799,7 +799,7 @@
failureTimes.clear(); // Note: failureTimes != this.authFailureTimes
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_FAILURE_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_FAILURE_TIME);
modifications.add(new Modification(ModificationType.REPLACE, Attributes.empty(type), true));
}
@@ -816,7 +816,7 @@
return failureLockedTime;
}
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_LOCKED_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_LOCKED_TIME);
try
{
failureLockedTime = getGeneralizedTime(userEntry, type);
@@ -849,7 +849,7 @@
failureLockedTime = time;
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_LOCKED_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_LOCKED_TIME);
Attribute a = Attributes.create(type, GeneralizedTimeSyntax.format(failureLockedTime));
modifications.add(new Modification(ModificationType.REPLACE, a, true));
}
@@ -873,7 +873,7 @@
failureLockedTime = -1L;
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_LOCKED_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_LOCKED_TIME);
modifications.add(new Modification(ModificationType.REPLACE, Attributes.empty(type), true));
}
@@ -1308,7 +1308,7 @@
return false;
}
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_RESET_REQUIRED);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_RESET_REQUIRED);
try
{
mustChangePassword = getBoolean(userEntry, type);
@@ -1355,7 +1355,7 @@
return; // requested state matches current state
}
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_RESET_REQUIRED);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_RESET_REQUIRED);
this.mustChangePassword = ConditionResult.not(this.mustChangePassword);
if (mustChangePassword)
{
@@ -1901,7 +1901,7 @@
this.warnedTime = warnedTime;
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_WARNED_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_WARNED_TIME);
Attribute a = Attributes.create(type, GeneralizedTimeSyntax.createGeneralizedTimeValue(currentTime));
modifications.add(new Modification(ModificationType.REPLACE, a, true));
@@ -1950,7 +1950,7 @@
{
if (graceLoginTimes == null)
{
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
try
{
graceLoginTimes = getGeneralizedTimes(type);
@@ -2004,7 +2004,7 @@
long highestGraceTime = computeHighestTime(graceTimes);
graceTimes.add(highestGraceTime); // graceTimes == this.graceLoginTimes
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
Attribute addAttr = Attributes.create(type, GeneralizedTimeSyntax.format(highestGraceTime));
modifications.add(new Modification(ModificationType.ADD, addAttr, true));
}
@@ -2080,7 +2080,7 @@
}
graceTimes.clear(); // graceTimes == this.graceLoginTimes
- AttributeType type = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
+ AttributeType type = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_GRACE_LOGIN_TIME);
modifications.add(new Modification(ModificationType.REPLACE, Attributes.empty(type), true));
}
@@ -2567,7 +2567,7 @@
private TreeMap<Long,ByteString> getSortedHistoryValues(List<Attribute> removeAttrs)
{
TreeMap<Long, ByteString> historyMap = new TreeMap<>();
- AttributeType historyType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_HISTORY_LC);
+ AttributeType historyType = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_HISTORY_LC);
for (Attribute a : userEntry.getAttribute(historyType))
{
for (ByteString v : a)
@@ -2785,7 +2785,7 @@
// If there is a maximum number of values to retain and we would be over the limit with the new value,
// then get rid of enough values (oldest first) to satisfy the count.
- AttributeType historyType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_HISTORY_LC);
+ AttributeType historyType = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_HISTORY_LC);
int historyCount = passwordPolicy.getPasswordHistoryCount();
if (historyCount > 0 && historyMap.size() >= historyCount)
{
@@ -2886,7 +2886,7 @@
public String[] getPasswordHistoryValues()
{
ArrayList<String> historyValues = new ArrayList<>();
- AttributeType historyType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_HISTORY_LC);
+ AttributeType historyType = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_HISTORY_LC);
for (Attribute a : userEntry.getAttribute(historyType))
{
for (ByteString v : a)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java b/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java
index 7d4e677..eca9d7f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/core/SubentryPasswordPolicy.java
@@ -249,7 +249,7 @@
objectClasses.containsKey(pwdValidatorPolicyOC))
{
AttributeType pwdAttrType =
- DirectoryServer.getAttributeTypeOrDefault(PWD_ATTR_VALIDATOR);
+ DirectoryServer.getAttributeType(PWD_ATTR_VALIDATOR);
for (Attribute attr : entry.getAttribute(pwdAttrType))
{
for (ByteString val : attr)
@@ -372,7 +372,7 @@
*/
private String getAttrValue(Entry entry, String pwdAttrName)
{
- AttributeType pwdAttrType = DirectoryServer.getAttributeTypeOrDefault(pwdAttrName);
+ AttributeType pwdAttrType = DirectoryServer.getAttributeType(pwdAttrName);
for (Attribute attr : entry.getAttribute(pwdAttrType))
{
for (ByteString value : attr)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerSync.java b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerSync.java
index c2fb0ce..551bf4f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerSync.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/crypto/CryptoManagerSync.java
@@ -167,9 +167,9 @@
ocCipherKey = DirectoryServer.getObjectClass(OC_CRYPTO_CIPHER_KEY, true);
ocMacKey = DirectoryServer.getObjectClass(OC_CRYPTO_MAC_KEY, true);
- attrCert = getAttributeTypeOrDefault(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE);
- attrAlias = getAttributeTypeOrDefault(ATTR_CRYPTO_KEY_ID);
- attrCompromisedTime = getAttributeTypeOrDefault(ATTR_CRYPTO_KEY_COMPROMISED_TIME);
+ attrCert = getAttributeType(ATTR_CRYPTO_PUBLIC_KEY_CERTIFICATE);
+ attrAlias = getAttributeType(ATTR_CRYPTO_KEY_ID);
+ attrCompromisedTime = getAttributeType(ATTR_CRYPTO_KEY_COMPROMISED_TIME);
if (DirectoryServer.getBackendWithBaseDN(adminSuffixDN) != null)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
index 8fb13de..ba0af0d 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ConfigFileHandler.java
@@ -1128,7 +1128,7 @@
}
AttributeType privType =
- DirectoryServer.getAttributeTypeOrDefault(ATTR_DEFAULT_ROOT_PRIVILEGE_NAME);
+ DirectoryServer.getAttributeType(ATTR_DEFAULT_ROOT_PRIVILEGE_NAME);
for (Modification m : modifyOperation.getModifications())
{
if (m.getAttribute().getAttributeType().equals(privType))
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java
index 2bc2cdf..3a3ea25 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/DynamicGroup.java
@@ -136,7 +136,7 @@
// Get the memberURL attribute from the entry, if there is one, and parse
// out the LDAP URLs that it contains.
LinkedHashSet<LDAPURL> memberURLs = new LinkedHashSet<>();
- AttributeType memberURLType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MEMBER_URL_LC);
+ AttributeType memberURLType = DirectoryServer.getAttributeType(ATTR_MEMBER_URL_LC);
for (Attribute a : groupEntry.getAttribute(memberURLType))
{
for (ByteString v : a)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExternalSASLMechanismHandler.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExternalSASLMechanismHandler.java
index 705b3b0..50f4242 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExternalSASLMechanismHandler.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/ExternalSASLMechanismHandler.java
@@ -127,7 +127,7 @@
if (certificateAttributeType == null)
{
certificateAttributeType =
- DirectoryServer.getAttributeTypeOrDefault(DEFAULT_VALIDATION_CERT_ATTRIBUTE);
+ DirectoryServer.getAttributeType(DEFAULT_VALIDATION_CERT_ATTRIBUTE);
}
@@ -389,7 +389,7 @@
if (newCertificateType == null)
{
newCertificateType =
- DirectoryServer.getAttributeTypeOrDefault(DEFAULT_VALIDATION_CERT_ATTRIBUTE);
+ DirectoryServer.getAttributeType(DEFAULT_VALIDATION_CERT_ATTRIBUTE);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
index f340d51..0c1df84 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -1514,10 +1514,8 @@
{
super(userEntry);
- this.cachedPasswordAttribute = DirectoryServer.getAttributeTypeOrDefault(
- OP_ATTR_PTAPOLICY_CACHED_PASSWORD);
- this.cachedPasswordTimeAttribute = DirectoryServer.getAttributeTypeOrDefault(
- OP_ATTR_PTAPOLICY_CACHED_PASSWORD_TIME);
+ this.cachedPasswordAttribute = DirectoryServer.getAttributeType(OP_ATTR_PTAPOLICY_CACHED_PASSWORD);
+ this.cachedPasswordTimeAttribute = DirectoryServer.getAttributeType(OP_ATTR_PTAPOLICY_CACHED_PASSWORD_TIME);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java
index ca65fdc..6b9ba59 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/StaticGroup.java
@@ -178,7 +178,7 @@
throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message);
}
- someMemberAttributeType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MEMBER);
+ someMemberAttributeType = DirectoryServer.getAttributeType(ATTR_MEMBER);
}
else if (hasGroupOfNamesClass)
{
@@ -189,11 +189,11 @@
throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message);
}
- someMemberAttributeType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MEMBER);
+ someMemberAttributeType = DirectoryServer.getAttributeType(ATTR_MEMBER);
}
else if (hasGroupOfUniqueNamesClass)
{
- someMemberAttributeType = DirectoryServer.getAttributeTypeOrDefault(ATTR_UNIQUE_MEMBER_LC);
+ someMemberAttributeType = DirectoryServer.getAttributeType(ATTR_UNIQUE_MEMBER_LC);
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/extensions/VirtualStaticGroup.java b/opendj-server-legacy/src/main/java/org/opends/server/extensions/VirtualStaticGroup.java
index fe91446..5efe138 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/extensions/VirtualStaticGroup.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/extensions/VirtualStaticGroup.java
@@ -129,7 +129,7 @@
// Get the target group DN attribute from the entry, if there is one.
DN targetDN = null;
- AttributeType targetType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TARGET_GROUP_DN);
+ AttributeType targetType = DirectoryServer.getAttributeType(ATTR_TARGET_GROUP_DN);
for (Attribute a : groupEntry.getAttribute(targetType))
{
for (ByteString v : a)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
index f2a3460..3a6a1ae 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/BackendMonitor.java
@@ -86,12 +86,12 @@
{
monitorName = backend.getBackendID() + " Backend";
- backendIDType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_BACKEND_ID);
- baseDNType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_BACKEND_BASE_DN);
- entryCountType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_BACKEND_ENTRY_COUNT);
- baseDNEntryCountType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_BASE_DN_ENTRY_COUNT);
- isPrivateType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_BACKEND_IS_PRIVATE);
- writabilityModeType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_BACKEND_WRITABILITY_MODE);
+ backendIDType = DirectoryServer.getAttributeType(ATTR_MONITOR_BACKEND_ID);
+ baseDNType = DirectoryServer.getAttributeType(ATTR_MONITOR_BACKEND_BASE_DN);
+ entryCountType = DirectoryServer.getAttributeType(ATTR_MONITOR_BACKEND_ENTRY_COUNT);
+ baseDNEntryCountType = DirectoryServer.getAttributeType(ATTR_MONITOR_BASE_DN_ENTRY_COUNT);
+ isPrivateType = DirectoryServer.getAttributeType(ATTR_MONITOR_BACKEND_IS_PRIVATE);
+ writabilityModeType = DirectoryServer.getAttributeType(ATTR_MONITOR_BACKEND_WRITABILITY_MODE);
}
@Override
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java
index 4d76fdd..6008eb1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/monitors/ConnectionHandlerMonitor.java
@@ -96,11 +96,11 @@
{
monitorName = connectionHandler.getConnectionHandlerName();
- connectionsType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_CONNHANDLER_CONNECTION);
- listenerType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_CONNHANDLER_LISTENER);
- numConnectionsType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_CONNHANDLER_NUMCONNECTIONS);
- protocolType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_CONNHANDLER_PROTOCOL);
- configDnType = DirectoryServer.getAttributeTypeOrDefault(ATTR_MONITOR_CONFIG_DN);
+ connectionsType = DirectoryServer.getAttributeType(ATTR_MONITOR_CONNHANDLER_CONNECTION);
+ listenerType = DirectoryServer.getAttributeType(ATTR_MONITOR_CONNHANDLER_LISTENER);
+ numConnectionsType = DirectoryServer.getAttributeType(ATTR_MONITOR_CONNHANDLER_NUMCONNECTIONS);
+ protocolType = DirectoryServer.getAttributeType(ATTR_MONITOR_CONNHANDLER_PROTOCOL);
+ configDnType = DirectoryServer.getAttributeType(ATTR_MONITOR_CONFIG_DN);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java
index e2c2d2b..78dae82 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/EntryUUIDPlugin.java
@@ -72,7 +72,7 @@
/** Mandatory default constructor of this Directory Server plugin. */
public EntryUUIDPlugin()
{
- entryUUIDType = DirectoryServer.getAttributeTypeOrDefault(ENTRYUUID);
+ entryUUIDType = DirectoryServer.getAttributeType(ENTRYUUID);
}
@Override
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java
index 545f4ef..1324d24 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/LastModPlugin.java
@@ -90,10 +90,10 @@
// Get the attribute types for the attributes that we will use. This needs
// to be done in the constructor in order to make the associated variables "final".
- createTimestampType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_CREATE_TIMESTAMP_LC);
- creatorsNameType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_CREATORS_NAME_LC);
- modifiersNameType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_MODIFIERS_NAME_LC);
- modifyTimestampType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_MODIFY_TIMESTAMP_LC);
+ createTimestampType = DirectoryServer.getAttributeType(OP_ATTR_CREATE_TIMESTAMP_LC);
+ creatorsNameType = DirectoryServer.getAttributeType(OP_ATTR_CREATORS_NAME_LC);
+ modifiersNameType = DirectoryServer.getAttributeType(OP_ATTR_MODIFIERS_NAME_LC);
+ modifyTimestampType = DirectoryServer.getAttributeType(OP_ATTR_MODIFY_TIMESTAMP_LC);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
index 9ec0483..598abaf 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/plugins/PasswordPolicyImportPlugin.java
@@ -123,8 +123,7 @@
{
configuration.addPasswordPolicyImportChangeListener(this);
- customPolicyAttribute =
- DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PWPOLICY_POLICY_DN);
+ customPolicyAttribute = DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_POLICY_DN);
// Make sure that the plugin has been enabled for the appropriate types.
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
index 261042c..2ba2c0a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/internal/InternalClientConnection.java
@@ -126,7 +126,7 @@
put(userAttrs, ATTR_SN, commonName);
put(userAttrs, ATTR_ROOTDN_ALTERNATE_BIND_DN, shortDNString);
- AttributeType privType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PRIVILEGE_NAME);
+ AttributeType privType = DirectoryServer.getAttributeType(OP_ATTR_PRIVILEGE_NAME);
AttributeBuilder builder = new AttributeBuilder(privType);
for (Privilege p : Privilege.getDefaultRootPrivileges())
{
@@ -166,7 +166,7 @@
private void put(Map<AttributeType, List<Attribute>> Attrs, String attrName, String value)
{
List<Attribute> attrs = newLinkedList(Attributes.create(attrName, value));
- Attrs.put(DirectoryServer.getAttributeTypeOrDefault(attrName), attrs);
+ Attrs.put(DirectoryServer.getAttributeType(attrName), attrs);
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
index 272efc8..713ebc3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/protocols/ldap/LDAPFilter.java
@@ -1910,7 +1910,7 @@
if (semicolonPos > 0)
{
String baseName = attributeType.substring(0, semicolonPos);
- attrType = DirectoryServer.getAttributeTypeOrDefault(baseName);
+ attrType = DirectoryServer.getAttributeType(baseName);
options = new HashSet<>();
StringTokenizer tokenizer =
new StringTokenizer(attributeType.substring(semicolonPos+1), ";");
@@ -1922,7 +1922,7 @@
else
{
options = null;
- attrType = DirectoryServer.getAttributeTypeOrDefault(attributeType);
+ attrType = DirectoryServer.getAttributeType(attributeType);
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
index 000280c..e2682c2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalAttributeValue.java
@@ -126,7 +126,7 @@
{
// This HistVal was used to store the date when some
// modifications were done to the entries.
- attrType = DirectoryServer.getAttributeTypeOrDefault(attrString);
+ attrType = DirectoryServer.getAttributeType(attrString);
}
else
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
index 184669f..54b9ff1 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/replication/plugin/LDAPReplicationDomain.java
@@ -3427,7 +3427,7 @@
Set<AttributeType> includeAttributes = new HashSet<>();
for (String attrName : includeAttributeStrings)
{
- includeAttributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
+ includeAttributes.add(DirectoryServer.getAttributeType(attrName));
}
exportConfig.setIncludeAttributes(includeAttributes);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
index 6fc97fb..509b05f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/AddSchemaFileTask.java
@@ -93,7 +93,7 @@
// Get the attribute that specifies which schema file(s) to add.
Entry taskEntry = getTaskEntry();
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_ADDSCHEMAFILE_FILENAME);
+ AttributeType attrType = DirectoryServer.getAttributeType(ATTR_TASK_ADDSCHEMAFILE_FILENAME);
List<Attribute> attrList = taskEntry.getAttribute(attrType);
if (attrList.isEmpty())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
index 6453ec8..b9fce8a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/BackupTask.java
@@ -148,16 +148,16 @@
Entry taskEntry = getTaskEntry();
- AttributeType typeBackupAll = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_ALL);
- AttributeType typeCompress = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_COMPRESS);
- AttributeType typeEncrypt = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_ENCRYPT);
- AttributeType typeHash = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_HASH);
- AttributeType typeIncremental = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_INCREMENTAL);
- AttributeType typeSignHash = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_SIGN_HASH);
- AttributeType typeBackendID = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_BACKEND_ID);
- AttributeType typeBackupID = getAttributeTypeOrDefault(ATTR_BACKUP_ID);
- AttributeType typeBackupDirectory = getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
- AttributeType typeIncrementalBaseID = getAttributeTypeOrDefault(ATTR_TASK_BACKUP_INCREMENTAL_BASE_ID);
+ AttributeType typeBackupAll = getAttributeType(ATTR_TASK_BACKUP_ALL);
+ AttributeType typeCompress = getAttributeType(ATTR_TASK_BACKUP_COMPRESS);
+ AttributeType typeEncrypt = getAttributeType(ATTR_TASK_BACKUP_ENCRYPT);
+ AttributeType typeHash = getAttributeType(ATTR_TASK_BACKUP_HASH);
+ AttributeType typeIncremental = getAttributeType(ATTR_TASK_BACKUP_INCREMENTAL);
+ AttributeType typeSignHash = getAttributeType(ATTR_TASK_BACKUP_SIGN_HASH);
+ AttributeType typeBackendID = getAttributeType(ATTR_TASK_BACKUP_BACKEND_ID);
+ AttributeType typeBackupID = getAttributeType(ATTR_BACKUP_ID);
+ AttributeType typeBackupDirectory = getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
+ AttributeType typeIncrementalBaseID = getAttributeType(ATTR_TASK_BACKUP_INCREMENTAL_BASE_ID);
backUpAll = TaskUtils.getBoolean(taskEntry.getAttribute(typeBackupAll), false);
compress = TaskUtils.getBoolean(taskEntry.getAttribute(typeCompress), false);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/DisconnectClientTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/DisconnectClientTask.java
index 3d822a6..7f79b80 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/DisconnectClientTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/DisconnectClientTask.java
@@ -103,7 +103,7 @@
private long getConnectionID(Entry taskEntry) throws DirectoryException
{
- final AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_DISCONNECT_CONN_ID);
+ final AttributeType attrType = DirectoryServer.getAttributeType(ATTR_TASK_DISCONNECT_CONN_ID);
for (Attribute a : taskEntry.getAttribute(attrType))
{
for (ByteString v : a)
@@ -124,7 +124,7 @@
private boolean mustNotifyClient(Entry taskEntry) throws DirectoryException
{
- final AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_DISCONNECT_NOTIFY_CLIENT);
+ final AttributeType attrType = DirectoryServer.getAttributeType(ATTR_TASK_DISCONNECT_NOTIFY_CLIENT);
for (Attribute a : taskEntry.getAttribute(attrType))
{
for (ByteString v : a)
@@ -150,7 +150,7 @@
private LocalizableMessage getDisconnectMessage(Entry taskEntry)
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_TASK_DISCONNECT_MESSAGE);
+ AttributeType attrType = DirectoryServer.getAttributeType(ATTR_TASK_DISCONNECT_MESSAGE);
for (Attribute a : taskEntry.getAttribute(attrType))
{
for (ByteString v : a)
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java
index fdaae78..ba32773 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ExportTask.java
@@ -140,7 +140,7 @@
Entry taskEntry = getTaskEntry();
- AttributeType typeWrapColumn = getAttributeTypeOrDefault(ATTR_TASK_EXPORT_WRAP_COLUMN);
+ AttributeType typeWrapColumn = getAttributeType(ATTR_TASK_EXPORT_WRAP_COLUMN);
ldifFile = toString(taskEntry, ATTR_TASK_EXPORT_LDIF_FILE);
File f = new File (ldifFile);
@@ -177,21 +177,21 @@
private boolean toBoolean(Entry entry, boolean defaultValue, String attrName)
{
- final AttributeType attrType = getAttributeTypeOrDefault(attrName);
+ final AttributeType attrType = getAttributeType(attrName);
final List<Attribute> attrs = entry.getAttribute(attrType);
return TaskUtils.getBoolean(attrs, defaultValue);
}
private ArrayList<String> toListOfString(Entry entry, String attrName)
{
- final AttributeType attrType = getAttributeTypeOrDefault(attrName);
+ final AttributeType attrType = getAttributeType(attrName);
final List<Attribute> attrs = entry.getAttribute(attrType);
return TaskUtils.getMultiValueString(attrs);
}
private String toString(Entry entry, String attrName)
{
- final AttributeType attrType = getAttributeTypeOrDefault(attrName);
+ final AttributeType attrType = getAttributeType(attrName);
final List<Attribute> attrs = entry.getAttribute(attrType);
return TaskUtils.getSingleValueString(attrs);
}
@@ -492,7 +492,7 @@
HashSet<AttributeType> attributes = new HashSet<>();
for (String attrName : attributeStrings)
{
- attributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
+ attributes.add(DirectoryServer.getAttributeType(attrName));
}
return attributes;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
index cd197f9..2d0e595 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ImportTask.java
@@ -147,26 +147,26 @@
Entry taskEntry = getTaskEntry();
- AttributeType typeLdifFile = getAttributeTypeOrDefault(ATTR_IMPORT_LDIF_FILE);
- AttributeType typeTemplateFile = getAttributeTypeOrDefault(ATTR_IMPORT_TEMPLATE_FILE);
- AttributeType typeBackendID = getAttributeTypeOrDefault(ATTR_IMPORT_BACKEND_ID);
- AttributeType typeIncludeBranch = getAttributeTypeOrDefault(ATTR_IMPORT_INCLUDE_BRANCH);
- AttributeType typeExcludeBranch = getAttributeTypeOrDefault(ATTR_IMPORT_EXCLUDE_BRANCH);
- AttributeType typeIncludeAttribute = getAttributeTypeOrDefault(ATTR_IMPORT_INCLUDE_ATTRIBUTE);
- AttributeType typeExcludeAttribute = getAttributeTypeOrDefault(ATTR_IMPORT_EXCLUDE_ATTRIBUTE);
- AttributeType typeIncludeFilter = getAttributeTypeOrDefault(ATTR_IMPORT_INCLUDE_FILTER);
- AttributeType typeExcludeFilter = getAttributeTypeOrDefault(ATTR_IMPORT_EXCLUDE_FILTER);
- AttributeType typeRejectFile = getAttributeTypeOrDefault(ATTR_IMPORT_REJECT_FILE);
- AttributeType typeSkipFile = getAttributeTypeOrDefault(ATTR_IMPORT_SKIP_FILE);
- AttributeType typeOverwrite = getAttributeTypeOrDefault(ATTR_IMPORT_OVERWRITE);
- AttributeType typeSkipSchemaValidation = getAttributeTypeOrDefault(ATTR_IMPORT_SKIP_SCHEMA_VALIDATION);
- AttributeType typeIsCompressed = getAttributeTypeOrDefault(ATTR_IMPORT_IS_COMPRESSED);
- AttributeType typeIsEncrypted = getAttributeTypeOrDefault(ATTR_IMPORT_IS_ENCRYPTED);
- AttributeType typeClearBackend = getAttributeTypeOrDefault(ATTR_IMPORT_CLEAR_BACKEND);
- AttributeType typeRandomSeed = getAttributeTypeOrDefault(ATTR_IMPORT_RANDOM_SEED);
- AttributeType typeThreadCount = getAttributeTypeOrDefault(ATTR_IMPORT_THREAD_COUNT);
- AttributeType typeTmpDirectory = getAttributeTypeOrDefault(ATTR_IMPORT_TMP_DIRECTORY);
- AttributeType typeDNCheckPhase2 = getAttributeTypeOrDefault(ATTR_IMPORT_SKIP_DN_VALIDATION);
+ AttributeType typeLdifFile = getAttributeType(ATTR_IMPORT_LDIF_FILE);
+ AttributeType typeTemplateFile = getAttributeType(ATTR_IMPORT_TEMPLATE_FILE);
+ AttributeType typeBackendID = getAttributeType(ATTR_IMPORT_BACKEND_ID);
+ AttributeType typeIncludeBranch = getAttributeType(ATTR_IMPORT_INCLUDE_BRANCH);
+ AttributeType typeExcludeBranch = getAttributeType(ATTR_IMPORT_EXCLUDE_BRANCH);
+ AttributeType typeIncludeAttribute = getAttributeType(ATTR_IMPORT_INCLUDE_ATTRIBUTE);
+ AttributeType typeExcludeAttribute = getAttributeType(ATTR_IMPORT_EXCLUDE_ATTRIBUTE);
+ AttributeType typeIncludeFilter = getAttributeType(ATTR_IMPORT_INCLUDE_FILTER);
+ AttributeType typeExcludeFilter = getAttributeType(ATTR_IMPORT_EXCLUDE_FILTER);
+ AttributeType typeRejectFile = getAttributeType(ATTR_IMPORT_REJECT_FILE);
+ AttributeType typeSkipFile = getAttributeType(ATTR_IMPORT_SKIP_FILE);
+ AttributeType typeOverwrite = getAttributeType(ATTR_IMPORT_OVERWRITE);
+ AttributeType typeSkipSchemaValidation = getAttributeType(ATTR_IMPORT_SKIP_SCHEMA_VALIDATION);
+ AttributeType typeIsCompressed = getAttributeType(ATTR_IMPORT_IS_COMPRESSED);
+ AttributeType typeIsEncrypted = getAttributeType(ATTR_IMPORT_IS_ENCRYPTED);
+ AttributeType typeClearBackend = getAttributeType(ATTR_IMPORT_CLEAR_BACKEND);
+ AttributeType typeRandomSeed = getAttributeType(ATTR_IMPORT_RANDOM_SEED);
+ AttributeType typeThreadCount = getAttributeType(ATTR_IMPORT_THREAD_COUNT);
+ AttributeType typeTmpDirectory = getAttributeType(ATTR_IMPORT_TMP_DIRECTORY);
+ AttributeType typeDNCheckPhase2 = getAttributeType(ATTR_IMPORT_SKIP_DN_VALIDATION);
ArrayList<String> ldifFilestmp = asListOfStrings(taskEntry, typeLdifFile);
ldifFiles = new ArrayList<>(ldifFilestmp.size());
@@ -788,7 +788,7 @@
final HashSet<AttributeType> attrTypes = new HashSet<>(attrNames.size());
for (String attrName : attrNames)
{
- attrTypes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
+ attrTypes.add(DirectoryServer.getAttributeType(attrName));
}
return attrTypes;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTargetTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTargetTask.java
index e229a21..e8cf384 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTargetTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTargetTask.java
@@ -79,8 +79,8 @@
// FIXME -- Do we need any special authorization here?
Entry taskEntry = getTaskEntry();
- AttributeType typeDomainBase = getAttributeTypeOrDefault(ATTR_TASK_INITIALIZE_TARGET_DOMAIN_DN);
- AttributeType typeScope = getAttributeTypeOrDefault(ATTR_TASK_INITIALIZE_TARGET_SCOPE);
+ AttributeType typeDomainBase = getAttributeType(ATTR_TASK_INITIALIZE_TARGET_DOMAIN_DN);
+ AttributeType typeScope = getAttributeType(ATTR_TASK_INITIALIZE_TARGET_SCOPE);
List<Attribute> attrList = taskEntry.getAttribute(typeDomainBase);
domainString = TaskUtils.getSingleValueString(attrList);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTask.java
index 163b424..00c2d01 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/InitializeTask.java
@@ -82,8 +82,8 @@
// FIXME -- Do we need any special authorization here?
Entry taskEntry = getTaskEntry();
- AttributeType typeDomainBase = getAttributeTypeOrDefault(ATTR_TASK_INITIALIZE_DOMAIN_DN);
- AttributeType typeSourceScope = getAttributeTypeOrDefault(ATTR_TASK_INITIALIZE_SOURCE);
+ AttributeType typeDomainBase = getAttributeType(ATTR_TASK_INITIALIZE_DOMAIN_DN);
+ AttributeType typeSourceScope = getAttributeType(ATTR_TASK_INITIALIZE_SOURCE);
List<Attribute> attrList;
attrList = taskEntry.getAttribute(typeDomainBase);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/PurgeConflictsHistoricalTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/PurgeConflictsHistoricalTask.java
index a6593df..2f85a69 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/PurgeConflictsHistoricalTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/PurgeConflictsHistoricalTask.java
@@ -95,7 +95,7 @@
// FIXME -- Do we need any special authorization here?
Entry taskEntry = getTaskEntry();
- AttributeType typeDomainBase = getAttributeTypeOrDefault(ATTR_TASK_CONFLICTS_HIST_PURGE_DOMAIN_DN);
+ AttributeType typeDomainBase = getAttributeType(ATTR_TASK_CONFLICTS_HIST_PURGE_DOMAIN_DN);
List<Attribute> attrList = taskEntry.getAttribute(typeDomainBase);
domainString = TaskUtils.getSingleValueString(attrList);
@@ -113,7 +113,7 @@
throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, mb.toMessage());
}
- AttributeType typeMaxDuration = getAttributeTypeOrDefault(ATTR_TASK_CONFLICTS_HIST_PURGE_MAX_DURATION);
+ AttributeType typeMaxDuration = getAttributeType(ATTR_TASK_CONFLICTS_HIST_PURGE_MAX_DURATION);
attrList = taskEntry.getAttribute(typeMaxDuration);
String maxDurationStringInSec = TaskUtils.getSingleValueString(attrList);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/RebuildTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/RebuildTask.java
index 6e5251b..684a416 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/RebuildTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/RebuildTask.java
@@ -104,7 +104,7 @@
final String val = asString(taskEntry, ATTR_REBUILD_INDEX_CLEARDEGRADEDSTATE);
isClearDegradedState = Boolean.parseBoolean(val);
- AttributeType typeIndex = getAttributeTypeOrDefault(ATTR_REBUILD_INDEX);
+ AttributeType typeIndex = getAttributeType(ATTR_REBUILD_INDEX);
List<Attribute> attrList = taskEntry.getAttribute(typeIndex);
indexes = TaskUtils.getMultiValueString(attrList);
@@ -122,7 +122,7 @@
private String asString(Entry taskEntry, String attrName)
{
- final AttributeType attrType = getAttributeTypeOrDefault(attrName);
+ final AttributeType attrType = getAttributeType(attrName);
final List<Attribute> attrList = taskEntry.getAttribute(attrType);
return TaskUtils.getSingleValueString(attrList);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ResetChangeNumberTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ResetChangeNumberTask.java
index 52cb703..af5f3e8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ResetChangeNumberTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ResetChangeNumberTask.java
@@ -44,7 +44,7 @@
import static org.opends.server.config.ConfigConstants.ATTR_TASK_RESET_CHANGE_NUMBER_BASE_DN;
import static org.opends.server.config.ConfigConstants.ATTR_TASK_RESET_CHANGE_NUMBER_CSN;
import static org.opends.server.config.ConfigConstants.ATTR_TASK_RESET_CHANGE_NUMBER_TO;
-import static org.opends.server.core.DirectoryServer.getAttributeTypeOrDefault;
+import static org.opends.server.core.DirectoryServer.getAttributeType;
import static org.opends.messages.TaskMessages.*;
/**
@@ -106,7 +106,7 @@
private List<Attribute> getTaskParameter(Entry taskEntry, String attrTaskResetChangeNumberTo)
{
- AttributeType taskAttr = getAttributeTypeOrDefault(attrTaskResetChangeNumberTo);
+ AttributeType taskAttr = getAttributeType(attrTaskResetChangeNumberTo);
return taskEntry.getAttribute(taskAttr);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java
index bf478b1..e1502a3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/RestoreTask.java
@@ -120,9 +120,9 @@
Entry taskEntry = getTaskEntry();
- AttributeType typeBackupDirectory = getAttributeTypeOrDefault(ATTR_BACKUP_DIRECTORY_PATH);
- AttributeType typebackupID = getAttributeTypeOrDefault(ATTR_BACKUP_ID);
- AttributeType typeVerifyOnly = getAttributeTypeOrDefault(ATTR_TASK_RESTORE_VERIFY_ONLY);
+ AttributeType typeBackupDirectory = getAttributeType(ATTR_BACKUP_DIRECTORY_PATH);
+ AttributeType typebackupID = getAttributeType(ATTR_BACKUP_ID);
+ AttributeType typeVerifyOnly = getAttributeType(ATTR_TASK_RESTORE_VERIFY_ONLY);
List<Attribute> attrList;
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/SetGenerationIdTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/SetGenerationIdTask.java
index 753074b..0736281 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/SetGenerationIdTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/SetGenerationIdTask.java
@@ -77,7 +77,7 @@
Entry taskEntry = getTaskEntry();
// Retrieves the eventual generation-ID
- AttributeType typeNewValue = getAttributeTypeOrDefault(ATTR_TASK_SET_GENERATION_ID_NEW_VALUE);
+ AttributeType typeNewValue = getAttributeType(ATTR_TASK_SET_GENERATION_ID_NEW_VALUE);
List<Attribute> attrList = taskEntry.getAttribute(typeNewValue);
if (!attrList.isEmpty())
{
@@ -95,7 +95,7 @@
}
// Retrieves the replication domain
- AttributeType typeDomainBase = getAttributeTypeOrDefault(ATTR_TASK_SET_GENERATION_ID_DOMAIN_DN);
+ AttributeType typeDomainBase = getAttributeType(ATTR_TASK_SET_GENERATION_ID_DOMAIN_DN);
attrList = taskEntry.getAttribute(typeDomainBase);
domainString = TaskUtils.getSingleValueString(attrList);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ShutdownTask.java b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ShutdownTask.java
index 92463b6..d94b5b8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tasks/ShutdownTask.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tasks/ShutdownTask.java
@@ -94,7 +94,7 @@
restart = false;
shutdownMessage = INFO_TASK_SHUTDOWN_DEFAULT_MESSAGE.get(taskEntry.getName());
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_SHUTDOWN_MESSAGE);
+ AttributeType attrType = DirectoryServer.getAttributeType(ATTR_SHUTDOWN_MESSAGE);
List<Attribute> attrList = taskEntry.getAttribute(attrType);
if (!attrList.isEmpty())
{
@@ -107,7 +107,7 @@
}
- attrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_RESTART_SERVER);
+ attrType = DirectoryServer.getAttributeType(ATTR_RESTART_SERVER);
attrList = taskEntry.getAttribute(attrType);
if (!attrList.isEmpty())
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
index 7fcc7f2..31e00f3 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ExportLDIF.java
@@ -830,7 +830,7 @@
Set<AttributeType> results = new HashSet<>();
for (String attrName : attributeArg.getValues())
{
- results.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
+ results.add(DirectoryServer.getAttributeType(attrName));
}
return results;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
index 5f08b8d..ef3f13b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/ImportLDIF.java
@@ -720,7 +720,7 @@
}
else
{
- excludeAttributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
+ excludeAttributes.add(DirectoryServer.getAttributeType(attrName));
}
}
}
@@ -748,7 +748,7 @@
}
else
{
- includeAttributes.add(DirectoryServer.getAttributeTypeOrDefault(attrName));
+ includeAttributes.add(DirectoryServer.getAttributeType(attrName));
}
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java
index 81e0983..dd80d24 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/LDIFSearch.java
@@ -484,7 +484,7 @@
LinkedHashSet<AttributeType> operationalAttributeTypes = new LinkedHashSet<>();
for (String attributeName : attributeNames)
{
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(attributeName);
+ AttributeType t = DirectoryServer.getAttributeType(attributeName);
if (t.isOperational())
{
operationalAttributeTypes.add(t);
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/AttributeValueTag.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/AttributeValueTag.java
index 836d0f2..ee57a15 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/AttributeValueTag.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/AttributeValueTag.java
@@ -25,22 +25,16 @@
* Portions Copyright 2014-2016 ForgeRock AS
*/
package org.opends.server.tools.makeldif;
-import org.forgerock.i18n.LocalizableMessage;
-
-
import java.util.List;
-import org.opends.server.core.DirectoryServer;
+import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.ldap.schema.AttributeType;
+import org.opends.server.core.DirectoryServer;
import org.opends.server.types.InitializationException;
import static org.opends.messages.ToolMessages.*;
-import static org.opends.server.util.StaticUtils.*;
-
-
-
/**
* This class defines a tag that is used to reference the value of a specified
* attribute already defined in the entry.
@@ -120,8 +114,7 @@
throw new InitializationException(message);
}
- String lowerName = toLowerCase(arguments[0]);
- attributeType = DirectoryServer.getAttributeTypeOrDefault(lowerName);
+ attributeType = DirectoryServer.getAttributeType(arguments[0]);
if (! branch.hasAttribute(attributeType))
{
LocalizableMessage message =
@@ -183,8 +176,7 @@
throw new InitializationException(message);
}
- String lowerName = toLowerCase(arguments[0]);
- attributeType = DirectoryServer.getAttributeTypeOrDefault(lowerName);
+ attributeType = DirectoryServer.getAttributeType(arguments[0]);
if (! template.hasAttribute(attributeType))
{
LocalizableMessage message =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfAbsentTag.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfAbsentTag.java
index a130004..e511b8b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfAbsentTag.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfAbsentTag.java
@@ -25,22 +25,16 @@
* Portions Copyright 2014-2016 ForgeRock AS
*/
package org.opends.server.tools.makeldif;
-import org.forgerock.i18n.LocalizableMessage;
-
-
import java.util.List;
-import org.opends.server.core.DirectoryServer;
+import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.ldap.schema.AttributeType;
+import org.opends.server.core.DirectoryServer;
import org.opends.server.types.InitializationException;
import static org.opends.messages.ToolMessages.*;
-import static org.opends.server.util.StaticUtils.*;
-
-
-
/**
* This class defines a tag that is used to base presence of one attribute on
* the absence of another attribute and/or attribute value.
@@ -120,8 +114,7 @@
throw new InitializationException(message);
}
- String lowerName = toLowerCase(arguments[0]);
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(lowerName);
+ AttributeType t = DirectoryServer.getAttributeType(arguments[0]);
if (! branch.hasAttribute(t))
{
LocalizableMessage message =
@@ -168,8 +161,7 @@
throw new InitializationException(message);
}
- String lowerName = toLowerCase(arguments[0]);
- attributeType = DirectoryServer.getAttributeTypeOrDefault(lowerName);
+ attributeType = DirectoryServer.getAttributeType(arguments[0]);
if (! template.hasAttribute(attributeType))
{
LocalizableMessage message =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfPresentTag.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfPresentTag.java
index 1b3a2c2..c591bb2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfPresentTag.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/IfPresentTag.java
@@ -25,22 +25,16 @@
* Portions Copyright 2014-2016 ForgeRock AS
*/
package org.opends.server.tools.makeldif;
-import org.forgerock.i18n.LocalizableMessage;
-
-
import java.util.List;
-import org.opends.server.core.DirectoryServer;
+import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.opendj.ldap.schema.AttributeType;
+import org.opends.server.core.DirectoryServer;
import org.opends.server.types.InitializationException;
import static org.opends.messages.ToolMessages.*;
-import static org.opends.server.util.StaticUtils.*;
-
-
-
/**
* This class defines a tag that is used to base presence of one attribute on
* the presence of another attribute and/or attribute value.
@@ -120,8 +114,7 @@
throw new InitializationException(message);
}
- String lowerName = toLowerCase(arguments[0]);
- AttributeType t = DirectoryServer.getAttributeTypeOrDefault(lowerName);
+ AttributeType t = DirectoryServer.getAttributeType(arguments[0]);
if (! branch.hasAttribute(t))
{
LocalizableMessage message =
@@ -168,8 +161,7 @@
throw new InitializationException(message);
}
- String lowerName = toLowerCase(arguments[0]);
- attributeType = DirectoryServer.getAttributeTypeOrDefault(lowerName);
+ attributeType = DirectoryServer.getAttributeType(arguments[0]);
if (! template.hasAttribute(attributeType))
{
LocalizableMessage message =
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java
index 75449b2..a37823f 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/makeldif/TemplateFile.java
@@ -1082,7 +1082,7 @@
StringTokenizer tokenizer = new StringTokenizer(rdnAttrNames, "+");
while (tokenizer.hasMoreTokens())
{
- attrList.add(DirectoryServer.getAttributeTypeOrDefault(tokenizer.nextToken()));
+ attrList.add(DirectoryServer.getAttributeType(tokenizer.nextToken()));
}
rdnAttributes = new AttributeType[attrList.size()];
@@ -1252,7 +1252,7 @@
}
}
- AttributeType attributeType = DirectoryServer.getAttributeTypeOrDefault(lowerLine.substring(0, colonPos));
+ AttributeType attributeType = DirectoryServer.getAttributeType(lowerLine.substring(0, colonPos));
// First, check whether the value is an URL value: <attrName>:< <url>
int length = line.length();
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
index d65cb48..65b87d7 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/AttributeBuilder.java
@@ -971,11 +971,6 @@
return builder.toAttribute();
}
- private static AttributeType getAttributeTypeOrDefault(String attributeName)
- {
- return DirectoryServer.getAttributeTypeOrDefault(attributeName);
- }
-
/** The attribute type for this attribute. */
private AttributeType attributeType;
/** The name of this attribute as provided by the end user. */
@@ -1091,7 +1086,7 @@
*/
public AttributeBuilder(String attributeName)
{
- this(getAttributeTypeOrDefault(attributeName), attributeName);
+ this(DirectoryServer.getAttributeType(attributeName), attributeName);
}
@@ -1496,7 +1491,7 @@
*/
public void setAttributeType(String attributeName)
{
- setAttributeType(getAttributeTypeOrDefault(attributeName), attributeName);
+ setAttributeType(DirectoryServer.getAttributeType(attributeName), attributeName);
}
/**
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java b/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java
index 07bfb34..63c6df0 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/Attributes.java
@@ -184,7 +184,7 @@
*/
public static Attribute create(String attributeName, String valueString)
{
- return create(getAttributeTypeOrDefault(attributeName), attributeName, valueString);
+ return create(getAttributeType(attributeName), attributeName, valueString);
}
/**
@@ -286,7 +286,7 @@
*/
public static Attribute empty(String attributeName)
{
- return empty(getAttributeTypeOrDefault(attributeName), attributeName);
+ return empty(getAttributeType(attributeName), attributeName);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java b/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
index b7b37aa..4ac807c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
@@ -811,14 +811,14 @@
private static RDN newRDN(ByteString attrName, ByteString value)
{
String name = attrName.toString();
- AttributeType attrType = getAttributeTypeOrDefault(name);
+ AttributeType attrType = getAttributeType(name);
return new RDN(attrType, name, value);
}
private static void addValue(ByteString attributeName, RDN rdn, ByteString empty)
{
String name = attributeName.toString();
- AttributeType attrType = getAttributeTypeOrDefault(name);
+ AttributeType attrType = getAttributeType(name);
rdn.addValue(attrType, name, empty);
}
@@ -1113,14 +1113,14 @@
private static RDN newRDN(StringBuilder attributeName, ByteString value)
{
String name = attributeName.toString();
- AttributeType attrType = getAttributeTypeOrDefault(name);
+ AttributeType attrType = getAttributeType(name);
return new RDN(attrType, name, value);
}
private static void addValue(StringBuilder attributeName, RDN rdn, ByteString empty)
{
String name = attributeName.toString();
- AttributeType attrType = getAttributeTypeOrDefault(name);
+ AttributeType attrType = getAttributeType(name);
rdn.addValue(attrType, name, empty);
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java b/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
index c974e62..5563917 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/RDN.java
@@ -671,7 +671,7 @@
// If using default is a problem, it will be caught later either
// by not finding the target entry or by not allowing the entry
// to be added.
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(name);
+ AttributeType attrType = DirectoryServer.getAttributeType(name);
RDN rdn = new RDN(attrType, name, parsedValue.toByteString());
@@ -780,7 +780,7 @@
if (pos >= length)
{
name = attributeName.toString();
- attrType = DirectoryServer.getAttributeTypeOrDefault(name);
+ attrType = DirectoryServer.getAttributeType(name);
rdn.addValue(attrType, name, ByteString.empty());
return rdn;
@@ -797,7 +797,7 @@
// If using default is a problem, it will be caught later either
// by not finding the target entry or by not allowing the entry
// to be added.
- attrType = DirectoryServer.getAttributeTypeOrDefault(name);
+ attrType = DirectoryServer.getAttributeType(name);
rdn.addValue(attrType, name, parsedValue.toByteString());
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
index 6fa424b..2e2d7a8 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SearchFilter.java
@@ -2060,7 +2060,7 @@
if (attributeType == null)
{
String typeStr = attrType.substring(0, lowerType.length());
- attributeType = DirectoryServer.getAttributeTypeOrDefault(typeStr);
+ attributeType = DirectoryServer.getAttributeType(typeStr);
}
return attributeType;
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java b/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java
index fe5d72d..32ef5f6 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/types/SubEntry.java
@@ -191,7 +191,7 @@
this.subTreeSpec = null;
String specString = null;
boolean isValidSpec = true;
- AttributeType specAttrType = DirectoryServer.getAttributeTypeOrDefault(ATTR_SUBTREE_SPEC_LC);
+ AttributeType specAttrType = DirectoryServer.getAttributeType(ATTR_SUBTREE_SPEC_LC);
for (Attribute attr : entry.getAttribute(specAttrType))
{
for (ByteString value : attr)
@@ -289,7 +289,7 @@
{
for (ByteString value : attr)
{
- this.inheritFromDNType = DirectoryServer.getAttributeTypeOrDefault(value.toString().toLowerCase());
+ this.inheritFromDNType = DirectoryServer.getAttributeType(value.toString());
this.inheritFromDNAttrValue = value;
break;
}
@@ -302,7 +302,7 @@
{
for (ByteString value : attr)
{
- this.inheritFromRDNAttrType = DirectoryServer.getAttributeTypeOrDefault(value.toString().toLowerCase());
+ this.inheritFromRDNAttrType = DirectoryServer.getAttributeType(value.toString());
this.inheritFromRDNAttrValue = value;
break;
}
@@ -311,7 +311,7 @@
{
for (ByteString value : attr)
{
- this.inheritFromRDNType = DirectoryServer.getAttributeTypeOrDefault(value.toString().toLowerCase());
+ this.inheritFromRDNType = DirectoryServer.getAttributeType(value.toString());
break;
}
}
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
index 9274024..367c482 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/util/LDIFReader.java
@@ -838,7 +838,7 @@
}
else
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attrName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attrName);
if (! importConfig.includeAttribute(attrType))
{
if (logger.isTraceEnabled())
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
index 1003019..2983e45 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendAddOperation.java
@@ -363,7 +363,7 @@
// Check to see if the entry includes a privilege specification. If so,
// then the requester must have the PRIVILEGE_CHANGE privilege.
- AttributeType privType = DirectoryServer.getAttributeTypeOrDefault(OP_ATTR_PRIVILEGE_NAME);
+ AttributeType privType = DirectoryServer.getAttributeType(OP_ATTR_PRIVILEGE_NAME);
if (entry.hasAttribute(privType)
&& !clientConnection.hasPrivilege(Privilege.PRIVILEGE_CHANGE, this))
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
index 280e92f..71e898c 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendBindOperation.java
@@ -1016,7 +1016,7 @@
Arg1<Object> nonUniqueAttributeMessage,
Arg2<Object, Object> cannotProcessAttributeMessage)
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attributeTypeName);
+ AttributeType attrType = DirectoryServer.getAttributeType(attributeTypeName);
List<Attribute> attrList = userEntry.getAttribute(attrType);
if (attrList.size() == 1)
{
diff --git a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
index f5b6050..d530816 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/workflowelement/localbackend/LocalBackendModifyOperation.java
@@ -830,7 +830,7 @@
processModification(m);
}
else if (!isInternalOrSynchro(m)
- && t.equals(getAttributeTypeOrDefault(OP_ATTR_ACCOUNT_DISABLED)))
+ && t.equals(getAttributeType(OP_ATTR_ACCOUNT_DISABLED)))
{
enabledStateChanged = true;
isEnabled = !pwPolicyState.isDisabled();
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetAttrTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetAttrTestCase.java
index 1b9581e..7c6da25 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetAttrTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/authorization/dseecompat/TargetAttrTestCase.java
@@ -496,7 +496,7 @@
{
EnumTargetOperator op = EnumTargetOperator.createOperator(eqOperator);
TargetAttr targetAttr = TargetAttr.decode(op, targetAttrString);
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(attribute);
+ AttributeType attrType = DirectoryServer.getAttributeType(attribute);
assertEquals(TargetAttr.isApplicable(attrType, targetAttr), expectedResult);
}
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/SchemaBackendTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/SchemaBackendTestCase.java
index d2ec8c8..fcde89b 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/SchemaBackendTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/SchemaBackendTestCase.java
@@ -4325,10 +4325,10 @@
Entry schemaEntry = DirectoryServer.getEntry(DN.valueOf("cn=schema"));
assertNotNull(schemaEntry);
- AttributeType cnType = DirectoryServer.getAttributeTypeOrDefault("creatorsname");
- AttributeType ctType = DirectoryServer.getAttributeTypeOrDefault("createtimestamp");
- AttributeType mnType = DirectoryServer.getAttributeTypeOrDefault("modifiersname");
- AttributeType mtType = DirectoryServer.getAttributeTypeOrDefault("modifytimestamp");
+ AttributeType cnType = DirectoryServer.getAttributeType("creatorsname");
+ AttributeType ctType = DirectoryServer.getAttributeType("createtimestamp");
+ AttributeType mnType = DirectoryServer.getAttributeType("modifiersname");
+ AttributeType mtType = DirectoryServer.getAttributeType("modifytimestamp");
assertTrue(schemaEntry.hasAttribute(cnType));
assertTrue(schemaEntry.hasAttribute(ctType));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
index 3ea04f6..bdd16f0 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/PluggableBackendImplTestCase.java
@@ -902,8 +902,8 @@
Entry actual = new Entry(dbEntry.getName(), dbEntry.getObjectClasses(), dbEntry.getUserAttributes(), null);
// Remove the userPassword because it will have been encoded.
- expected.removeAttribute(DirectoryServer.getAttributeTypeOrDefault("userpassword"));
- actual.removeAttribute(DirectoryServer.getAttributeTypeOrDefault("userpassword"));
+ expected.removeAttribute(DirectoryServer.getAttributeType("userpassword"));
+ actual.removeAttribute(DirectoryServer.getAttributeType("userpassword"));
assertThat(actual).isEqualTo(expected);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
index b57db32..374bb63 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/AddOperationTestCase.java
@@ -481,7 +481,7 @@
UpdatePreOpPlugin.reset();
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault("description");
+ AttributeType attrType = DirectoryServer.getAttributeType("description");
UpdatePreOpPlugin.addAttributeToRemove(attrType);
AddOperation addOperation = getRootConnection().processAdd(entry);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
index 7edb9e5..4d853ae 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/core/ModifyOperationTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2011 Sun Microsystems, Inc.
- * Portions Copyright 2011-2015 ForgeRock AS
+ * Portions Copyright 2011-2016 ForgeRock AS
*/
package org.opends.server.core;
@@ -436,7 +436,7 @@
public void testGetAndAddModifications() throws Exception
{
Entry e = DirectoryServer.getEntry(DN.valueOf("o=test"));
- assertThat(e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("description"))).isEmpty();
+ assertThat(e.getAttribute(DirectoryServer.getAttributeType("description"))).isEmpty();
UpdatePreOpPlugin.reset();
UpdatePreOpPlugin.addModification(
@@ -454,7 +454,7 @@
retrieveSuccessfulOperationElements(modifyOperation);
e = DirectoryServer.getEntry(DN.valueOf("o=test"));
- assertThat(e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("description"))).isNotEmpty();
+ assertThat(e.getAttribute(DirectoryServer.getAttributeType("description"))).isNotEmpty();
UpdatePreOpPlugin.reset();
}
@@ -553,7 +553,7 @@
public void testSuccessAddAttribute() throws Exception
{
Entry e = DirectoryServer.getEntry(DN.valueOf("o=test"));
- assertThat(e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("description"))).isEmpty();
+ assertThat(e.getAttribute(DirectoryServer.getAttributeType("description"))).isEmpty();
LDAPAttribute attr = newLDAPAttribute("description", "foo");
ModifyOperation modifyOperation = processModify("o=test", replace(attr));
@@ -561,7 +561,7 @@
retrieveSuccessfulOperationElements(modifyOperation);
e = DirectoryServer.getEntry(DN.valueOf("o=test"));
- assertThat(e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("description"))).isNotEmpty();
+ assertThat(e.getAttribute(DirectoryServer.getAttributeType("description"))).isNotEmpty();
}
@@ -577,7 +577,7 @@
{
Entry e = DirectoryServer.getEntry(DN.valueOf("o=test"));
- List<Attribute> attrList = e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("o"));
+ List<Attribute> attrList = e.getAttribute(DirectoryServer.getAttributeType("o"));
assertEquals(countValues(attrList), 1);
LDAPAttribute attr = newLDAPAttribute("o", "test2");
@@ -586,7 +586,7 @@
retrieveSuccessfulOperationElements(modifyOperation);
e = DirectoryServer.getEntry(DN.valueOf("o=test"));
- attrList = e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("o"));
+ attrList = e.getAttribute(DirectoryServer.getAttributeType("o"));
assertEquals(countValues(attrList), 2);
}
@@ -604,7 +604,7 @@
{
Entry e = DirectoryServer.getEntry(DN.valueOf(baseDN));
- List<Attribute> attrList = e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("o"));
+ List<Attribute> attrList = e.getAttribute(DirectoryServer.getAttributeType("o"));
assertEquals(countValues(attrList), 1);
LDAPAttribute attr = newLDAPAttribute("o;lang-en-us", "test");
@@ -613,7 +613,7 @@
retrieveSuccessfulOperationElements(modifyOperation);
e = DirectoryServer.getEntry(DN.valueOf(baseDN));
- attrList = e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("o"));
+ attrList = e.getAttribute(DirectoryServer.getAttributeType("o"));
assertEquals(countValues(attrList), 2);
}
@@ -1877,7 +1877,7 @@
Entry e = DirectoryServer.getEntry(DN.valueOf("uid=test.user," + baseDN));
List<Attribute> attrList =
- e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("employeenumber"));
+ e.getAttribute(DirectoryServer.getAttributeType("employeenumber"));
assertIntegerValueExists(attrList, 2);
}
@@ -1915,7 +1915,7 @@
Entry e = DirectoryServer.getEntry(DN.valueOf("uid=test.user," + baseDN));
List<Attribute> attrList =
- e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("employeenumber"));
+ e.getAttribute(DirectoryServer.getAttributeType("employeenumber"));
assertIntegerValueExists(attrList, 11);
}
@@ -1953,7 +1953,7 @@
Entry e = DirectoryServer.getEntry(DN.valueOf("uid=test.user," + baseDN));
List<Attribute> attrList =
- e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("employeenumber"));
+ e.getAttribute(DirectoryServer.getAttributeType("employeenumber"));
assertIntegerValueExists(attrList, 0);
}
@@ -3183,7 +3183,7 @@
assertEquals(modifyOperation.getResultCode(), ResultCode.SUCCESS);
assertTrue(DirectoryServer.entryExists(DN.valueOf("o=test")));
assertFalse(DirectoryServer.getEntry(DN.valueOf("o=test")).hasAttribute(
- DirectoryServer.getAttributeTypeOrDefault("description")));
+ DirectoryServer.getAttributeType("description")));
}
@@ -3418,7 +3418,7 @@
"userPassword: password");
List<Attribute> attrList =
- e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("userpassword"));
+ e.getAttribute(DirectoryServer.getAttributeType("userpassword"));
String passwd = null;
for (Attribute a : attrList)
@@ -3651,7 +3651,7 @@
retrieveSuccessfulOperationElements(modifyOperation);
Entry e = DirectoryServer.getEntry(DN.valueOf("uid=test.user," + baseDN));
- List<Attribute> attrList = e.getAttribute(DirectoryServer.getAttributeTypeOrDefault("usercertificate"));
+ List<Attribute> attrList = e.getAttribute(DirectoryServer.getAttributeType("usercertificate"));
assertThat(attrList).hasSize(1);
Attribute a = attrList.get(0);
assertTrue(a.hasOption("binary"));
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
index 3a57c15..58df98f 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyTestCase.java
@@ -73,7 +73,6 @@
/**
* Test LDAP authentication mappingPolicy implementation.
*/
-@SuppressWarnings("javadoc")
public class LDAPPassThroughAuthenticationPolicyTestCase extends
ExtensionsTestCase
{
@@ -598,10 +597,9 @@
- MockPolicyCfg withMappedAttribute(final String atype)
+ MockPolicyCfg withMappedAttribute(final String attrName)
{
- AttributeType attrType = DirectoryServer.getAttributeTypeOrDefault(toLowerCase(atype));
- mappedAttributes.add(attrType);
+ mappedAttributes.add(DirectoryServer.getAttributeType(attrName));
return this;
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
index 781e68b..cf9084e 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/ReferentialIntegrityPluginTestCase.java
@@ -62,6 +62,7 @@
import org.testng.annotations.Test;
import static org.forgerock.opendj.ldap.ModificationType.*;
+import static org.opends.server.core.DirectoryServer.*;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
import static org.opends.server.protocols.internal.Requests.*;
import static org.opends.server.util.CollectionUtils.*;
@@ -1061,17 +1062,13 @@
deleteAttrsEntry(DN dn, String... attrTypeStrings) throws Exception {
LinkedList<Modification> mods = new LinkedList<>();
for(String attrTypeString : attrTypeStrings) {
- AttributeType attrType = getAttrType(attrTypeString);
+ AttributeType attrType = getAttributeType(attrTypeString);
mods.add(new Modification(ModificationType.DELETE,
Attributes.empty(attrType)));
}
getRootConnection().processModify(dn, mods);
}
- private AttributeType getAttrType(String attrTypeString) {
- return DirectoryServer.getAttributeTypeOrDefault(attrTypeString);
- }
-
private void deleteEntries(String... dns) throws Exception{
InternalClientConnection conn = getRootConnection();
for(String dn : dns) {
@@ -1120,7 +1117,7 @@
String attr,
String... dns)
throws Exception {
- AttributeType type= getAttrType(attr);
+ AttributeType type= getAttributeType(attr);
final SearchRequest request = newSearchRequest(entryDN, SearchScope.BASE_OBJECT, "(" + attr + "=*)");
InternalSearchOperation operation = getRootConnection().processSearch(request);
for (SearchResultEntry entry : operation.getSearchEntries()) {
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java
index 11973e9..b096492 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/plugins/UniqueAttributePluginTestCase.java
@@ -39,13 +39,13 @@
import org.opends.server.admin.std.server.UniqueAttributePluginCfg;
import org.opends.server.api.plugin.PluginType;
import org.opends.server.core.AddOperation;
-import org.opends.server.core.DirectoryServer;
import org.opends.server.core.ModifyDNOperation;
import org.opends.server.core.ModifyOperation;
import org.forgerock.opendj.ldap.schema.AttributeType;
import org.opends.server.types.*;
import org.testng.annotations.*;
+import static org.opends.server.core.DirectoryServer.*;
import static org.opends.server.protocols.internal.InternalClientConnection.*;
import static org.opends.server.util.CollectionUtils.*;
import static org.testng.Assert.*;
@@ -732,7 +732,7 @@
deleteAttrsFromEntry(DN dn, String... attrTypeStrings) throws Exception {
LinkedList<Modification> mods = new LinkedList<>();
for(String attrTypeString : attrTypeStrings) {
- AttributeType attrType = getAttrType(attrTypeString);
+ AttributeType attrType = getAttributeType(attrTypeString);
mods.add(new Modification(ModificationType.DELETE,
Attributes.empty(attrType)));
}
@@ -787,7 +787,7 @@
* @param attrTypeString The attribute type string to remove.
*/
private void delAttribute(Entry entry, String attrTypeString) {
- entry.removeAttribute(getAttrType(attrTypeString));
+ entry.removeAttribute(getAttributeType(attrTypeString));
}
/**
@@ -817,10 +817,6 @@
Attributes.create(attrName, attrValues)));
}
- private AttributeType getAttrType(String attrTypeString) {
- return DirectoryServer.getAttributeTypeOrDefault(attrTypeString);
- }
-
/**
* Perform modify operation with list of modifications. Expect return code
* of value rc.
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
index f003be0..52a8576 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/internal/InternalClientConnectionTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2006-2009 Sun Microsystems, Inc.
- * Portions Copyright 2014-2015 ForgeRock AS
+ * Portions Copyright 2014-2016 ForgeRock AS
*/
package org.opends.server.protocols.internal;
@@ -467,7 +467,7 @@
InternalClientConnection conn = getRootConnection();
CompareOperation compareOperation =
conn.processCompare(DN.valueOf("cn=test,o=test"),
- DirectoryServer.getAttributeTypeOrDefault("cn"),
+ DirectoryServer.getAttributeType("cn"),
ByteString.valueOfUtf8("test"));
assertEquals(compareOperation.getResultCode(), ResultCode.COMPARE_TRUE);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
index b7ce3f7..08cde7a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/jmx/JmxPrivilegeTestCase.java
@@ -22,7 +22,7 @@
*
*
* Copyright 2008-2010 Sun Microsystems, Inc.
- * Portions Copyright 2011-2015 ForgeRock AS
+ * Portions Copyright 2011-2016 ForgeRock AS
*/
package org.opends.server.protocols.jmx;
@@ -586,7 +586,7 @@
// Test a compare operation against the PWReset Target user.
CompareOperationBasis compareOp = new CompareOperationBasis(
conn, conn.nextOperationID(), conn.nextMessageID(), controls,
- targetDN, DirectoryServer.getAttributeTypeOrDefault("cn"),
+ targetDN, DirectoryServer.getAttributeType("cn"),
ByteString.valueOfUtf8("PWReset Target"));
assertSuccess(hasProxyPrivilege, compareOp);
@@ -699,7 +699,7 @@
// Test a compare operation against the PWReset Target user.
CompareOperationBasis compareOp = new CompareOperationBasis(
conn, conn.nextOperationID(), conn.nextMessageID(), controls,
- targetDN, DirectoryServer.getAttributeTypeOrDefault("cn"),
+ targetDN, DirectoryServer.getAttributeType("cn"),
ByteString.valueOfUtf8("PWReset Target"));
assertSuccess(hasProxyPrivilege, compareOp);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
index 23acddc..c27678a 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestAddResponseProtocolOp.java
@@ -72,7 +72,7 @@
TestCaseUtils.startServer();
//Setup the DN to use in the response tests.
- AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
+ AttributeType attribute = DirectoryServer.getAttributeType("testAttribute");
ByteString attributeValue = ByteString.valueOfUtf8("testValue");
dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
index ba2acb1..f878a09 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestCompareResponseProtocolOp.java
@@ -72,7 +72,7 @@
TestCaseUtils.startServer();
//Setup the DN to use in the response tests.
- AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
+ AttributeType attribute = DirectoryServer.getAttributeType("testAttribute");
ByteString attributeValue = ByteString.valueOfUtf8("testValue");
dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
index ce3af1e..57e8693 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestDeleteResponseProtocolOp.java
@@ -72,7 +72,7 @@
TestCaseUtils.startServer();
//Setup the DN to use in the response tests.
- AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
+ AttributeType attribute = DirectoryServer.getAttributeType("testAttribute");
ByteString attributeValue = ByteString.valueOfUtf8("testValue");
dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
index 0a9490b..a34a9c9 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestLDAPConnectionHandler.java
@@ -239,21 +239,21 @@
"ds-cfg-trust-manager-provider: cn=JKS,cn=Trust Manager Providers,cn=config");
LDAPConnectionHandler LDAPConnHandler=getLDAPHandlerInstance(GoodHandlerEntry);
//Make attrTypes to remove
- AttributeType at0=DirectoryServer.getAttributeTypeOrDefault(ATTR_LISTEN_PORT);
+ AttributeType at0=DirectoryServer.getAttributeType(ATTR_LISTEN_PORT);
// AttributeType at1=DirectoryServer.getAttributeType(ATTR_LISTEN_ADDRESS, true);
// Attribute rAttr1=new Attribute(at1);
// GoodHandlerEntry.removeAttribute(rAttr1, null);
- AttributeType at2=DirectoryServer.getAttributeTypeOrDefault(ATTR_ALLOW_LDAPV2);
- AttributeType at3=DirectoryServer.getAttributeTypeOrDefault(ATTR_ALLOW_LDAPV2);
- AttributeType at4=DirectoryServer.getAttributeTypeOrDefault(ATTR_KEEP_LDAP_STATS);
- AttributeType at5=DirectoryServer.getAttributeTypeOrDefault(ATTR_SEND_REJECTION_NOTICE);
- AttributeType at6=DirectoryServer.getAttributeTypeOrDefault(ATTR_USE_TCP_KEEPALIVE);
- AttributeType at7=DirectoryServer.getAttributeTypeOrDefault(ATTR_USE_TCP_NODELAY);
- AttributeType at8=DirectoryServer.getAttributeTypeOrDefault(ATTR_ALLOW_REUSE_ADDRESS);
- AttributeType at9=DirectoryServer.getAttributeTypeOrDefault(ATTR_USE_SSL);
- AttributeType at10=DirectoryServer.getAttributeTypeOrDefault(ATTR_ALLOW_STARTTLS);
- AttributeType at11=DirectoryServer.getAttributeTypeOrDefault(ATTR_MAX_REQUEST_SIZE);
- AttributeType at12=DirectoryServer.getAttributeTypeOrDefault(ATTR_ACCEPT_BACKLOG);
+ AttributeType at2=DirectoryServer.getAttributeType(ATTR_ALLOW_LDAPV2);
+ AttributeType at3=DirectoryServer.getAttributeType(ATTR_ALLOW_LDAPV2);
+ AttributeType at4=DirectoryServer.getAttributeType(ATTR_KEEP_LDAP_STATS);
+ AttributeType at5=DirectoryServer.getAttributeType(ATTR_SEND_REJECTION_NOTICE);
+ AttributeType at6=DirectoryServer.getAttributeType(ATTR_USE_TCP_KEEPALIVE);
+ AttributeType at7=DirectoryServer.getAttributeType(ATTR_USE_TCP_NODELAY);
+ AttributeType at8=DirectoryServer.getAttributeType(ATTR_ALLOW_REUSE_ADDRESS);
+ AttributeType at9=DirectoryServer.getAttributeType(ATTR_USE_SSL);
+ AttributeType at10=DirectoryServer.getAttributeType(ATTR_ALLOW_STARTTLS);
+ AttributeType at11=DirectoryServer.getAttributeType(ATTR_MAX_REQUEST_SIZE);
+ AttributeType at12=DirectoryServer.getAttributeType(ATTR_ACCEPT_BACKLOG);
//Remove them
Attribute rAttr0=Attributes.empty(at0);
GoodHandlerEntry.removeAttribute(rAttr0, null);
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
index b70a0da..abf326d 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyDNResponseProtocolOp.java
@@ -73,7 +73,7 @@
TestCaseUtils.startServer();
//Setup the DN to use in the response tests.
- AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
+ AttributeType attribute = DirectoryServer.getAttributeType("testAttribute");
ByteString attributeValue = ByteString.valueOfUtf8("testValue");
dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
index d01e700..c95e795 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/protocols/ldap/TestModifyResponseProtocolOp.java
@@ -72,7 +72,7 @@
TestCaseUtils.startServer();
//Setup the DN to use in the response tests.
- AttributeType attribute = DirectoryServer.getAttributeTypeOrDefault("testAttribute");
+ AttributeType attribute = DirectoryServer.getAttributeType("testAttribute");
ByteString attributeValue = ByteString.valueOfUtf8("testValue");
dn = new DN(new RDN[] { RDN.create(attribute, attributeValue) });
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeTypeTest.java b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeTypeTest.java
index 56adb3e..4e62f56 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeTypeTest.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/AttributeTypeTest.java
@@ -52,8 +52,8 @@
@Test
public void defaultAttributeTypesWithDifferentCaseEquals()
{
- AttributeType attrType = getAttributeTypeOrDefault("displayName");
- AttributeType attrType2 = getAttributeTypeOrDefault("displayname");
+ AttributeType attrType = getAttributeType("displayName");
+ AttributeType attrType2 = getAttributeType("displayname");
Assert.assertNotSame(attrType, attrType2);
Assert.assertEquals(attrType, attrType2);
}
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
index cc3fa58..4cf10dd 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/PrivilegeTestCase.java
@@ -1287,7 +1287,7 @@
CompareOperation compareOperation = new CompareOperationBasis(conn,
nextOperationID(), nextMessageID(),
controls, targetDN,
- DirectoryServer.getAttributeTypeOrDefault("cn"),
+ DirectoryServer.getAttributeType("cn"),
ByteString.valueOfUtf8("PWReset Target"));
compareOperation.run();
if (hasProxyPrivilege)
@@ -1433,7 +1433,7 @@
// Test a compare operation against the PWReset Target user.
CompareOperation compareOperation = new CompareOperationBasis(conn, nextOperationID(),
nextMessageID(), controls, targetDN,
- DirectoryServer.getAttributeTypeOrDefault("cn"),
+ DirectoryServer.getAttributeType("cn"),
ByteString.valueOfUtf8("PWReset Target"));
compareOperation.run();
if (hasProxyPrivilege)
diff --git a/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java b/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java
index 503652a..39195f4 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/types/TestObjectClass.java
@@ -342,8 +342,7 @@
types = new AttributeType[10];
for (int i = 0; i < types.length; i++) {
- String name = "testType" + i;
- types[i] = DirectoryServer.getAttributeTypeOrDefault(name);
+ types[i] = DirectoryServer.getAttributeType("testType" + i);
}
}
--
Gitblit v1.10.0