Codota Logo
Rdn.getValue
Code IndexAdd Codota to your IDE (free)

How to use
getValue
method
in
org.apache.directory.api.ldap.model.name.Rdn

Best Java code snippets using org.apache.directory.api.ldap.model.name.Rdn.getValue (Showing top 20 results out of 315)

  • Common ways to obtain Rdn
private void myMethod () {
Rdn r =
  • Codota IconDn dn;dn.getRdn()
  • Codota IconSchemaManager schemaManager;new Rdn(schemaManager)
  • Codota IconModifyDnRequest modifyDnRequest;modifyDnRequest.getNewRdn()
  • Smart code suggestions by Codota
}
origin: keeps/roda

/**
 * Returns the first name from a DN (Distinguished Name). Ex: for
 * <i>DN=cn=administrators,ou=groups,dc=roda,dc=org</i> returns
 * <i>administrators</i>.
 *
 * @param dn
 *          the Distinguished Name.
 * @return a {@link String} with the first name.
 */
private String getFirstNameFromDN(final Dn dn) {
 return dn.getRdn().getValue();
}
origin: org.apache.directory.server/apacheds-core-api

private String getSchemaName( Dn schema )
{
  return schema.getRdn().getValue();
}
origin: org.apache.directory.server/apacheds-core-api

protected Set<String> getOids( Set<Entry> results )
{
  Set<String> oids = new HashSet<>( results.size() );
  for ( Entry result : results )
  {
    Dn dn = result.getDn();
    oids.add( dn.getRdn().getValue() );
  }
  return oids;
}
origin: org.apache.directory.server/apacheds-protocol-ldap

private ReplicaEventLog getEventLog( OperationContext opCtx )
{
  Dn consumerLogDn = opCtx.getDn();
  String name = ReplicaEventLog.REPLICA_EVENT_LOG_NAME_PREFIX + consumerLogDn.getRdn().getValue();
  for ( ReplicaEventLog log : replicaLogMap.values() )
  {
    if ( name.equalsIgnoreCase( log.getName() ) )
    {
      return log;
    }
  } // end of for
  return null;
}
origin: keeps/roda

private void addEntryIfNotExists(CoreSession session, String dnString, String... objectClasses) throws LdapException {
 final Dn dn = new Dn(dnString);
 final Rdn rdn = dn.getRdn();
 final Entry entryRoda = service.newEntry(dn).add(OBJECT_CLASS, objectClasses).add(rdn.getType(), rdn.getValue());
 try {
  session.add(entryRoda);
 } catch (LdapEntryAlreadyExistsException e) {
  LOGGER.debug("Error injecting the context entry for {}: {}", dnString, e.getMessage());
 }
}
origin: org.apache.directory.server/apacheds-core-api

/**
 * Checks that the parent Dn is a valid Dn
 * 
 * @param newParent The parent DN to check
 * @param schemaManager The SchemaManager instance
 * @param objectType The ObjectType to check
 * @throws LdapException  If the deletion failed
 */
