/** * Add a new ServerAttribute, with its upId. If the upId is null, * default to the AttributeType name. * * Updates the serverAttributeMap. */ private void createAttribute( String upId, AttributeType attributeType, byte[]... values ) { EntryAttribute attribute = new DefaultServerAttribute( attributeType, values ); attribute.setUpId( upId, attributeType ); attributes.put( attributeType, attribute ); }
/** * Add a new ServerAttribute, with its upId. If the upId is null, * default to the AttributeType name. * * Updates the serverAttributeMap. */ private void createAttribute( String upId, AttributeType attributeType, String... values ) { EntryAttribute attribute = new DefaultServerAttribute( attributeType, values ); attribute.setUpId( upId, attributeType ); attributes.put( attributeType, attribute ); }
/** * Add a new ServerAttribute, with its upId. If the upId is null, * default to the AttributeType name. * * Updates the serverAttributeMap. */ private void createAttribute( String upId, AttributeType attributeType, Value<?>... values ) { EntryAttribute attribute = new DefaultServerAttribute( attributeType, values ); attribute.setUpId( upId, attributeType ); attributes.put( attributeType, attribute ); }
/** * Convert a Modification to an instance of a ServerModification object. * * @param modificationImpl the modification instance to convert * @param attributeType the associated attributeType * @return a instance of a ServerModification object */ private static Modification toServerModification( Modification modification, AttributeType attributeType ) { if ( modification instanceof ServerModification ) { return modification; } Modification serverModification = new ServerModification( modification.getOperation(), new DefaultServerAttribute( attributeType, modification.getAttribute() ) ); return serverModification; }
EntryAttribute attribute = attributes.put( attributeType, new DefaultServerAttribute( attributeType ) );
new DefaultServerAttribute( upId, attributeType ));
private final void injectNames( List<String> names, ServerEntry entry, SchemaManager schemaManager ) throws LdapException { if ( ( names == null ) || ( names.size() == 0 ) ) { return; } EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_NAME_AT ) ); for ( String name:names ) { attr.add( name ); } entry.put( attr ); }
/** * Deserialize a ServerModification * * @param in The buffer containing the serialized value * @param atRegistry The AttributeType registry * @throws IOException If we weren't able to deserialize the data * @throws ClassNotFoundException if we weren't able to construct a Modification instance * @throws LdapException If we didn't found the AttributeType in the registries */ public void deserialize( ObjectInput in, SchemaManager schemaManager ) throws IOException, ClassNotFoundException, LdapException { // Read the operation int op = in.readInt(); operation = ModificationOperation.getOperation( op ); // Read the attribute OID String oid = in.readUTF(); // Lookup for tha associated AttributeType AttributeType attributeType = schemaManager.lookupAttributeTypeRegistry( oid ); attribute = new DefaultServerAttribute( attributeType ); // Read the attribute ((DefaultServerAttribute)attribute).deserialize( in ); }
DefaultServerAttribute attribute = new DefaultServerAttribute( attributeType );
EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values ); return attributes.put( attributeType, attribute );
EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values ); return attributes.put( attributeType, attribute );
EntryAttribute attribute = new DefaultServerAttribute( upId, attributeType, values ); return attributes.put( attributeType, attribute );
EntryAttribute passwordAttribute = new DefaultServerAttribute( getAttributeType("userPassword")); passwordAttribute.add(passwordToStore.getBytes());
public ServerModification( SchemaManager schemaManager, Modification modification ) { operation = modification.getOperation(); EntryAttribute modAttribute = modification.getAttribute(); try { AttributeType at = null; if ( modAttribute instanceof DefaultServerAttribute ) { at = ((EntryAttribute)modAttribute).getAttributeType(); } else { at = schemaManager.lookupAttributeTypeRegistry( modAttribute.getId() ); } attribute = new DefaultServerAttribute( at, modAttribute ); } catch ( LdapException ne ) { // The attributeType is incorrect. Log, but do nothing otherwise. LOG.error( I18n.err( I18n.ERR_04472, modAttribute.getId() ) ); } }
EntryAttribute serverAttribute = new DefaultServerAttribute( attributeType );
EntryAttribute serverAttribute = new DefaultServerAttribute( attributeType, attribute );
EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_SUP_OBJECT_CLASS_AT ) ); EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MUST_AT ) ); EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_MAY_AT ) );
public ServerEntry getAttributes( Schema schema, SchemaManager schemaManager ) throws LdapException { ServerEntry entry = new DefaultServerEntry( schemaManager ); entry.put( SchemaConstants.OBJECT_CLASS_AT, SchemaConstants.TOP_OC, MetaSchemaConstants.META_SCHEMA_OC ); entry.put( SchemaConstants.CN_AT, schema.getSchemaName() ); entry.put( SchemaConstants.CREATORS_NAME_AT, schema.getOwner() ); entry.put( SchemaConstants.CREATE_TIMESTAMP_AT, DateUtils.getGeneralizedTime() ); if ( schema.isDisabled() ) { entry.put( MetaSchemaConstants.M_DISABLED_AT, "TRUE" ); } String[] dependencies = schema.getDependencies(); if ( dependencies != null && dependencies.length > 0 ) { EntryAttribute attr = new DefaultServerAttribute( schemaManager.lookupAttributeTypeRegistry( MetaSchemaConstants.M_DEPENDENCIES_AT ) ); for ( String dependency:dependencies ) { attr.add( dependency ); } entry.put( attr ); } return entry; }
EntryAttribute combined = new DefaultServerAttribute( id, attributeType ); EntryAttribute toBeAdded = mod.getAttribute(); EntryAttribute existing = entry.get( id );