Tabnine Logo
DirSyncControl
Code IndexAdd Tabnine to your IDE (free)

How to use
DirSyncControl
in
org.ldaptive.ad.control

Best Java code snippets using org.ldaptive.ad.control.DirSyncControl (Showing top 20 results out of 315)

origin: org.ldaptive/ldaptive

@Override
public String toString()
{
 return
  String.format(
   "[%s@%d::criticality=%s, flags=%s, maxAttributeCount=%s, cookie=%s]",
   getClass().getName(),
   hashCode(),
   getCriticality(),
   flags,
   maxAttributeCount,
   LdapUtils.base64Encode(cookie));
}
origin: org.ldaptive/ldaptive

/**
 * Returns the dir sync cookie in the supplied response or null if no cookie exists.
 *
 * @param  response  of a previous dir sync operation
 *
 * @return  dir sync cookie or null
 */
protected byte[] getDirSyncCookie(final Response<SearchResult> response)
{
 byte[] cookie = null;
 final DirSyncControl ctl = (DirSyncControl) response.getControl(DirSyncControl.OID);
 if (ctl != null) {
  if (ctl.getCookie() != null && ctl.getCookie().length > 0) {
   cookie = ctl.getCookie();
  }
 }
 return cookie;
}
origin: vt-middleware/ldaptive

/**
 * Returns the dir sync flags in the supplied response or -1 if no flags exists.
 *
 * @param  response  of a previous dir sync operation
 *
 * @return  dir sync flags or -1
 */
protected long getDirSyncFlags(final Response<SearchResult> response)
{
 long flags = -1;
 final DirSyncControl ctl = (DirSyncControl) response.getControl(DirSyncControl.OID);
 if (ctl != null) {
  flags = ctl.getFlags();
 }
 return flags;
}
origin: org.ldaptive/ldaptive

@Override
public int hashCode()
{
 return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), flags, maxAttributeCount, cookie);
}
origin: com.floragunn/ldaptive

/**
 * Creates a new dir sync control.
 *
 * @param  f  request flags
 * @param  value  dir sync cookie
 * @param  count  maximum attribute count
 * @param  critical  whether this control is critical
 */
public DirSyncControl(final Flag[] f, final byte[] value, final int count, final boolean critical)
{
 super(OID, critical);
 if (f != null) {
  long l = 0;
  for (Flag flag : f) {
   if (flag != null) {
    l += flag.value();
   }
  }
  setFlags(l);
 }
 setCookie(value);
 setMaxAttributeCount(count);
}
origin: com.floragunn/ldaptive

@Override
public byte[] encode()
{
 final ConstructedDEREncoder se = new ConstructedDEREncoder(
  UniversalDERTag.SEQ,
  new IntegerType(BigInteger.valueOf(getFlags())),
  new IntegerType(getMaxAttributeCount()),
  new OctetStringType(getCookie() != null ? getCookie() : EMPTY_COOKIE));
 return se.encode();
}
origin: org.ldaptive/ldaptive-apache

 final DirSyncControl c = (DirSyncControl) requestControl;
 ctl = new AdDirSyncImpl();
 ((AdDirSyncImpl) ctl).setCookie(c.getCookie());
 ((AdDirSyncImpl) ctl).setFlags(AdDirSyncFlag.getFlags((int) c.getFlags()));
 ((AdDirSyncImpl) ctl).setMaxReturnLength(c.getMaxAttributeCount());
 ctl.setCritical(c.getCriticality());
} else if (VirtualListViewRequestControl.OID.equals(requestControl.getOID())) {
 final VirtualListViewRequestControl c = (VirtualListViewRequestControl) requestControl;
origin: vt-middleware/ldaptive

 /**
  * @param  berValue  to decode.
  * @param  expected  dir sync control to test.
  *
  * @throws  Exception  On test failure.
  */
 @Test(groups = {"control"}, dataProvider = "request-response")
 public void decode(final byte[] berValue, final DirSyncControl expected)
  throws Exception
 {
  final DirSyncControl actual = new DirSyncControl(expected.getCriticality());
  actual.decode(berValue);
  Assert.assertEquals(actual, expected);
 }
}
origin: org.ldaptive/ldaptive

 /**
  * Returns the list of request controls configured for this client.
  *
  * @param  cookie  to add to the dir sync control or null
  *
  * @return  search request controls
  */
 private RequestControl[] createRequestControls(final byte[] cookie)
 {
  return
   new RequestControl[] {
    new DirSyncControl(dirSyncFlags, cookie, maxAttributeCount, true),
    new ExtendedDnControl(extendedDnFlag),
    new ShowDeletedControl(),
   };
 }
}
origin: com.floragunn/ldaptive

 @Override
 public void handle(final DERParser parser, final ByteBuffer encoded)
 {
  final byte[] cookie = OctetStringType.readBuffer(encoded);
  if (cookie != null && cookie.length > 0) {
   getObject().setCookie(cookie);
  }
 }
}
origin: com.floragunn/ldaptive

 @Override
 public void handle(final DERParser parser, final ByteBuffer encoded)
 {
  getObject().setMaxAttributeCount(IntegerType.decode(encoded).intValue());
 }
}
origin: com.floragunn/ldaptive

 @Override
 public void handle(final DERParser parser, final ByteBuffer encoded)
 {
  getObject().setFlags(IntegerType.decode(encoded).longValue());
 }
}
origin: org.ldaptive/ldaptive

