code: @FFDCIgnore({ NamingException.class, NameNotFoundException.class })
      private Attributes getAttributes(String name, String[] attrIds) throws WIMException {
          Attributes attributes = null;
  
          if (iLdapConfigMgr.getUseEncodingInSearchExpression() != null)
              name = LdapHelper.encodeAttribute(name, iLdapConfigMgr.getUseEncodingInSearchExpression());
  
          if (iAttrRangeStep > 0) {
              attributes = getRangeAttributes(name, attrIds);
          } else {
              TimedDirContext ctx = iContextManager.getDirContext();
              try {
                  try {
                      if (attrIds.length > 0) {
                          attributes = ctx.getAttributes(new LdapName(name), attrIds);
                      } else {
                          attributes = new BasicAttributes();
                      }
                  } catch (NamingException e) {
                      if (!ContextManager.isConnectionException(e)) {
                          throw e;
                      }
                      ctx = iContextManager.reCreateDirContext(ctx, e.toString());
                      if (attrIds.length > 0) {
                          attributes = ctx.getAttributes(new LdapName(name), attrIds);
                      } else {
                          attributes = new BasicAttributes();
                      }
                  }
              } catch (NameNotFoundException e) {
                  String msg = Tr.formatMessage(tc, WIMMessageKey.LDAP_ENTRY_NOT_FOUND, WIMMessageHelper.generateMsgParms(name, e.toString(true)));
                  throw new EntityNotFoundException(WIMMessageKey.LDAP_ENTRY_NOT_FOUND, msg, e);
              } catch (NamingException e) {
                  String msg = Tr.formatMessage(tc, WIMMessageKey.NAMING_EXCEPTION, WIMMessageHelper.generateMsgParms(e.toString(true)));
                  throw new WIMSystemException(WIMMessageKey.NAMING_EXCEPTION, msg, e);
              } finally {
                  iContextManager.releaseDirContext(ctx);
              }
          }
          return attributes;
      }
docs: Get the specified attributes for the distinguished name.
  
  @param name The distinguished name.
  @param attrIds The attribute IDs to retrieve.
  @return The {@link Attributes} instance.
  @throws WIMException If there was an error retrieving the attributes from the LDAP server.