public void registerSupportedExtensions( Set extensionOids ) { Attribute supportedExtension = rootDSE.get( "supportedExtension" ); if ( supportedExtension == null ) { supportedExtension = new LockableAttributeImpl( "supportedExtension" ); rootDSE.put( supportedExtension ); } for ( Iterator oids = extensionOids.iterator(); oids.hasNext(); ) { supportedExtension.add( ( String ) oids.next() ); } } }
protected void removeSpi( String key ) { Attribute attr = new LockableAttributeImpl( key ); ModificationItemImpl mi = new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE, attr ); addDelta( mi ); }
return new LockableAttributeImpl( "objectClass" ); return new LockableAttributeImpl( "objectClasses" );
protected void putSpi( String key, String value ) { Attribute attr = new LockableAttributeImpl( key ); attr.add( value ); ModificationItemImpl mi = new ModificationItemImpl( DirContext.REPLACE_ATTRIBUTE, attr ); addDelta( mi ); }
Attribute attr = new LockableAttributeImpl( SUBENTRY_OPATTRS[ii] ); attr.add( dn ); modList.add( new ModificationItemImpl( DirContext.REMOVE_ATTRIBUTE, attr ) );
Attribute attr = new LockableAttributeImpl( "subschemaSubentry" ); attr.add( "cn=schema,ou=system" ); rootDSE.put( attr ); attr = new LockableAttributeImpl( "supportedLDAPVersion" ); rootDSE.put( attr ); attr.add( "3" ); attr = new LockableAttributeImpl( "supportedFeatures" ); rootDSE.put( attr ); attr.add( "1.3.6.1.4.1.4203.1.5.1" ); attr = new LockableAttributeImpl( "supportedExtension" ); rootDSE.put( attr ); attr.add( NoticeOfDisconnect.EXTENSION_OID ); attr = new LockableAttributeImpl( "supportedControl" ); rootDSE.put( attr ); attr.add( PersistentSearchControl.CONTROL_OID ); attr = new LockableAttributeImpl( "objectClass" ); rootDSE.put( attr ); attr.add( "top" ); attr.add( "extensibleObject" ); attr = new LockableAttributeImpl( NAMINGCTXS_ATTR ); rootDSE.put( attr ); attr = new LockableAttributeImpl( VENDORNAME_ATTR );
private void filterObjectClass( Attributes entry ) throws NamingException { List objectClasses = new ArrayList(); Attribute oc = entry.get( "objectClass" ); if ( oc != null ) { getObjectClasses( oc, objectClasses ); entry.remove( "objectClass" ); Attribute newOc = new LockableAttributeImpl( "objectClass" ); for ( int i = 0; i < objectClasses.size(); i++ ) { Object currentOC = objectClasses.get(i); if ( currentOC instanceof String ) { newOc.add( currentOC ); } else { newOc.add( ( (ObjectClass)currentOC ).getName() ); } } newOc.add( "top" ); entry.put( newOc ); } }
/** * Adds extra operational attributes to the entry before it is added. */ public void add(NextInterceptor nextInterceptor, LdapDN normName, Attributes entry) throws NamingException { String principal = getPrincipal().getName(); Attribute attribute = new LockableAttributeImpl( "creatorsName" ); attribute.add( principal ); entry.put( attribute ); attribute = new LockableAttributeImpl( "createTimestamp" ); attribute.add( DateUtils.getGeneralizedTime() ); entry.put( attribute ); nextInterceptor.add(normName, entry ); }
LockableAttributeImpl attr = new LockableAttributeImpl( id ); int pos = ( id.length() << 1 ) + 4;
public void move( NextInterceptor nextInterceptor, LdapDN name, LdapDN newParentName ) throws NamingException { nextInterceptor.move( name, newParentName ); // add operational attributes after call in case the operation fails Attributes attributes = new LockableAttributesImpl( true ); Attribute attribute = new LockableAttributeImpl( "modifiersName" ); attribute.add( getPrincipal().getName() ); attributes.put( attribute ); attribute = new LockableAttributeImpl( "modifyTimestamp" ); attribute.add( DateUtils.getGeneralizedTime() ); attributes.put( attribute ); nexus.modify( newParentName, DirContext.REPLACE_ATTRIBUTE, attributes ); }
public void modify( NextInterceptor nextInterceptor, LdapDN name, ModificationItemImpl[] items ) throws NamingException { nextInterceptor.modify( name, items ); // add operational attributes after call in case the operation fails Attributes attributes = new LockableAttributesImpl( true ); Attribute attribute = new LockableAttributeImpl( "modifiersName" ); attribute.add( getPrincipal().getName() ); attributes.put( attribute ); attribute = new LockableAttributeImpl( "modifyTimestamp" ); attribute.add( DateUtils.getGeneralizedTime() ); attributes.put( attribute ); nexus.modify( name, DirContext.REPLACE_ATTRIBUTE, attributes ); }
Attribute objectClass = new LockableAttributeImpl( "objectClass" ); objectClass.add( TOP_ATTR ); objectClass.add( JOBJECT_ATTR ); Attribute javaClassNames = new LockableAttributeImpl( JCLASSNAMES_ATTR );
final LockableAttributeImpl attr = new LockableAttributeImpl( id ); int pos = ( id.length() << 1 ) + 4 + offset;
public void move( NextInterceptor nextInterceptor, LdapDN name, LdapDN newParentName, String newRn, boolean deleteOldRn ) throws NamingException { nextInterceptor.move( name, newParentName, newRn, deleteOldRn ); // add operational attributes after call in case the operation fails Attributes attributes = new LockableAttributesImpl( true ); Attribute attribute = new LockableAttributeImpl( "modifiersName" ); attribute.add( getPrincipal().getName() ); attributes.put( attribute ); attribute = new LockableAttributeImpl( "modifyTimestamp" ); attribute.add( DateUtils.getGeneralizedTime() ); attributes.put( attribute ); nexus.modify( newParentName, DirContext.REPLACE_ATTRIBUTE, attributes ); }
public void modify( NextInterceptor nextInterceptor, LdapDN name, int modOp, Attributes attrs ) throws NamingException { nextInterceptor.modify( name, modOp, attrs ); // add operational attributes after call in case the operation fails Attributes attributes = new LockableAttributesImpl( true ); Attribute attribute = new LockableAttributeImpl( "modifiersName" ); attribute.add( getPrincipal().getName() ); attributes.put( attribute ); attribute = new LockableAttributeImpl( "modifyTimestamp" ); attribute.add( DateUtils.getGeneralizedTime() ); attributes.put( attribute ); nexus.modify( name, DirContext.REPLACE_ATTRIBUTE, attributes ); }
/** * Sets up a new ServerPreferences node by injecting the required information * such as the node name attribute and the objectClass attribute. * * @param name the name of the new ServerPreferences node. */ private void setUpNode( String name ) throws NamingException { Attributes attrs = new LockableAttributesImpl(); Attribute attr = new LockableAttributeImpl( "objectClass" ); attr.add( "top" ); attr.add( "prefNode" ); attr.add( "extensibleObject" ); attrs.put( attr ); attr = new LockableAttributeImpl( "prefNodeName" ); attr.add( name ); attrs.put( attr ); LdapContext parent = ( ( ServerSystemPreferences ) parent() ).getLdapContext(); parent.bind( "prefNodeName=" + name, null, attrs ); ctx = ( LdapContext ) parent.lookup( "prefNodeName=" + name ); super.newNode = false; }
Attribute binary = new LockableAttributeImpl( id );
LockableAttributeImpl attr = new LockableAttributeImpl( id ); pos += ( id.length() << 1 ) + 4;
public void modifyRn( NextInterceptor nextInterceptor, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException { nextInterceptor.modifyRn( name, newRn, deleteOldRn ); // add operational attributes after call in case the operation fails Attributes attributes = new LockableAttributesImpl( true ); Attribute attribute = new LockableAttributeImpl( "modifiersName" ); attribute.add( getPrincipal().getName() ); attributes.put( attribute ); attribute = new LockableAttributeImpl( "modifyTimestamp" ); attribute.add( DateUtils.getGeneralizedTime() ); attributes.put( attribute ); LdapDN newDn = ( LdapDN ) name.clone(); newDn.remove( name.size() - 1 ); newDn.add( newRn ); newDn.normalize( registry.getNormalizerMapping() ); nexus.modify( newDn, DirContext.REPLACE_ATTRIBUTE, attributes ); }
entryAttrToAddTo = new LockableAttributeImpl( mods.getID() ); entry.put( entryAttrToAddTo );