@Override
public byte[] encode()
{
 final ConstructedDEREncoder se = new ConstructedDEREncoder(
  UniversalDERTag.SEQ,
  new IntegerType(BigInteger.valueOf(getFlags())),
  new IntegerType(getMaxAttributeCount()),
  new OctetStringType(getCookie() != null ? getCookie() : EMPTY_COOKIE));
 return se.encode();
}
origin: vt-middleware/ldaptive

 /**
  * Returns the list of request controls configured for this client.
  *
  * @param  cookie  to add to the dir sync control or null
  *
  * @return  search request controls
  */
 private RequestControl[] createRequestControls(final byte[] cookie)
 {
  return
   new RequestControl[] {
    new DirSyncControl(dirSyncFlags, cookie, maxAttributeCount, true),
    new ExtendedDnControl(extendedDnFlag),
    new ShowDeletedControl(),
   };
 }
}
origin: vt-middleware/ldaptive

@Override
public int hashCode()
{
 return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), flags, maxAttributeCount, cookie);
}
origin: org.ldaptive/ldaptive

/**
 * Creates a new dir sync control.
 *
 * @param  f  request flags
 * @param  value  dir sync cookie
 * @param  count  maximum attribute count
 * @param  critical  whether this control is critical
 */
public DirSyncControl(final Flag[] f, final byte[] value, final int count, final boolean critical)
{
 super(OID, critical);
 if (f != null) {
  long l = 0;
  for (Flag flag : f) {
   if (flag != null) {
    l += flag.value();
   }
  }
  setFlags(l);
 }
 setCookie(value);
 setMaxAttributeCount(count);
}
origin: vt-middleware/ldaptive

 @Override
 public void handle(final DERParser parser, final ByteBuffer encoded)
 {
  final byte[] cookie = OctetStringType.readBuffer(encoded);
  if (cookie != null && cookie.length > 0) {
   getObject().setCookie(cookie);
  }
 }
}
origin: org.ldaptive/ldaptive

 @Override
 public void handle(final DERParser parser, final ByteBuffer encoded)
 {
  getObject().setMaxAttributeCount(IntegerType.decode(encoded).intValue());
 }
}
origin: org.ldaptive/ldaptive

 @Override
 public void handle(final DERParser parser, final ByteBuffer encoded)
 {
  getObject().setFlags(IntegerType.decode(encoded).longValue());
 }
}
origin: vt-middleware/ldaptive

@Override
public byte[] encode()
{
 final ConstructedDEREncoder se = new ConstructedDEREncoder(
  UniversalDERTag.SEQ,
  new IntegerType(BigInteger.valueOf(getFlags())),
  new IntegerType(getMaxAttributeCount()),
  new OctetStringType(getCookie() != null ? getCookie() : EMPTY_COOKIE));
 return se.encode();
}
org.ldaptive.ad.controlDirSyncControl

Javadoc

Request/response control for active directory synchronization. Control is defined as:
 
dirSyncValue ::= SEQUENCE { 
flags              INTEGER, 
maxAttributeCount  INTEGER, 
cookie             OCTET STRING 
} 

See http://msdn.microsoft.com/en-us/library/cc223347.aspx

Most used methods

  • <init>
    Creates a new dir sync control.
  • getCriticality
  • getCookie
    Returns the sync request cookie.
  • getFlags
    Returns the flags value.
  • getMaxAttributeCount
    Returns the maximum attribute count.
  • getOID
  • hashCode
  • setCookie
    Sets the sync request cookie.
  • setFlags
    Sets the flags.
  • setMaxAttributeCount
    Sets the maximum attribute count.
  • decode
  • encode
  • decode,
  • encode

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • startActivity (Activity)
  • setRequestProperty (URLConnection)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Best IntelliJ 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