@Override public int hashCode() { return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), sortResult, attributeName); }
@Override public String toString() { return String.format( "[%s@%d::criticality=%s, sortResult=%s, attributeName=%s]", getClass().getName(), hashCode(), getCriticality(), sortResult, attributeName); }
/** * Creates a new sort response control. * * @param code result of the sort * @param attrName name of the failed attribute * @param critical whether this control is critical */ public SortResponseControl(final ResultCode code, final String attrName, final boolean critical) { super(OID, critical); setSortResult(code); setAttributeName(attrName); }
/** * @param berValue to encode. * @param expected sort response control to test. * * @throws Exception On test failure. */ @Test(groups = {"control"}, dataProvider = "response") public void decode(final byte[] berValue, final SortResponseControl expected) throws Exception { final SortResponseControl actual = new SortResponseControl(expected.getCriticality()); actual.decode(berValue); Assert.assertEquals(actual, expected); } }
/** * Sort response control test data. * * @return response test data */ @DataProvider(name = "response") public Object[][] createData() { return new Object[][] { // result code success // BER: 30:03:0A:01:00 new Object[] { LdapUtils.base64Decode("MAMKAQA="), new SortResponseControl(ResultCode.SUCCESS, true), }, }; }
/** * Creates a new sort response control. * * @param code result of the sort * @param critical whether this control is critical */ public SortResponseControl(final ResultCode code, final boolean critical) { super(OID, critical); setSortResult(code); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { getObject().setAttributeName(OctetStringType.decode(encoded)); } }
if (SortResponseControl.OID.equals(responseControl.getOid())) { final SortResponse c = (SortResponse) responseControl; ctl = new SortResponseControl( ResultCode.valueOf(c.getSortResult().getVal()), c.getAttributeName(), c.isCritical()); } else if (PagedResultsControl.OID.equals(responseControl.getOid())) {
/** * Creates a new sort response control. * * @param code result of the sort * @param critical whether this control is critical */ public SortResponseControl(final ResultCode code, final boolean critical) { super(OID, critical); setSortResult(code); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { getObject().setAttributeName(OctetStringType.decode(encoded)); } }
ctl = new SortResponseControl(critical); ctl.decode(encoded); break;
@Override public int hashCode() { return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), sortResult, attributeName); }
@Override public String toString() { return String.format( "[%s@%d::criticality=%s, sortResult=%s, attributeName=%s]", getClass().getName(), hashCode(), getCriticality(), sortResult, attributeName); }
/** * Creates a new sort response control. * * @param code result of the sort * @param attrName name of the failed attribute * @param critical whether this control is critical */ public SortResponseControl(final ResultCode code, final String attrName, final boolean critical) { super(OID, critical); setSortResult(code); setAttributeName(attrName); }
/** * Creates a new sort response control. * * @param code result of the sort * @param critical whether this control is critical */ public SortResponseControl(final ResultCode code, final boolean critical) { super(OID, critical); setSortResult(code); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { getObject().setAttributeName(OctetStringType.decode(encoded)); } }
ctl = new SortResponseControl(critical); ctl.decode(encoded); break;
@Override public int hashCode() { return LdapUtils.computeHashCode(HASH_CODE_SEED, getOID(), getCriticality(), sortResult, attributeName); }
@Override public String toString() { return String.format( "[%s@%d::criticality=%s, sortResult=%s, attributeName=%s]", getClass().getName(), hashCode(), getCriticality(), sortResult, attributeName); }
/** * Creates a new sort response control. * * @param code result of the sort * @param attrName name of the failed attribute * @param critical whether this control is critical */ public SortResponseControl(final ResultCode code, final String attrName, final boolean critical) { super(OID, critical); setSortResult(code); setAttributeName(attrName); }