|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.ldap.util.DSMLWriter
Writes LDAPMessages into a Writer or outputStream as DSML batch requests and batch responses.
DSMLReader
,
DOMWriter
,
LDAPMessage
Constructor Summary | |
DSMLWriter(java.io.OutputStream stream)
Initializes this writer with the specified outputstream to write DSML into. |
|
DSMLWriter(java.lang.String file)
Initializes this writer by opening the specified file to write DSML into. |
|
DSMLWriter(java.io.Writer writer)
Initializes this writer with the specified writer to write DSML into. |
Method Summary | |
void |
finish()
Writes closing tags for searchResponse, batchRequests, and batchResponse depending on the current state. |
java.lang.String |
getVersion()
Gets the version of the LDIF data associated with the input stream |
boolean |
isRequest()
Returns true if request data ist associated with the input stream, or false if content data. |
boolean |
isUseSOAP()
|
void |
setIndent(int spaces)
Sets the number of spaces for indentation of XML tags. |
void |
setResumeOnError(boolean resumeOnError)
|
void |
setUseSOAP(boolean useSOAP)
|
void |
useIndent(boolean useIndent)
Turns on or off 'pretty-printing' of XML with newlines and indentation to make output more readable. |
void |
writeComments(java.lang.String lines)
Writes the specified strings as XML comments. |
void |
writeEntry(LDAPEntry entry)
Write an LDAP entry into LDIF file as LDAPContent data. |
void |
writeEntry(LDAPEntry entry,
LDAPControl[] controls)
Write an LDAP entry into LDIF file as LDAPContent data. |
void |
writeEntry(LDAPEntry entry,
LDAPControl[] controls,
java.lang.String requestID)
Write an LDAP entry into LDIF file as LDAPContent data. |
void |
writeError(java.lang.Exception e)
Any Exception can be written in DSML with this method, via the |
void |
writeMessage(LDAPMessage messageToWrite)
Writes an LDAPMessage as DSML. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DSMLWriter(java.lang.String file) throws java.io.FileNotFoundException
file
- File to write DSML
java.io.FileNotFoundException
- occurs when the specified file could not
be opened or is not found.public DSMLWriter(java.io.OutputStream stream)
stream
- Output stream to write DSMLpublic DSMLWriter(java.io.Writer writer)
writer
- Writer to write DSMLMethod Detail |
public void setResumeOnError(boolean resumeOnError)
public void writeError(java.lang.Exception e) throws java.io.IOException
writeError
in interface LDAPWriter
e
- LDAPException to be written in DSML.
java.io.IOException
public void finish() throws java.io.IOException
finish
in interface LDAPWriter
java.io.IOException
public void writeComments(java.lang.String lines) throws java.io.IOException
writeComments
in interface LDAPWriter
lines
- Comments to be written
java.io.IOException
public void writeMessage(LDAPMessage messageToWrite) throws java.io.IOException, LDAPLocalException
writeMessage
in interface LDAPWriter
messageToWrite
- Message to be written as DSML
LDAPLocalException
- Occurs when a message is written out of
sequence, i.e. a response is written into a batchRequest.
java.io.IOException
- if an I/O error occurs.public void writeEntry(LDAPEntry entry) throws java.io.IOException, LDAPLocalException
You are not allowed to mix request data and content data
writeEntry
in interface LDAPWriter
entry
- LDAPEntry object
java.io.IOException
- if an I/O error occurs.
LDAPLocalException
LDAPEntry
public void writeEntry(LDAPEntry entry, LDAPControl[] controls) throws java.io.IOException, LDAPLocalException
You are not allowed to mix request data and content data
writeEntry
in interface LDAPWriter
entry
- LDAPEntry objectcontrols
- Controls that were returned with this entry
java.io.IOException
- if an I/O error occurs.
LDAPLocalException
LDAPEntry
public void writeEntry(LDAPEntry entry, LDAPControl[] controls, java.lang.String requestID) throws java.io.IOException, LDAPLocalException
You are not allowed to mix request data and content data
entry
- LDAPEntry objectcontrols
- Controls that were returned with this entryrequestID
- the String that associates this response with the request
java.io.IOException
- if an I/O error occurs.
LDAPLocalException
LDAPEntry
public java.lang.String getVersion()
getVersion
in interface LDAPWriter
public boolean isRequest()
isRequest
in interface LDAPWriter
public void useIndent(boolean useIndent)
For efficiency, useIndent is set to false by default. The size of an indentation can be set using the method setIndent.
useIndent
- Indicates whether indentation and newlines should be
written to make the output DSML more readable.setIndent(int)
public void setIndent(int spaces)
This setting is ignored by default unless indentation is turned on via the useIndent method.
spaces
- Number of spaces used in each indentation.useIndent(boolean)
public boolean isUseSOAP()
public void setUseSOAP(boolean useSOAP)
useSOAP
- The useSOAP to set.
|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |