public String toString() { return name + " \"" + ctxName.getName() + "\""; } }
/** * Return the normalized DN as a String. It returns the same value as the * getNormName method * * @return A String representing the normalized DN */ public String toString() { return getName(); }
/** * @see Object#toString() */ public String toString() { String name = (dn == null ? "null" : ( dn == DN.EMPTY_DN ? "\"\"" : dn.getName() ) ); return "ServerSearchResult : " + name + "\n" + serverEntry; } }
/** * {@inheritDoc} */ public String getSuffix() { return suffix.getName(); }
public String getSuffixDn() { if ( suffixDn == null ) { return null; } return suffixDn.getName(); }
/** * {@inheritDoc} */ public DN getUpSuffix() { if ( suffixDn == null ) { return null; } try { return new DN( suffixDn.getName() ); } catch ( LdapInvalidDnException e ) { // shouldn't happen LOG.error( "", e ); } return null; }
private BaseEntryFilteringCursor findSubTree(SearchOperationContext ctx) { DN dn = ctx.getDn(); log.debug("findSubTree()::dn=" + dn.getName()); //Will only search at one level return findOneLevel(ctx); }//findSubTree
@Override public String getConnectionDomainName() throws DirectoryServerException { LdapPrincipal adminPrinciple = getAdminPrinciple(); return adminPrinciple.getClonedName().getName(); }
/** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); BindRequestCodec request = ( BindRequestCodec ) instance; // AbandonID String name = request.getName().getName(); if ( ( name != null ) && ( !"".equals( name ) ) ) { element.addAttribute( "principal", name ); } return element; } }
/** * Returns a attribute given it's id * * @param attributeId * The attribute Id * @return The attribute if it exists */ public EntryAttribute get( String attributeId ) { if ( "dn".equalsIgnoreCase( attributeId ) ) { return new DefaultClientAttribute( "dn", entry.getDn().getName() ); } return entry.get( attributeId ); }
private static void addObjectClasses(ServerEntry serverEntry, List<String> objectClasses) throws DirectoryServerException { for (String objectClass : objectClasses) { try { serverEntry.add("objectClass", objectClass); } catch (LdapException e) { throwDirectoryServerException("Could not add class to partition " + serverEntry.getDn().getName(), e); } } }
private BaseEntryFilteringCursor findObject(SearchingOperationContext ctx) { DN dn = ctx.getDn(); String dnName = dn.getName(); ServerEntry se = ctx.getEntry(); log.debug("findObject()::dn=" + dnName + "::entry=" + se.toString()); //1. Try cache se = m_EntryCache.get(dn.getName()); if (se != null) { return new BaseEntryFilteringCursor( new SingletonCursor<ServerEntry>(se), ctx); } // return an empty result return new BaseEntryFilteringCursor(new EmptyCursor<ServerEntry>(), ctx); }//findObject
/** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); DelRequestCodec request = ( DelRequestCodec ) instance; // DN if ( request.getEntry() != null ) { element.addAttribute( "dn", request.getEntry().getName() ); } return element; }
/** * @see javax.naming.NamingEnumeration#next() */ public SearchResult next() throws NamingException { ServerSearchResult rec = result.next(); SearchResult searchResult = new SearchResult( rec.getDn().getName(), rec.getObject(), toBasicAttributes( rec.getServerEntry() ), rec.isRelative() ); return searchResult; }
/** * Simple Bind on a server. * * @param name The name we use to authenticate the user. It must be a * valid DN * @param credentials The password. It can't be null * @return The BindResponse LdapResponse */ public BindResponse bind( DN name, String credentials ) throws LdapException, IOException { LOG.debug( "Bind request : {}", name ); // Create the BindRequest BindRequest bindRequest = new BindRequest(); bindRequest.setCredentials( StringTools.getBytesUtf8( credentials ) ); if ( name == null ) { bindRequest.setName( StringTools.EMPTY ); } else { bindRequest.setName( name.getName() ); } return bind( bindRequest ); }
/** * @see java.util.Enumeration#nextElement() */ public SearchResult nextElement() { try { ServerSearchResult rec = result.next(); SearchResult searchResult = new SearchResult( rec.getDn().getName(), rec.getObject(), toBasicAttributes( rec.getServerEntry() ), rec.isRelative() ); return searchResult; } catch ( NamingException ne ) { NoSuchElementException nsee = new NoSuchElementException( I18n.err( I18n.ERR_468 ) ); nsee.initCause( ne ); throw nsee; } } };
/** * {@inheritDoc} */ public Element toDsml( Element root ) { Element element = super.toDsml( root ); ModifyDNRequestCodec request = ( ModifyDNRequestCodec ) instance; // DN if ( request.getEntry() != null ) { element.addAttribute( "dn", request.getEntry().getName() ); } // NewRDN if ( request.getNewRDN() != null ) { element.addAttribute( "newrdn", request.getNewRDN().getName() ); } // DeleteOldRDN element.addAttribute( "deleteoldrdn", ( request.isDeleteOldRDN() ? "true" : "false" ) ); // NewSuperior if ( request.getNewRDN() != null ) { element.addAttribute( "newSuperior", request.getNewSuperior().getName() ); } return element; }
reverted.setNewSuperior( oldSuperior.getName() );