congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
DSMLWriter
Code IndexAdd Tabnine to your IDE (free)

How to use
DSMLWriter
in
com.novell.ldap.util

Best Java code snippets using com.novell.ldap.util.DSMLWriter (Showing top 20 results out of 315)

origin: com.novell.ldap/jldap

/**
 * This method does DSML serialization of the instance.
 *
 * @param oout Outputstream where the serialzed data has to be written
 *
 * @throws IOException if write fails on OutputStream 
 */    
public void writeDSML(java.io.OutputStream  oout) throws java.io.IOException
{
  com.novell.ldap.util.DSMLWriter out=new 
           com.novell.ldap.util.DSMLWriter(oout);
  try{
    out.useIndent(true);
    out.setIndent(4);    	
    out.writeMessage(this);
    out.finish();
  }catch(LDAPLocalException le){
      }
}

origin: com.novell.ldap/jldap

  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;
  }
    
origin: com.novell.ldap/jldap

/**
 * 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;
}
origin: com.novell.ldap/jldap

  (messageToWrite instanceof LDAPSearchResult) ||
  (messageToWrite instanceof LDAPSearchResultReference)){
  checkState(true);
} else {//must be a request
  checkState(false);
      newLine(1);
      writeTagWithID("searchRequest", messageToWrite);
      state = REQUEST_BATCH;
    writeSearchRequest((LDAPSearchRequest) messageToWrite);
    break;
      newLine(1);
      writeTagWithID("extendedRequest", messageToWrite);
      state = REQUEST_BATCH;
    writeExtendedRequest((LDAPExtendedRequest) messageToWrite);
    break;
      newLine(1);
      writeTagWithID("compareRequest", messageToWrite);
      state = REQUEST_BATCH;
    writeCompareRequest((LDAPCompareRequest) messageToWrite);
    break;
      newLine(1);
      writeTagWithID("addRequest", messageToWrite);
origin: com.novell.ldap/jldap

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;        
}

origin: com.novell.ldap/jldap

  throws IOException, LDAPLocalException
checkState(false);
newLine(2);
 out.write("<attributes>");
String[] attrs = request.getAttributes();
for(int i=0; i< attrs.length; i++){
newLine(3);        
out.write("<attribute name=\"");
out.write(attrs[i]);
out.write("\"/>");
newLine(2);                
out.write("</attributes>");
newLine(2);                
out.write("<filter>");
Iterator itr=request.getSearchFilter();
writeFilter(itr);
newLine(2);
out.write("</filter>");                
  writeControls(controls, 3);
newLine(1);
out.write("</searchRequest>");
origin: com.novell.ldap/jldap

/**
 * Used to write an attribute and its values.
 * @param attr Attribute to be written.
 */