protected void checkParent( Dn newParent, SchemaManager schemaManager, String objectType ) throws LdapException
{
  if ( newParent.size() != 3 )
  {
    throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_337 ) );
  }
  Rdn rdn = newParent.getRdn();
  if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() )
    .equals( SchemaConstants.OU_AT_OID ) )
  {
    throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
      I18n.err( I18n.ERR_338, objectType ) );
  }
  if ( !rdn.getValue().equalsIgnoreCase( OBJECT_TYPE_TO_PATH.get( objectType ) ) )
  {
    throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
      I18n.err( I18n.ERR_339, objectType, OBJECT_TYPE_TO_PATH.get( objectType ) ) );
  }
}
origin: org.apache.directory.server/apacheds-core-api

  private void checkNewParent( Dn newParent ) throws LdapException
  {
    if ( newParent.size() != 3 )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_402 ) );
    }

    Rdn rdn = newParent.getRdn();
    if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
      SchemaConstants.OU_AT_OID ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_403 ) );
    }

    if ( !rdn.getValue().equalsIgnoreCase( SchemaConstants.SYNTAXES ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_363 ) );
    }
  }
}
origin: org.apache.directory.server/apacheds-core-api

  private void checkNewParent( Dn newParent ) throws LdapException
  {
    if ( newParent.size() != 3 )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_370 ) );
    }

    Rdn rdn = newParent.getRdn();

    if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
      SchemaConstants.OU_AT_OID ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_371 ) );
    }

    if ( !rdn.getValue().equalsIgnoreCase( SchemaConstants.NORMALIZERS_AT ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_372 ) );
    }
  }
}
origin: org.apache.directory.server/apacheds-core-api

  private void checkNewParent( Dn newParent ) throws LdapException
  {
    if ( newParent.size() != 3 )
    {
      throw new LdapInvalidDnException(
        ResultCodeEnum.NAMING_VIOLATION,
        "The parent dn of a objectClass should be at most 3 name components in length." );
    }

    Rdn rdn = newParent.getRdn();

    if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
      SchemaConstants.OU_AT_OID ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_376 ) );
    }

    if ( !rdn.getValue().equalsIgnoreCase( SchemaConstants.OBJECT_CLASSES_AT ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_377 ) );
    }
  }
}
origin: org.apache.directory.server/apacheds-core-api

  private void checkNewParent( Dn newParent ) throws LdapException
  {
    if ( newParent.size() != 3 )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_357 ) );
    }

    Rdn rdn = newParent.getRdn();

    if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
      SchemaConstants.OU_AT_OID ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_358 ) );
    }

    if ( !rdn.getValue().equalsIgnoreCase( SchemaConstants.COMPARATORS_AT ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION, I18n.err( I18n.ERR_359 ) );
    }
  }
}
origin: org.apache.directory.server/apacheds-core-api

  private void checkNewParent( Dn newParent ) throws LdapException
  {
    if ( newParent.size() != 3 )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_361 ) );
    }

    Rdn rdn = newParent.getRdn();

    if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
      SchemaConstants.OU_AT_OID ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_362 ) );
    }

    if ( !rdn.getValue().equalsIgnoreCase( SchemaConstants.MATCHING_RULES_AT ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_363 ) );
    }
  }
}
origin: org.apache.directory.server/apacheds-core-api

  private void checkNewParent( Dn newParent ) throws LdapException
  {
    if ( newParent.size() != 3 )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_396 ) );
    }

    Rdn rdn = newParent.getRdn();
    if ( !schemaManager.getAttributeTypeRegistry().getOidByName( rdn.getNormType() ).equals(
      SchemaConstants.OU_AT_OID ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_397 ) );
    }

    if ( !rdn.getValue().equalsIgnoreCase( SchemaConstants.SYNTAX_CHECKERS_AT ) )
    {
      throw new LdapInvalidDnException( ResultCodeEnum.NAMING_VIOLATION,
        I18n.err( I18n.ERR_372 ) );
    }
  }
}
origin: org.apache.directory.server/apacheds-core-jndi

private void injectRdnAttributeValues( Dn target, Entry serverEntry ) throws NamingException
{
  // Add all the Rdn attributes and their values to this entry
  Rdn rdn = target.getRdn();
  if ( rdn.size() == 1 )
  {
    serverEntry.put( rdn.getType(), rdn.getValue() );
  }
  else
  {
    for ( Ava atav : rdn )
    {
      serverEntry.put( atav.getType(), atav.getValue() );
    }
  }
}
origin: org.apache.directory.api/api-ldap-client-all

oldRdn.getValue() ) ) )
origin: org.apache.directory.server/apacheds-core-api

String oid = newRdn.getValue();
checkOidIsUniqueForComparator( oid );
  String newOid = newRdn.getValue();
  checkOidIsUnique( newOid );
  targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
origin: org.apache.directory.server/apacheds-core-integ

public static LdifEntry getUserAddLdif( String dnstr, byte[] password, String cn, String sn )
  throws LdapException
{
  Dn dn = new Dn( dnstr );
  LdifEntry ldif = new LdifEntry();
  ldif.setDn( dnstr );
  ldif.setChangeType( ChangeType.Add );
  Attribute attr = new DefaultAttribute( "objectClass",
    "top", "person", "organizationalPerson", "inetOrgPerson" );
  ldif.addAttribute( attr );
  attr = new DefaultAttribute( "ou", "Engineering", "People" );
  ldif.addAttribute( attr );
  String uid = dn.getRdn().getValue();
  ldif.putAttribute( "uid", uid );
  ldif.putAttribute( "l", "Bogusville" );
  ldif.putAttribute( "cn", cn );
  ldif.putAttribute( "sn", sn );
  ldif.putAttribute( "mail", uid + "@apache.org" );
  ldif.putAttribute( "telephoneNumber", "+1 408 555 4798" );
  ldif.putAttribute( "facsimileTelephoneNumber", "+1 408 555 9751" );
  ldif.putAttribute( "roomnumber", "4612" );
  ldif.putAttribute( "userPassword", password );
  String givenName = cn.split( " " )[0];
  ldif.putAttribute( "givenName", givenName );
  return ldif;
}
origin: org.apache.directory.server/apacheds-core-api

/**
 * {@inheritDoc}
 */
@Override
public void rename( Entry entry, Rdn newRdn, boolean cascade ) throws LdapException
{
  String schemaName = getSchemaName( entry.getDn() );
  MatchingRule oldMr = factory.getMatchingRule( schemaManager, entry, schemaManager.getRegistries(), schemaName );
  Entry targetEntry = entry.clone();
  String newOid = newRdn.getValue();
  checkOidIsUnique( newOid );
  targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
  MatchingRule mr = factory.getMatchingRule( schemaManager, targetEntry, schemaManager.getRegistries(),
    schemaName );
  if ( isSchemaEnabled( schemaName ) )
  {
    schemaManager.unregisterMatchingRule( oldMr.getOid() );
    schemaManager.add( mr );
  }
  else
  {
    unregisterOids( oldMr );
    registerOids( mr );
  }
}
origin: org.apache.directory.server/apacheds-core-api

