/** * Constructs a request to add an entry to the directory. * * @param entry The LDAPEntry to add to the directory. * * @param cont Any controls that apply to the add request, * or null if none. */ public LDAPAddRequest( LDAPEntry entry, LDAPControl[] cont) throws LDAPException { super( LDAPMessage.ADD_REQUEST, new RfcAddRequest( new RfcLDAPDN(entry.getDN()), makeRfcAttrList( entry)), cont); return; }
protected void setDeserializedValues(LDAPMessage readObject, RfcControls asn1Ctrls) throws IOException, ClassNotFoundException { // Check if it is the correct message type if(!(readObject instanceof LDAPAddRequest)) throw new ClassNotFoundException("Error occured while deserializing " + "LDAPAddRequest object"); LDAPAddRequest tmp = (LDAPAddRequest)readObject; LDAPEntry entry = tmp.getEntry(); tmp = null; //remove reference after getting properties RfcRequest operation = new RfcAddRequest( new RfcLDAPDN(entry.getDN()), LDAPAddRequest.makeRfcAttrList( entry)); message = new RfcLDAPMessage(operation, asn1Ctrls); // Garbage collect the readObject from readDSML().. readObject = null; } }