/** * Write an LDAP entry into LDIF file as LDAPContent data. * An LDAPEntry is written as a SearchResultEntry record. * * <p>You are not allowed to mix request data and content data</p> * * @param entry LDAPEntry object * * @param controls Controls that were returned with this entry * * @throws IOException if an I/O error occurs. * * @see com.novell.ldap.LDAPEntry */ public void writeEntry( LDAPEntry entry, LDAPControl[] controls) throws IOException, LDAPLocalException { checkState(true); writeEntry( entry, controls, null); return; }
/** * Write an LDAP entry into LDIF file as LDAPContent data. * An LDAPEntry is written as a SearchResultEntry record. * * <p>You are not allowed to mix request data and content data</p> * * @param entry LDAPEntry object * * @throws IOException if an I/O error occurs. * * @see com.novell.ldap.LDAPEntry */ public void writeEntry( LDAPEntry entry) throws IOException, LDAPLocalException { checkState(true); writeEntry( entry, null, null); return; }
private void writeModifyDNRequestEntry( LDAPModifyDNRequest request, LDAPControl[] controls, String requestID) throws IOException, LDAPLocalException { checkState(false); // added this fix for OCT' 04 NDK if( (controls !=null) && (controls.length != 0)) { writeControls(controls, 3); } newLine(1); out.write("</modDNRequest>"); return; }
private void writeDeleteRequestEntry( LDAPDeleteRequest request, LDAPControl[] controls, String requestID) throws IOException, LDAPLocalException { checkState(false); // added this fix for OCT' 04 NDK if( (controls !=null) && (controls.length != 0)) { writeControls(controls, 3); } newLine(1); out.write("</delRequest>"); return; }
private void writeCompareRequestEntry( LDAPCompareRequest request, LDAPControl[] controls, String requestID) throws IOException, LDAPLocalException { checkState(false); newLine(2); out.write("<assertion name=\"" + request.getAttributeDescription()); out.write("\">"); newLine(3); out.write("<value>"); byte[] vals=request.getAssertionValue(); if (Base64.isLDIFSafe(vals)) out.write(new String(vals,"UTF-8")); else out.write(Base64.encode(vals)); out.write("</value>"); newLine(2); out.write("</assertion>"); // added this fix for OCT' 04 NDK if( (controls !=null) && (controls.length != 0)) { writeControls(controls, 3); } newLine(1); out.write("</compareRequest>"); } /*
private void writeAddRequestEntry( LDAPAddRequest request, LDAPControl[] controls, String requestID) throws IOException, LDAPLocalException { checkState(false); LDAPEntry entry=request.getEntry(); LDAPAttributeSet set = entry.getAttributeSet(); Iterator i = set.iterator(); while (i.hasNext()){ writeAttribute( (LDAPAttribute) i.next()); } if( (controls !=null) && (controls.length != 0)) { writeControls(controls, 3); } newLine(1); out.write("</addRequest>"); return; }
checkState(true); } catch (LDAPLocalException lle){ throw new IOException(lle.toString());
throws IOException, LDAPLocalException checkState(false);
throws IOException, LDAPLocalException checkState(true); newLine(2); out.write("<searchResultEntry dn=\"");
private void writeExtendedRequestEntry( LDAPExtendedRequest request, LDAPControl[] controls, String requestID) throws IOException, LDAPLocalException { checkState(false); newLine(2); out.write("<requestName>"); out.write(request.getExtendedOperation().getID()); out.write("</requestName>"); byte[] vals=request.getExtendedOperation().getValue(); if( vals != null) { newLine(2); out.write("<requestValue xsi:type=\"xsd:base64Binary\">"); out.write(Base64.encode(vals)); out.write("</requestValue>"); } // added this fix for OCT' 04 NDK if( (controls !=null) && (controls.length != 0)) { writeControls(controls, 3); } newLine(1); out.write("</extendedRequest>"); return; }
throws IOException, LDAPLocalException checkState(false); LDAPModification[] modList=request.getModifications(); for(int i=0; i< modList.length; i++){
(messageToWrite instanceof LDAPSearchResult) || (messageToWrite instanceof LDAPSearchResultReference)){ checkState(true); } else {//must be a request checkState(false);