Package org.apache.directory.server.core.api.sp

Examples of org.apache.directory.server.core.api.sp.StoredProcEngine


    public void handleExtendedOperation( LdapSession session, StoredProcedureRequest req ) throws Exception
    {
        String procedure = req.getProcedureSpecification();
        Entry spUnit = manager.findStoredProcUnit( session.getCoreSession(), procedure );
        StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );

        List<Object> valueList = new ArrayList<Object>( req.size() );

        for ( int ii = 0; ii < req.size(); ii++ )
        {
            byte[] serializedValue = ( byte[] ) req.getParameterValue( ii );
            Object value = SerializationUtils.deserialize( serializedValue );

            if ( value.getClass().equals( LdapContextParameter.class ) )
            {
                String paramCtx = ( ( LdapContextParameter ) value ).getValue();
                value = session.getCoreSession().lookup( new Dn( paramCtx ) );
            }

            valueList.add( value );
        }

        Object[] values = valueList.toArray( EMPTY_CLASS_ARRAY );
        Object response = engine.invokeProcedure( session.getCoreSession(), procedure, values );
        byte[] serializedResponse = SerializationUtils.serialize( ( Serializable ) response );
        StoredProcedureResponse resp =
            LdapApiServiceFactory.getSingleton().newExtendedResponse( req.getRequestName(), req.getMessageId(),
                serializedResponse );
        session.getIoSession().write( resp );
View Full Code Here


    public void handleExtendedOperation( LdapSession session, StoredProcedureRequest req ) throws Exception
    {
        String procedure = req.getProcedureSpecification();
        Entry spUnit = manager.findStoredProcUnit( session.getCoreSession(), procedure );
        StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );

        List<Object> valueList = new ArrayList<Object>( req.size() );

        for ( int ii = 0; ii < req.size(); ii++ )
        {
            byte[] serializedValue = ( byte[] ) req.getParameterValue( ii );
            Object value = SerializationUtils.deserialize( serializedValue );

            if ( value.getClass().equals( LdapContextParameter.class ) )
            {
                String paramCtx = ( ( LdapContextParameter ) value ).getValue();
                value = session.getCoreSession().lookup( new Dn( paramCtx ) );
            }

            valueList.add( value );
        }

        Object[] values = valueList.toArray( EMPTY_CLASS_ARRAY );
        Object response = engine.invokeProcedure( session.getCoreSession(), procedure, values );
        byte[] serializedResponse = SerializationUtils.serialize( ( Serializable ) response );
        StoredProcedureResponse resp =
            LdapApiServiceFactory.getSingleton().newExtendedResponse( req.getRequestName(), req.getMessageId(),
                serializedResponse );
        session.getIoSession().write( resp );
View Full Code Here

    public void handleExtendedOperation( LdapSession session, StoredProcedureRequest req ) throws Exception
    {
        String procedure = req.getProcedureSpecification();
        Entry spUnit = manager.findStoredProcUnit( session.getCoreSession(), procedure );
        StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );

        List<Object> valueList = new ArrayList<Object>( req.size() );

        for ( int ii = 0; ii < req.size(); ii++ )
        {
            byte[] serializedValue = ( byte[] ) req.getParameterValue( ii );
            Object value = SerializationUtils.deserialize( serializedValue );

            if ( value.getClass().equals( LdapContextParameter.class ) )
            {
                String paramCtx = ( ( LdapContextParameter ) value ).getValue();
                value = session.getCoreSession().lookup( new Dn( paramCtx ) );
            }

            valueList.add( value );
        }

        Object[] values = valueList.toArray( EMPTY_CLASS_ARRAY );
        Object response = engine.invokeProcedure( session.getCoreSession(), procedure, values );
        byte[] serializedResponse = SerializationUtils.serialize( ( Serializable ) response );
        StoredProcedureResponse resp =
            LdapApiServiceFactory.getSingleton().newExtendedResponse( req, serializedResponse );
        session.getIoSession().write( resp );
    }
View Full Code Here

        throws LdapException
    {
        try
        {
            Entry spUnit = manager.findStoredProcUnit( opContext.getSession(), procedure );
            StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );

            return engine.invokeProcedure( opContext.getSession(), procedure, values );
        }
        catch ( Exception e )
        {
            LdapOtherException lne = new LdapOtherException( e.getMessage(), e );
            lne.initCause( e );
View Full Code Here

        throws LdapException
    {
        try
        {
            Entry spUnit = manager.findStoredProcUnit( opContext.getSession(), procedure );
            StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );

            return engine.invokeProcedure( opContext.getSession(), procedure, values );
        }
        catch ( Exception e )
        {
            LdapOtherException lne = new LdapOtherException( e.getMessage(), e );
            lne.initCause( e );
View Full Code Here

    public void handleExtendedOperation( LdapSession session, StoredProcedureRequest req ) throws Exception
    {
        String procedure = req.getProcedureSpecification();
        Entry spUnit = manager.findStoredProcUnit( session.getCoreSession(), procedure );
        StoredProcEngine engine = manager.getStoredProcEngineInstance( spUnit );

        List<Object> valueList = new ArrayList<Object>( req.size() );

        for ( int ii = 0; ii < req.size(); ii++ )
        {
            byte[] serializedValue = ( byte[] ) req.getParameterValue( ii );
            Object value = SerializationUtils.deserialize( serializedValue );

            if ( value.getClass().equals( LdapContextParameter.class ) )
            {
                String paramCtx = ( ( LdapContextParameter ) value ).getValue();
                value = session.getCoreSession().lookup( new Dn( paramCtx ) );
            }

            valueList.add( value );
        }

        Object[] values = valueList.toArray( EMPTY_CLASS_ARRAY );
        Object response = engine.invokeProcedure( session.getCoreSession(), procedure, values );
        byte[] serializedResponse = SerializationUtils.serialize( ( Serializable ) response );
        StoredProcedureResponse resp =
            LdapApiServiceFactory.getSingleton().newExtendedResponse( req, serializedResponse );
        session.getIoSession().write( resp );
    }
View Full Code Here

TOP

Related Classes of org.apache.directory.server.core.api.sp.StoredProcEngine

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.