/** {@inheritDoc} */
  @Override
  public void decode(final byte[] berValue) {
    logger.trace("decoding control: {}", LdapUtils.base64Encode(berValue));

    final DERParser parser = new DERParser();
    parser.registerHandler(SortResultHandler.PATH, new SortResultHandler(this));
    parser.registerHandler(AttributeTypeHandler.PATH, new AttributeTypeHandler(this));
    parser.parse(ByteBuffer.wrap(berValue));
  }
  /** {@inheritDoc} */
  @Override
  public void decode(final byte[] berValue) {
    logger.trace("decoding control: {}", LdapUtils.base64Encode(berValue));

    final DERParser parser = new DERParser();
    parser.registerHandler(CookieHandler.PATH, new CookieHandler(this));
    parser.registerHandler(RefreshDeletesHandler.PATH, new RefreshDeletesHandler(this));
    parser.parse(ByteBuffer.wrap(berValue));
  }
 /** {@inheritDoc} */
 @Override
 public String toString() {
   return String.format(
       "[%s@%d::criticality=%s, cookie=%s, refreshDeletes=%s]",
       getClass().getName(),
       hashCode(),
       getCriticality(),
       LdapUtils.base64Encode(cookie),
       refreshDeletes);
 }
 /**
  * Authorization identity response control test data.
  *
  * @return response test data
  */
 @DataProvider(name = "response")
 public Object[][] createData() {
   return new Object[][] {
     // dn:uid=1,ou=test,dc=ldaptive,dc=org
     // BER:
     // 64:6E:3A:75:69:64:3D:31:2C:6F:75:3D:74:65:73:74:2C:64:63:3D:6C:64:61:
     // 70:74:69:76:65:2C:64:63:3D:6F:72:67:
     new Object[] {
       LdapUtils.base64Decode("ZG46dWlkPTEsb3U9dGVzdCxkYz1sZGFwdGl2ZSxkYz1vcmc="),
       new AuthorizationIdentityResponseControl("dn:uid=1,ou=test,dc=ldaptive,dc=org"),
     },
   };
 }
Esempio n. 5
0
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(
       HASH_CODE_SEED,
       type1,
       type2,
       type3,
       typeCol1 != null ? Collections.unmodifiableCollection(typeCol1) : null,
       typeCol2 != null ? Collections.unmodifiableCollection(typeCol2) : null,
       typeSet1,
       typeSet2,
       typeList1,
       typeList2);
 }
 /**
  * Sync request control test data.
  *
  * @return response test data
  */
 @DataProvider(name = "request")
 public Object[][] createData() {
   return new Object[][] {
     // refresh only, reloadHint false
     // BER:30:06:02:01:01:01:01:00
     new Object[] {
       LdapUtils.base64Decode("MAYCAQEBAQA="),
       new SyncRequestControl(SyncRequestControl.Mode.REFRESH_ONLY, true),
     },
     // refresh and persist with cookie, reloadHint true
     // BER:30:30:3C:0A:01:03:04:34:72:69:64:3D:30:30:30:2C:63:73:6E:3D:32:30:
     //     31:32:30:37:30:36:31:38:31:35:35:32:2E:33:33:37:37:31:38:5A:23:30:
     //     30:30:30:30:30:23:30:30:30:23:30:30:30:30:30:30:01:01:FF:
     new Object[] {
       LdapUtils.base64Decode(
           "MDwCAQMENHJpZD0wMDAsY3NuPTIwMTIwNzA2MTgxNTUyLjMzNzcxOFojMDAwMDAwIz"
               + "AwMCMwMDAwMDABAf8="),
       new SyncRequestControl(
           SyncRequestControl.Mode.REFRESH_AND_PERSIST,
           new byte[] {
             (byte) 0x72, (byte) 0x69, (byte) 0x64, (byte) 0x3D, (byte) 0x30,
             (byte) 0x30, (byte) 0x30, (byte) 0x2C, (byte) 0x63, (byte) 0x73,
             (byte) 0x6E, (byte) 0x3D, (byte) 0x32, (byte) 0x30, (byte) 0x31,
             (byte) 0x32, (byte) 0x30, (byte) 0x37, (byte) 0x30, (byte) 0x36,
             (byte) 0x31, (byte) 0x38, (byte) 0x31, (byte) 0x35, (byte) 0x35,
             (byte) 0x32, (byte) 0x2E, (byte) 0x33, (byte) 0x33, (byte) 0x37,
             (byte) 0x37, (byte) 0x31, (byte) 0x38, (byte) 0x5A, (byte) 0x23,
             (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30,
             (byte) 0x30, (byte) 0x23, (byte) 0x30, (byte) 0x30, (byte) 0x30,
             (byte) 0x23, (byte) 0x30, (byte) 0x30, (byte) 0x30, (byte) 0x30,
             (byte) 0x30, (byte) 0x30,
           },
           true,
           true),
     },
   };
 }
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(HASH_CODE_SEED, mergeAttributes, retAttrs, searchAttribute);
 }
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(HASH_CODE_SEED, (Object[]) null);
 }
Esempio n. 9
0
 @Override
 public boolean equals(final Object o) {
   return LdapUtils.areEqual(this, o);
 }
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(
       HASH_CODE_SEED, getOID(), getCriticality(), sortResult, attributeName);
 }
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(HASH_CODE_SEED, getAttributeName());
 }
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality());
 }
Esempio n. 13
0
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(
       HASH_CODE_SEED, getOID(), getCriticality(), cookie, refreshDeletes);
 }
 /** {@inheritDoc} */
 @Override
 public int hashCode() {
   return LdapUtils.computeHashCode(HASH_CODE_SEED, conn);
 }