/**
 * {@inheritDoc}
 */
@Override
public void moveAndRename( Dn oriChildName, Dn newParentName, Rdn newRdn, boolean deleteOldRn,
  Entry entry, boolean cascade ) throws LdapException
{
  checkNewParent( newParentName );
  String oldOid = getOid( entry );
  String oldSchemaName = getSchemaName( oriChildName );
  String newSchemaName = getSchemaName( newParentName );
  if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
  {
    throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
      I18n.err( I18n.ERR_367, oldOid ) );
  }
  String oid = newRdn.getValue();
  checkOidIsUniqueForNormalizer( oid );
  Normalizer normalizer = factory.getNormalizer( schemaManager, entry, schemaManager.getRegistries(),
    newSchemaName );
  if ( isSchemaEnabled( oldSchemaName ) )
  {
    schemaManager.unregisterNormalizer( oldOid );
  }
  if ( isSchemaEnabled( newSchemaName ) )
  {
    schemaManager.add( normalizer );
  }
}
origin: org.apache.directory.server/apacheds-core-api

/**
 * {@inheritDoc}
 */
@Override
public void rename( Entry entry, Rdn newRdn, boolean cascade ) throws LdapException
{
  String oldOid = getOid( entry );
  String schemaName = getSchemaName( entry.getDn() );
  if ( schemaManager.getLdapSyntaxRegistry().contains( oldOid ) )
  {
    throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
      I18n.err( I18n.ERR_389, oldOid ) );
  }
  Entry targetEntry = entry.clone();
  String newOid = newRdn.getValue();
  if ( schemaManager.getSyntaxCheckerRegistry().contains( newOid ) )
  {
    throw new LdapSchemaViolationException( ResultCodeEnum.OTHER,
      I18n.err( I18n.ERR_390, newOid ) );
  }
  targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
  if ( isSchemaEnabled( schemaName ) )
  {
    SyntaxChecker syntaxChecker = factory.getSyntaxChecker( schemaManager, targetEntry, schemaManager
      .getRegistries(), schemaName );
    schemaManager.unregisterSyntaxChecker( oldOid );
    schemaManager.add( syntaxChecker );
  }
}
origin: org.apache.directory.server/apacheds-core-api

/**
 * {@inheritDoc}
 */
@Override
public void rename( Entry entry, Rdn newRdn, boolean cascade ) throws LdapException
{
  String oldOid = getOid( entry );
  String schemaName = getSchemaName( entry.getDn() );
  if ( schemaManager.getMatchingRuleRegistry().contains( oldOid ) )
  {
    throw new LdapUnwillingToPerformException( ResultCodeEnum.UNWILLING_TO_PERFORM,
      I18n.err( I18n.ERR_367, oldOid ) );
  }
  String newOid = newRdn.getValue();
  checkOidIsUniqueForNormalizer( newOid );
  if ( isSchemaEnabled( schemaName ) )
  {
    // Inject the new OID
    Entry targetEntry = entry.clone();
    targetEntry.put( MetaSchemaConstants.M_OID_AT, newOid );
    // Inject the new Dn
    Dn newDn = targetEntry.getDn().getParent();
    newDn = newDn.add( newRdn );
    targetEntry.setDn( newDn );
    Normalizer normalizer = factory.getNormalizer( schemaManager, targetEntry, schemaManager.getRegistries(),
      schemaName );
    schemaManager.unregisterNormalizer( oldOid );
    schemaManager.add( normalizer );
  }
}
org.apache.directory.api.ldap.model.nameRdngetValue

Javadoc

Return the User Provided value, as a String

Popular methods of Rdn

  • <init>
    Creates a new RDN from a list of AVA
  • getName
  • equals
    Compares the specified Object with this Rdn for equality. Returns true if the given object is also a
  • getNormType
    Return the normalized type, or the first one of we have more than one (the lowest)
  • size
    Get the number of Avas of this Rdn
  • getAva
    Get the Ava which type is given as an argument. If we have more than one value associated with the t
  • getNormName
  • escapeValue
    Transform a value in a String, accordingly to RFC 2253
  • readExternal
    We read back the data to create a new RDB. The structure read is exposed in the Rdn#writeExternal(Ob
  • writeExternal
    A Rdn is composed of on to many Avas (AttributeType And Value). We should write all those Avas seque
  • isSchemaAware
    Tells if the Rdn is schema aware.
  • toString
  • isSchemaAware,
  • toString,
  • addAVA,
  • addOrdered,
  • buildNormRdn,
  • clear,
  • compareTo,
  • getEscaped,
  • getType

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now