/** * Retrieves the optional requestID attribute on a BatchRequests. * @return requestID on a batchRequest or <tt>null</tt> if requestID is not * specified or the content is in a batchResponse. */ public String getBatchRequestID(){ return this.handler.getBatchRequestID(); }
public ArrayList getErrors() { return this.handler.getErrors(); } }
/** * Reads the current element and returns an LDAPMessage. * @return LDAPMessage found in the DSML DOM structure specified in the * constructor. */ public LDAPMessage readMessage() { if (this.messageIndex >= handler.getQueue().size()) return null; return (LDAPMessage) handler.getQueue().get( this.messageIndex ++ ); }
handler.startElement( "", simpleName, simpleName, wrapper); }else if (curChild instanceof Text){ String value = curChild.getNodeValue(); handler.characters(value.toCharArray(), 0, value.length()); handler.endElement("", simpleName, simpleName);
handleControl(attrs); prevstate = state; state = CONTROL; parseTagAttributes(tag, attrs); } else { throw new SAXException("Invalid beginning tag :" + strQName); parseTagAttributes(tag, attrs); break; case BATCH_RESPONSE : parseTagAttributes(LDAP_RESPONSE, attrs); } else if (tag == SEARCH_RESPONSE) { responsetype = LDAPMessage.SEARCH_RESPONSE; parseTagAttributes(tag, attrs); state = SEARCH_RESPONSE; } else if (tag == EXTENDED_RESPONSE) { responsetype = LDAPMessage.EXTENDED_RESPONSE; parseTagAttributes(LDAP_RESPONSE, attrs); state = EXTENDED_RESPONSE; } else if (tag == MODIFY_RESPONSE) { parseTagAttributes(LDAP_RESPONSE, attrs); } else if (tag == DEL_RESPONSE) { parseTagAttributes(LDAP_RESPONSE, attrs); } else if (tag == MODIFYDN_RESPONSE) {
/** * If requests in a batchRequest can be executed in parallel, this specifies * whether the responses can be written in any order. * * <p>This is determined by reading the "responseOrder" attribute on the tag * batchRequest. This attribute can take on the values of "sequential" or * "unordered" and defaults to "sequential" when the attribute is absent.<p> * * @return <tt>true</tt> if the content is a batchRequest with the attribute * <tt>responseOrder</tt> equal to <tt>unordered</tt>; and false otherwise. * */ public boolean isResponseUnordered(){ return this.handler.isResponseUnordered(); }
/** * Indicates whether the requests in a batchRequest can be executed in * parallel. * * <p>This is determined by reading the "processing" attribute on the tag * batchRequest. This attribute can take on the values of "sequential" or * "parallel" and defaults to "sequential" when the attribute is absent.<p> * * @return <tt>true</tt> if the content is a batchRequest with the attribute * <tt>processing</tt> equal to <tt>parallel</tt>; and false otherwise. * * <p>Other batchRequest properties:<p> * @see #getBatchRequestID * @see #isResponseUnordered * @see #isResumeOnError */ public boolean isParallelProcessing(){ return this.handler.isParallelProcessing(); }
/** * @deprecated use #DOMReader(Element) * Creates a reader that reads a DOM document and translates it into * LDAPMessages. * <p>The first batchRequest or batchResponse is located and all nodes * within it will be read and translated into LDAPMessages</p> * * @param dsmlDoc Document with a DSML batchRequest or batchResponse * @throws LDAPLocalException Occurs when no batchRequest or batchResponse * is found, or the document is invalid DSML. */ public DOMReader(Document dsmlDoc) throws LDAPLocalException { this.root = (Element) dsmlDoc.getElementsByTagName("batchRequest").item(0); if (this.root == null){ this.root = (Element) dsmlDoc.getElementsByTagNameNS("*", "batchResponse").item(0); } if (this.root == null){ throw new IllegalArgumentException( "DOMReader: could not locate a batchRequest or batchResponse"); } handler = new DSMLHandler(); processNodes(root.getParentNode()); }
/** * If requests in a batchRequest can be executed in parallel, this specifies * whether the responses can be written in any order. * * <p>This is determined by reading the "responseOrder" attribute on the tag * batchRequest. This attribute can take on the values of "sequential" or * "unordered" and defaults to "sequential" when the attribute is absent.<p> * * @return <tt>true</tt> if the content is a batchRequest with the attribute * <tt>responseOrder</tt> equal to <tt>unordered</tt>; and false otherwise. * */ public boolean isResponseUnordered(){ return this.handler.isResponseUnordered(); }
/** * Indicates whether the requests in a batchRequest can be executed in * parallel. * * <p>This is determined by reading the "processing" attribute on the tag * batchRequest. This attribute can take on the values of "sequential" or * "parallel" and defaults to "sequential" when the attribute is absent.<p> * * @return <tt>true</tt> if the content is a batchRequest with the attribute * <tt>processing</tt> equal to <tt>parallel</tt>; and false otherwise. * * <p>Other batchRequest properties:<p> * @see #getBatchRequestID * @see #isResponseUnordered * @see #isResumeOnError */ public boolean isParallelProcessing(){ return this.handler.isParallelProcessing(); }
/** * Creates a reader that read a DOM element and translate it into * LDAPMessages. * <p>Requests or responses must be inside of the batchRequest or * batchResponse specified</p> * @param root Element with a name of batchRequest or batchResponse. * @throws LDAPLocalException Occurs when no batchRequest or batchResponse * is found, or the Element is invalid DSML. */ public DOMReader(Element root) throws LDAPLocalException { this.root = root; String name = root.getLocalName(); if (name == null){ name = root.getNodeName(); } if (!name.equals("batchRequest") && !name.equals("batchResponse") ) { throw new IllegalArgumentException ( "DOMReader: specified root element " + "must be a batchRequest or a batchResponse"); } handler = new DSMLHandler(); processNodes(root.getParentNode()); return; }
/** * Retrieves the optional requestID attribute on a BatchRequests. * @return requestID on a batchRequest or <tt>null</tt> if requestID is not * specified or the content is in a batchResponse. */ public String getBatchRequestID(){ return this.handler.getBatchRequestID(); }
/** * Retrieves the current LDAPMessage and advances to the next. * * <p>This method is used to iterate over all DSML tags parsed into * LDAPMessages<p> * @return LDAPMessage found in the DSML source specified in the * constructor. */ public LDAPMessage readMessage() { if (this.messageIndex >= handler.getQueue().size()) return null; return (LDAPMessage) handler.getQueue().get( this.messageIndex ++ ); }