Java 8 Rdn - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Rdn class.

This code example shows how to use the following methods:getType, getValue
				//objectClass definition is required. 
				if (record.get("objectClass") != null) {
					 
					//Naming attribute is required. 
                    Rdn rdn = dn.getRdn(dn.size() - 1);
                    if (record.get(rdn.getType()) != null) {
						Object object = record.get(rdn.getType()).get();
						 
						if (object instanceof String) {
							String value = (String) object;
							if (((String)rdn.getValue()).equalsIgnoreCase(value)) {
								return true; 
							} 
						} else if(object instanceof byte[]) { 
							BASE64Encoder encoder = new BASE64Encoder();
							String rdnValue = encoder.encode(((String)rdn.getValue()).getBytes());
							String attributeValue = encoder.encode((byte[]) object);
							if (rdnValue.equals(attributeValue)) return true;
						}  
					} 
				} 
4
CodeRank
This code example shows how to use the following methods:
    public LdapNameBuilder add(String key, Object value) {
        Assert.hasText(key, "key must not be blank");
        Assert.notNull(key, "value must not be null");
 
        try { 
            ldapName.add(new Rdn(key, value));
            return this;
        } catch (InvalidNameException e) {
            throw new org.springframework.ldap.InvalidNameException(e);
        } 
    } 
 
    /** 
     * Append the specified name to the currently built LdapName. 
     * 
     * @param name the name to add. 
     * @return this builder. 
     */ 
    public LdapNameBuilder add(Name name) {
        Assert.notNull(name, "name must not be null");
3
CodeRank
This code example shows how to use the following methods:
        LdapName temporaryName = LdapUtils.newLdapName(originalName);
 
        // Add tempSuffix to the leaf node name. 
        try { 
            String leafNode = (String) temporaryName.remove(temporaryName.size() - 1);
            temporaryName.add(new Rdn(leafNode  + tempSuffix));
        } catch (InvalidNameException e) {
            throw new org.springframework.ldap.InvalidNameException(e);
        } 
 
        return temporaryName;
    } 
 
    /** 
     * Get the suffix that will be used for renaming temporary entries. 
     *  
     * @return the suffix. 
     */ 
    public String getTempSuffix() {
        return tempSuffix;
4
CodeRank
This code example shows how to use the following methods:
    // CHECKSTYLE ON : | 
    static { 
        List<Rdn> rdns;
        try { 
            rdns = Arrays.asList(new Rdn[] {
                                            new Rdn(COUNTRY_FIELD_NAME + FIELD_ASSIGNMENT + "DE"),
                                            new Rdn(ORGANIZATION_FIELD_NAME + FIELD_ASSIGNMENT + "DESY"),
                                            }); 
            LDAP_ROOT = new LdapName(rdns);
        } catch (final InvalidNameException e) {
            LOG.error("LDAP ROOT variable could not be initialised.", e);
        } 
    } 
 
    /** 
     * See http://www.ietf.org/rfc/rfc2253.txt 
     */ 
    static { 
        FORBIDDEN_SUBSTRINGS.add(",");
        FORBIDDEN_SUBSTRINGS.add("+");
4
CodeRank
See Code Examples for Java 8 Rdn Methods: