Package com.day.ldap

Examples of com.day.ldap.LDAPControl


     * @deprecated LDAPSortControl response controls are now automatically
     * instantiated.
     */
    public static String parseResponse( LDAPControl[] controls, int[] results ) {
        String attr = null;
        LDAPControl sort = null;
        /* See if there is a sort control in the array */
        for( int i = 0; (controls != null) && (i < controls.length); i++ ) {
            if ( controls[i].getID().equals( SORTRESPONSE ) ) {
                sort = controls[i];
                break;
            }
        }
        if ( sort != null ) {
            /* Suck out the data and return it */
            ByteArrayInputStream inStream =
                new ByteArrayInputStream( sort.getValue() );
            BERSequence ber = new BERSequence();
            JDAPBERTagDecoder decoder = new JDAPBERTagDecoder();
            int[] nRead = new int[1];
            nRead[0] = 0;
            try  {
View Full Code Here


     * not return a string.
     * @see com.day.ldap.LDAPConnection#getResponseControls
     */
    public static String parseResponse( LDAPControl[] controls, String type ) {
        String msg = null;
        LDAPControl cont = null;
        /* See if there is a password control in the array */
        for( int i = 0; (controls != null) && (i < controls.length); i++ ) {
            if ( controls[i].getID().equals( type ) ) {
                cont = controls[i];
                break;
            }
        }
        if ( cont != null ) {
            /* Suck out the data and return it */
            try {
                msg = new String( cont.getValue(), "UTF8" );
            } catch ( Exception e ) {
            }
        }
        return msg;
    }
View Full Code Here

TOP

Related Classes of com.day.ldap.LDAPControl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.