Package javax.naming.ldap

Examples of javax.naming.ldap.ExtendedResponse


            /**
             * Call the stored procedure via the extended operation
             * and get back its return value.
             */
            ExtendedRequest jndiReq = LdapApiServiceFactory.getSingleton().toJndi( req );
            ExtendedResponse resp = ctx.extendedOperation( jndiReq );

            /**
             * Restore a Java object from the return value.
             */
            byte[] responseStream = resp.getEncodedValue();
            responseObject = SerializationUtils.deserialize( responseStream );
        }
        catch ( Exception e )
        {
            NamingException ne = new NamingException();
View Full Code Here


            /**
             * Call the stored procedure via the extended operation
             * and get back its return value.
             */
            ExtendedRequest jndiReq = LdapCodecServiceFactory.getSingleton().toJndi( req );
            ExtendedResponse resp = ctx.extendedOperation( jndiReq );

            /**
             * Restore a Java object from the return value.
             */
            byte[] responseStream = resp.getEncodedValue();
            responseObject = SerializationUtils.deserialize( responseStream );
        }
        catch ( Exception e )
        {
            NamingException ne = new NamingException();
View Full Code Here

            /**
             * Call the stored procedure via the extended operation
             * and get back its return value.
             */
            ExtendedResponse resp = ctx.extendedOperation( JndiUtils.toJndiExtendedRequest( req ) );

            /**
             * Restore a Java object from the return value.
             */
            byte[] responseStream = resp.getEncodedValue();
            responseObject = SerializationUtils.deserialize( responseStream );
        }
        catch ( Exception e )
        {
            NamingException ne = new NamingException();
View Full Code Here

            /**
             * Call the stored procedure via the extended operation
             * and get back its return value.
             */
            ExtendedRequest jndiReq = LdapApiServiceFactory.getSingleton().toJndi( req );
            ExtendedResponse resp = ctx.extendedOperation( jndiReq );

            /**
             * Restore a Java object from the return value.
             */
            byte[] responseStream = resp.getEncodedValue();
            responseObject = SerializationUtils.deserialize( responseStream );
        }
        catch ( Exception e )
        {
            NamingException ne = new NamingException();
View Full Code Here

    public ExtendedResponse extendedOperation(final ExtendedRequest request)
            throws NamingException {
        ensureOpen();
        logger.info("extendedOperation(" + request.getID() + ")");
        return new ExtendedResponse() {
            private static final long serialVersionUID = 1L;

            public String getID() {
                return request.getID();
            }
View Full Code Here

            /**
             * Call the stored procedure via the extended operation
             * and get back its return value.
             */
            ExtendedRequest jndiReq = LdapApiServiceFactory.getSingleton().toJndi( req );
            ExtendedResponse resp = ctx.extendedOperation( jndiReq );

            /**
             * Restore a Java object from the return value.
             */
            byte[] responseStream = resp.getEncodedValue();
            responseObject = SerializationUtils.deserialize( responseStream );
        }
        catch ( Exception e )
        {
            NamingException ne = new NamingException();
View Full Code Here

        assertEquals(0, result.getResultCode());
        assertEquals("", result.getMachedDN());
        assertEquals("", result.getErrorMessage());
        assertNull(result.getReferrals());

        ExtendedResponse response = op.getExtendedResponse();
        assertTrue(response instanceof MockExtendedResponse);
    }
View Full Code Here

        server
                .setResponseSeq(new LdapMessage[] { new LdapMessage(
                        LdapASN1Constant.OP_EXTENDED_RESPONSE,
                        encodableResponse, null) });

        ExtendedResponse response = context
                .extendedOperation(new MockExtendedRequest());
        assertTrue(response instanceof MockExtendedResponse);
        assertEquals("It's my id", response.getID());
        assertEquals(4, response.getEncodedValue().length);
        assertEquals(0, response.getEncodedValue()[0]);
        assertEquals(1, response.getEncodedValue()[1]);
        assertEquals(2, response.getEncodedValue()[2]);
        assertEquals(3, response.getEncodedValue()[3]);

        // test exception
        encodableResponse = new ASN1Encodable() {
            public void encodeValues(Object[] values) {
                new EncodableLdapResult().encodeValues(values);
View Full Code Here

                LdapContext referralContext = (LdapContext) getReferralContext(e);
                return referralContext.extendedOperation(request);
            }
            throw e;
        }
        ExtendedResponse response = op.getExtendedResponse();
        // set existing underlying socket to startTls extended response
        if (response instanceof StartTlsResponseImpl) {
            ((StartTlsResponseImpl) response).setSocket(client.getSocket());
        }
        return response;
View Full Code Here

            /**
             * Call the stored procedure via the extended operation
             * and get back its return value.
             */
            ExtendedRequest jndiReq = LdapApiServiceFactory.getSingleton().toJndi( req );
            ExtendedResponse resp = ctx.extendedOperation( jndiReq );

            /**
             * Restore a Java object from the return value.
             */
            byte[] responseStream = resp.getEncodedValue();
            responseObject = SerializationUtils.deserialize( responseStream );
        }
        catch ( Exception e )
        {
            NamingException ne = new NamingException();
View Full Code Here

TOP

Related Classes of javax.naming.ldap.ExtendedResponse

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.