public void rename( String dn, String newRdn, String newParentDN, boolean delOld, LDAPConstraints constr) throws LDAPException { LDAPControl[] controls = constr != null ? constr.getControls() : null; LDAPModifyDNRequest msg = new LDAPModifyDNRequest(dn,newRdn,newParentDN,delOld,controls); this.sendMessage(msg); }
/** * Returns the dn of the entry to rename or move in the directory * * @return the dn of the entry to rename or move */ public String getDN() { return getASN1Object().getRequestDN(); }
/** * Writes the Modify request requested within a LDAP Modify * request * @param request a search request entry */ private void writeModifyDNRequest(LDAPModifyDNRequest request) throws IOException, LDAPLocalException { writeModifyDNRequestEntry( request, request.getControls(), DOMWriter.findRequestID(request)); return; }
protected void setDeserializedValues(LDAPMessage readObject, RfcControls asn1Ctrls) throws IOException, ClassNotFoundException { // Check if it is the correct message type if(!(readObject instanceof LDAPModifyDNRequest)) throw new ClassNotFoundException("Error occured while deserializing " + "LDAPModifyDNRequest object"); LDAPModifyDNRequest tmp = (LDAPModifyDNRequest)readObject; String dn = tmp.getDN(); String newRdn = tmp.getNewRDN(); boolean deleteOldRdn = tmp.getDeleteOldRDN(); String newParentdn = tmp.getParentDN(); tmp = null; //remove reference after getting properties RfcRequest operation = new RfcModifyDNRequest( new RfcLDAPDN(dn), new RfcRelativeLDAPDN(newRdn), new ASN1Boolean(deleteOldRdn), (newParentdn != null) ? new RfcLDAPSuperDN(newParentdn) : null); message = new RfcLDAPMessage(operation, asn1Ctrls); // Garbage collect the readObject from readDSML().. readObject = null; } }
String dn = ((LDAPModifyDNRequest) message).getDN(); out.write(" dn=\"" + this.makeAttributeSafe(dn) + "\""); out.write(" newrdn=\""); out.write(((LDAPModifyDNRequest) message).getNewRDN() + "\" deleteoldrdn=\""); out.write(((LDAPModifyDNRequest) message).getDeleteOldRDN() + "\" newSuperior=\""); out.write(((LDAPModifyDNRequest) message).getParentDN() + "\"");
e = doc.createElement("modDNRequest"); LDAPModifyDNRequest moddn = (LDAPModifyDNRequest)message; e.setAttribute("dn", moddn.getDN()); e.setAttribute("newrdn", moddn.getNewRDN()); e.setAttribute("deleteoldrdn", moddn.getDeleteOldRDN()+""); String temp = moddn.getParentDN(); if (temp != null && temp.length() >0){ e.setAttribute("newSuperior", temp);
/** * Return an ASN1 representation of this mod DN request * * #return an ASN1 representation of this object */ public String toString() { return getASN1Object().toString(); } protected void setDeserializedValues(LDAPMessage readObject, RfcControls asn1Ctrls)
public void rename( String dn, String newRdn, String newParentDN, boolean delOld, LDAPConstraints constr) throws LDAPException { LDAPControl[] controls = constr != null ? constr.getControls() : null; LDAPModifyDNRequest msg = new LDAPModifyDNRequest(dn,newRdn,newParentDN,delOld,controls); this.sendMessage(msg); }
writeModifyDNRequest( rreq.getDN(), rreq.getNewRDN(), rreq.getDeleteOldRDN(), rreq.getParentDN(), controls ); break;
/** * Returns the newRDN of the entry to rename or move in the directory * * @return the newRDN of the entry to rename or move */ public String getNewRDN() { // Get the RFC request object for this request RfcModifyDNRequest req = (RfcModifyDNRequest)getASN1Object().getRequest(); RfcRelativeLDAPDN relDN = (RfcRelativeLDAPDN)req.toArray()[1]; return relDN.stringValue(); }
cons = defSearchCons; LDAPMessage msg = new LDAPModifyDNRequest( dn, newRdn, newParentdn, deleteOldRdn, cons.getControls());
/** * Returns the DeleteOldRDN flag that applies to the entry to rename or * move in the directory * * @return the DeleteOldRDN flag for the entry to rename or move */ public boolean getDeleteOldRDN() { // Get the RFC request object for this request RfcModifyDNRequest req = (RfcModifyDNRequest)getASN1Object().getRequest(); ASN1Boolean delOld = (ASN1Boolean)req.toArray()[2]; return delOld.booleanValue(); }
this.currentRequest = new LDAPModifyDNRequest( this.entryDN, this.modInfo[0], null, delOldRdn, controls); } else { this.currentRequest = new LDAPModifyDNRequest(this.entryDN, this.modInfo[0], modInfo[2], delOldRdn, controls);
/** * Returns the ParentDN for the entry move in the directory * * @return the ParentDN for the entry to move, or <dd>null</dd> * if the request is not a move. */ public String getParentDN() { // Get the RFC request object for this request RfcModifyDNRequest req = (RfcModifyDNRequest)getASN1Object().getRequest(); ASN1Object[] seq = req.toArray(); if( (seq.length < 4) || (seq[3] == null)) { return null; } RfcLDAPSuperDN parentDN = (RfcLDAPSuperDN)req.toArray()[3]; return parentDN.stringValue(); }
new LDAPModifyDNRequest( dn, newRDN,