final Attribute groupId = group.get(groupIdAttribute); LOG.trace("Resolved {} to group {}", groupDn, groupId); if (groupId != null) {
private void removeMemberFromRoleOrGroup(final CoreSession session, final String dn, final String memberDN, final String attributeName) throws LdapException { final Entry entry = session.lookup(new Dn(dn), attributeName); final Attribute attribute = entry.get(attributeName); if (attribute != null) { attribute.remove(memberDN); final ModifyRequestImpl modifyRequestImpl = new ModifyRequestImpl(); modifyRequestImpl.setName(entry.getDn()); modifyRequestImpl.replace(attribute); session.modify(modifyRequestImpl); } }
groups.add(cursor.get().get(configuration.getGroupNameAttribute()).getString()); Optional<SingularityUser> result = Optional.of(new SingularityUser(user, com.google.common.base.Optional.fromNullable(Strings.emptyToNull(userEntry.get(configuration.getUserNameAttribute()).getString())), com.google.common.base.Optional.fromNullable(Strings.emptyToNull(userEntry.get(configuration.getUserEmailAttribute()).getString())), groups));
/** * {@inheritDoc} */ @Override public Attribute get( AttributeType attributeType ) { return entry.get( attributeType ); }
/** * {@inheritDoc} */ @Override public Attribute get( AttributeType attributeType ) { return entry.get( attributeType ); }
/** * {@inheritDoc} */ @Override public Attribute get( String alias ) { return entry.get( alias ); }
/** * {@inheritDoc} */ @Override public Attribute get( AttributeType attributeType ) { return entry.get( attributeType ); }
/** * {@inheritDoc} */ @Override public Attribute get( String alias ) { return entry.get( alias ); }
/** * {@inheritDoc} */ @Override public Attribute get( String alias ) { return entry.get( alias ); }
/** * Get key version. * @throws LdapInvalidAttributeValueException e * @return key version */ public int getKeyVersion() throws LdapInvalidAttributeValueException { String keyVersionStr = entry.get(KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT).getString(); int keyVersion = Integer.parseInt(keyVersionStr); return keyVersion; }
/** * Get whether disabled. * @throws LdapInvalidAttributeValueException e * @return whether this krb5 account is disabled */ public boolean getDisabled() throws LdapInvalidAttributeValueException { String disabled = entry.get(KerberosAttribute.KRB5_ACCOUNT_DISABLED_AT).getString(); return Boolean.parseBoolean(disabled); }
protected String getOid( Entry entry ) throws LdapException { Attribute oid = entry.get( moidAT ); if ( oid == null ) { return null; } return oid.getString(); }
/** * Get kdc flags. * @throws LdapInvalidAttributeValueException e * @return kdc flags */ public int getKdcFlags() throws LdapInvalidAttributeValueException { String krb5KDCFlags = entry.get("krb5KDCFlags").getString(); return Integer.parseInt(krb5KDCFlags); }
/** * Get kdc flags. * @throws LdapInvalidAttributeValueException e * @return kdc flags */ public int getKdcFlags() throws LdapInvalidAttributeValueException { String krb5KDCFlags = entry.get("krb5KDCFlags").getString(); return Integer.parseInt(krb5KDCFlags); }
/** * Get whether locked. * @throws LdapInvalidAttributeValueException e * @return whether the krb5 account is locked */ public boolean getLocked() throws LdapInvalidAttributeValueException { String lockedOut = entry.get(KerberosAttribute.KRB5_ACCOUNT_LOCKEDOUT_AT).getString(); return Boolean.parseBoolean(lockedOut); }
private String getEntryAttributeAsString(final Entry entry, final String attributeName) throws LdapInvalidAttributeValueException { final Attribute attribute = entry.get(attributeName); String value = null; if (attribute != null) { value = attribute.getString(); } return value; }
private static void addAttribute( Entry attrs, String id ) throws LdapException { Attribute attr = schemaSubentry.get( id ); if ( ( attr != null ) && ( attr.size() > 0 ) ) { attrs.put( attr ); } }
/** * Get the cookie from the entry */ private byte[] getCookie( Entry entry ) throws LdapInvalidAttributeValueException { String csn = entry.get( SchemaConstants.ENTRY_CSN_AT ).getString(); return LdapProtocolUtils.createCookie( consumerMsgLog.getId(), csn ); }
/** * Update the Operational Attribute with the reference to the subentry */ private void setOperationalAttribute( Entry entry, Dn subentryDn, AttributeType opAttr ) throws LdapException { Attribute operational = entry.get( opAttr ); if ( operational == null ) { operational = new DefaultAttribute( opAttr ); entry.put( operational ); } operational.add( subentryDn.getName() ); }