/** * Retrieves the search scope for the LDAP URL. * * @return The search scope for the LDAP URL. */ public int getScope() { return ldapURL.getScope().intValue(); }
Arrays.asList(String.valueOf(scope.intValue()))));
/** * {@inheritDoc} */ @Override() protected List<Attribute> getAdditionalAttributes() { final LinkedList<Attribute> attrs = new LinkedList<Attribute>(); attrs.add(new Attribute(ATTR_BASE_DN, baseDN)); attrs.add(new Attribute(ATTR_SCOPE, String.valueOf(scope.intValue()))); attrs.add(new Attribute(ATTR_FILTER, filter.toString())); attrs.add(new Attribute(ATTR_OUTPUT_FILE, outputFile)); if ((attributes != null) && (! attributes.isEmpty())) { attrs.add(new Attribute(ATTR_RETURN_ATTR, attributes)); } if (authzDN != null) { attrs.add(new Attribute(ATTR_AUTHZ_DN, authzDN)); } return Collections.unmodifiableList(attrs); }
/** * Creates an argument for a search scope value. * * @param s The search scope value for the argument. It may be * {@code null}. * @param comment A comment that may help clarify the argument. It may * be {@code null} if there should be no comment. * * @return The argument that was created. */ public static ToCodeArgHelper createScope(final SearchScope s, final String comment) { if (s == null) { return new ToCodeArgHelper("(SearchScope) null", comment); } final SearchScope definedScope = SearchScope.definedValueOf(s.intValue()); if (definedScope == null) { return new ToCodeArgHelper("SearchScope.valueOf(" + s.intValue() + ')', comment); } else { return new ToCodeArgHelper("SearchScope." + definedScope.getName(), comment); } }
/** * Creates an argument for a search scope value. * * @param s The search scope value for the argument. It may be * {@code null}. * @param comment A comment that may help clarify the argument. It may * be {@code null} if there should be no comment. * * @return The argument that was created. */ public static ToCodeArgHelper createScope(final SearchScope s, final String comment) { if (s == null) { return new ToCodeArgHelper("(SearchScope) null", comment); } final SearchScope definedScope = SearchScope.definedValueOf(s.intValue()); if (definedScope == null) { return new ToCodeArgHelper("SearchScope.valueOf(" + s.intValue() + ')', comment); } else { return new ToCodeArgHelper("SearchScope." + definedScope.getName(), comment); } }
elements.add(new ASN1Enumerated(TYPE_SCOPE, scope.intValue()));
switch (scope.intValue())
switch (scope.intValue())
/** * {@inheritDoc} */ public ASN1Element encodeProtocolOp() { final ArrayList<ASN1Element> attrElements = new ArrayList<ASN1Element>(attributes.size()); for (final String attribute : attributes) { attrElements.add(new ASN1OctetString(attribute)); } return new ASN1Sequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST, new ASN1OctetString(baseDN), new ASN1Enumerated(scope.intValue()), new ASN1Enumerated(derefPolicy.intValue()), new ASN1Integer(sizeLimit), new ASN1Integer(timeLimit), new ASN1Boolean(typesOnly), filter.encode(), new ASN1Sequence(attrElements)); }
/** * {@inheritDoc} */ public ASN1Element encodeProtocolOp() { final ArrayList<ASN1Element> attrElements = new ArrayList<ASN1Element>(attributes.size()); for (final String attribute : attributes) { attrElements.add(new ASN1OctetString(attribute)); } return new ASN1Sequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST, new ASN1OctetString(baseDN), new ASN1Enumerated(scope.intValue()), new ASN1Enumerated(derefPolicy.intValue()), new ASN1Integer(sizeLimit), new ASN1Integer(timeLimit), new ASN1Boolean(typesOnly), filter.encode(), new ASN1Sequence(attrElements)); }
/** * Encodes the search request protocol op to an ASN.1 element. * * @return The ASN.1 element with the encoded search request protocol op. */ public ASN1Element encodeProtocolOp() { // Create the search request protocol op. final ASN1Element[] attrElements = new ASN1Element[attributes.length]; for (int i=0; i < attrElements.length; i++) { attrElements[i] = new ASN1OctetString(attributes[i]); } final ASN1Element[] protocolOpElements = { new ASN1OctetString(baseDN), new ASN1Enumerated(scope.intValue()), new ASN1Enumerated(derefPolicy.intValue()), new ASN1Integer(sizeLimit), new ASN1Integer(timeLimit), new ASN1Boolean(typesOnly), filter.encode(), new ASN1Sequence(attrElements) }; return new ASN1Sequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST, protocolOpElements); }
/** * Encodes the search request protocol op to an ASN.1 element. * * @return The ASN.1 element with the encoded search request protocol op. */ public ASN1Element encodeProtocolOp() { // Create the search request protocol op. final ASN1Element[] attrElements = new ASN1Element[attributes.length]; for (int i=0; i < attrElements.length; i++) { attrElements[i] = new ASN1OctetString(attributes[i]); } final ASN1Element[] protocolOpElements = { new ASN1OctetString(baseDN), new ASN1Enumerated(scope.intValue()), new ASN1Enumerated(derefPolicy.intValue()), new ASN1Integer(sizeLimit), new ASN1Integer(timeLimit), new ASN1Boolean(typesOnly), filter.encode(), new ASN1Sequence(attrElements) }; return new ASN1Sequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST, protocolOpElements); }
/** * {@inheritDoc} */ public void writeTo(final ASN1Buffer writer) { final ASN1BufferSequence requestSequence = writer.beginSequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST); writer.addOctetString(baseDN); writer.addEnumerated(scope.intValue()); writer.addEnumerated(derefPolicy.intValue()); writer.addInteger(sizeLimit); writer.addInteger(timeLimit); writer.addBoolean(typesOnly); filter.writeTo(writer); final ASN1BufferSequence attrSequence = writer.beginSequence(); for (final String s : attributes) { writer.addOctetString(s); } attrSequence.end(); requestSequence.end(); }
/** * {@inheritDoc} */ public void writeTo(final ASN1Buffer writer) { final ASN1BufferSequence requestSequence = writer.beginSequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST); writer.addOctetString(baseDN); writer.addEnumerated(scope.intValue()); writer.addEnumerated(derefPolicy.intValue()); writer.addInteger(sizeLimit); writer.addInteger(timeLimit); writer.addBoolean(typesOnly); filter.writeTo(writer); final ASN1BufferSequence attrSequence = writer.beginSequence(); for (final String s : attributes) { writer.addOctetString(s); } attrSequence.end(); requestSequence.end(); }
/** * {@inheritDoc} */ public void writeTo(final ASN1Buffer buffer) { final ASN1BufferSequence opSequence = buffer.beginSequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST); buffer.addOctetString(baseDN); buffer.addEnumerated(scope.intValue()); buffer.addEnumerated(derefPolicy.intValue()); buffer.addInteger(sizeLimit); buffer.addInteger(timeLimit); buffer.addBoolean(typesOnly); filter.writeTo(buffer); final ASN1BufferSequence attrSequence = buffer.beginSequence(); for (final String s : attributes) { buffer.addOctetString(s); } attrSequence.end(); opSequence.end(); }
/** * {@inheritDoc} */ public void writeTo(final ASN1Buffer buffer) { final ASN1BufferSequence opSequence = buffer.beginSequence(LDAPMessage.PROTOCOL_OP_TYPE_SEARCH_REQUEST); buffer.addOctetString(baseDN); buffer.addEnumerated(scope.intValue()); buffer.addEnumerated(derefPolicy.intValue()); buffer.addInteger(sizeLimit); buffer.addInteger(timeLimit); buffer.addBoolean(typesOnly); filter.writeTo(buffer); final ASN1BufferSequence attrSequence = buffer.beginSequence(); for (final String s : attributes) { buffer.addOctetString(s); } attrSequence.end(); opSequence.end(); }