private void writeAttribute(LDAPAttribute attr) throws IOException
{
  newLine(3);
  out.write("<attr name=\"");
  out.write(attr.getName());
  out.write("\">");
  String values[] = attr.getStringValueArray();
  byte bytevalues[][] = attr.getByteValueArray();
  for(int i=0; i<values.length; i++){
    newLine(4);
    
    if (Base64.isValidUTF8(bytevalues[i],true) && this.isXMLSafe(bytevalues[i])){
      out.write("<value>");
      String xmlvalue = makeAttributeSafe(values[i]);
      out.write(xmlvalue);
      out.write("</value>");
    } else {
      out.write("<value xsi:type=\"xsd:base64Binary\">");
      out.write(Base64.encode(bytevalues[i]));
      out.write("</value>");
    }
  }
  newLine(3);
  out.write("</attr>");
  return;
}
origin: com.novell.ldap/jldap

  checkState(true);
} catch (LDAPLocalException lle){
  throw new IOException(lle.toString());
newLine(1);
out.write("<errorResponse type=\"");
if (e instanceof LDAPException){
  out.write("other\">");
newLine(2);
out.write("<message>");
newLine(3);
if (e instanceof LDAPException) {
  LDAPException le = (LDAPException) e;
  String msg = Integer.toString(le.getResultCode()) + ":" + le.getMessage();
  out.write(makeXMLSafe(msg));
} else {
  out.write(makeXMLSafe(e.getMessage()));
newLine(2);
out.write("</message>");
newLine(1);
out.write("</errorResponse>");
return;
origin: com.novell.ldap/jldap

switch (op){
  case RfcFilter.AND:
    newLine(3);
    out.write("<and>");
    break;
  case RfcFilter.OR:
    newLine(3);
    out.write("<or>");
    break;
  case RfcFilter.NOT:
    newLine(3);
    out.write("<not>");
    break;
  case RfcFilter.EQUALITY_MATCH:{
     newLine(4);
     out.write("<equalityMatch name=\"");
     out.write((String)itr.next());
     out.write("\">");
     byte[] value = (byte[])itr.next();
     newLine(5);                         
     out.write("<value>");
     out.write(byteString(value));
     out.write("</value>");
     newLine(4);                         
     out.write("</equalityMatch>");                         
     break;
     newLine(4);
     out.write("<greaterOrEqual name=\"");
origin: com.novell.ldap/jldap

  writeControls(controls, indent);
if (referrals != null){
  for(int i=0; i<referrals.length; i++){
    newLine(indent);
    out.write("<referral>"+referrals[i]+"</referral>");
newLine(indent);
out.write("<resultCode code=\"");
out.write(new Integer(result.getResultCode()).toString());
  newLine(indent);
  out.write("<errorMessage>");
  out.write(makeXMLSafe(temp));
  out.write("</errorMessage>");
origin: com.novell.ldap/jldap

DSMLWriter writer = new DSMLWriter(out);
writer.writeMessage(message);
writer.finish();
origin: com.novell.ldap/jldap

/**
 * Writes referrences that are returned from a search.
 * @param ref search reference
 */
private void writeSearchResultReference(LDAPSearchResultReference ref)
    throws IOException
{
  String[] refs = ref.getReferrals();
  newLine(2);
  writeTagWithID("searchResultReference", ref);
  //out.write("<searchResultReference>");
  for(int i=0; i< refs.length; i++){
    newLine(3);
    out.write("<ref>");
    out.write(refs[i]);
    out.write("</ref>");
  }
  newLine(2);
  out.write("</searchResultReference>");
}
origin: com.novell.ldap/jldap

/**
 * Writes the specified strings as XML comments.
 * @param lines Comments to be written
 */
public void writeComments(String lines) throws IOException
{
  newLine(1);
  out.write("<!-- ");
  out.write(lines);
  out.write(" -->");
  return;
}
origin: com.novell.ldap/jldap

String matchedDN = ((LDAPResponse) message).getMatchedDN();
if (matchedDN != null && !matchedDN.equals("")){
  out.write(" matchedDN=\"" + this.makeAttributeSafe(matchedDN) + "\"");
out.write(" dn=\"" + this.makeAttributeSafe(dn) + "\"");
out.write(" dn=\"" + this.makeAttributeSafe(dn) + "\"");                        
out.write(" dn=\"" + this.makeAttributeSafe(dn) + "\"");                        
out.write(" dn=\"" + this.makeAttributeSafe(dn) + "\"");                        
out.write(" dn=\"" + this.makeAttributeSafe(dn) + "\"");
out.write(" newrdn=\"");
out.write(((LDAPModifyDNRequest) message).getNewRDN() + "\" deleteoldrdn=\"");
out.write(" dn=\"" + this.makeAttributeSafe(dn) + "\"");            
switch(scope)   {
  case LDAPConnection.SCOPE_BASE:
origin: com.novell.ldap/jldap

  throws IOException, LDAPLocalException
checkState(true);
newLine(2);
out.write("<searchResultEntry dn=\"");
out.write(this.makeAttributeSafe(entry.getDN()));
if( requestID != null) {
  out.write("\" requestID=\"" + requestID);
Iterator i = set.iterator();
while (i.hasNext()){
  writeAttribute( (LDAPAttribute) i.next());
  writeControls(controls, 3);
newLine(2);
out.write("</searchResultEntry>");
origin: com.novell.ldap/jldap

/**
 * 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;
}
origin: com.novell.ldap/jldap

newLine(0);
switch(state){
  case REQUEST_BATCH:
      out.write(tabString);
    out.write("</searchResponse>");
    newLine(0);
    out.write("</batchResponse>");
    break;
    newLine(0);
    out.write("</batchResponse>");
    break;                
newLine(0);
out.flush();
return;
origin: com.novell.ldap/jldap

  throws IOException, LDAPLocalException
checkState(false);
LDAPModification[] modList=request.getModifications();
for(int i=0; i< modList.length; i++){
  LDAPAttribute attr=modList[i].getAttribute();
  newLine(2);
  out.write("<modification name=\"");
  out.write(attr.getName());
  byte bytevalues[][] = attr.getByteValueArray();
  for(int j=0; j<values.length; j++){
    newLine(3);
    if (Base64.isValidUTF8(bytevalues[j], false)){
      out.write("<value>");
      String xmlvalue = makeAttributeSafe(values[j]);
      out.write(xmlvalue);
      out.write("</value>");
  newLine(2);
  out.write("</modification>");
   writeControls(controls, 3);
newLine(1);
out.write("</modifyRequest>");
return;
origin: com.novell.ldap/jldap

   com.novell.ldap.util.DSMLWriter((ObjectOutputStream)out);
writer.useIndent(true);
writer.setIndent(4); 
out.writeUTF(header);       
writer.writeMessage(this);
writer.finish();
out.writeUTF(tail);
origin: com.novell.ldap/jldap

  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;
  }    

com.novell.ldap.utilDSMLWriter

Javadoc

Writes LDAPMessages into a Writer or outputStream as DSML batch requests and batch responses.

Most used methods

  • <init>
    Initializes this writer by opening the specified file to write DSML into.
  • byteString
    Convert a UTF8 encoded string, or binary data, into a String encoded for a string filter.
  • checkState
    Tests the current state with a new message that is either a response or request. If the state is NEW
  • finish
    Writes closing tags for searchResponse, batchRequests, and batchResponse depending on the current st
  • isXMLSafe
  • makeAttributeSafe
  • makeXMLSafe
  • newLine
    Writes a new line and then the specified number of indentTabs to indent the next characters to be wr
  • setIndent
    Sets the number of spaces for indentation of XML tags.This setting is ignored by default unless inde
  • useIndent
    Turns on or off 'pretty-printing' of XML with newlines and indentation to make output more readable.
  • writeAddRequest
    Writes the Add request requested within a LDAP Add request
  • writeAddRequestEntry
  • writeAddRequest,
  • writeAddRequestEntry,
  • writeAttribute,
  • writeCompareRequest,
  • writeCompareRequestEntry,
  • writeControls,
  • writeDeleteRequest,
  • writeDeleteRequestEntry,
  • writeEntry,
  • writeExtendedRequest

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • findViewById (Activity)
  • getContentResolver (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now