类javax.naming.ldap.ExtendedRequest源码实例Demo

下面列出了怎么用javax.naming.ldap.ExtendedRequest的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: ldapchai   文件: AbstractProvider.java
protected void preCheckExtendedOperation( final ExtendedRequest request )
        throws ChaiOperationException
{
    final boolean cacheFailures = "true".equalsIgnoreCase( this.getChaiConfiguration().getSetting( ChaiSetting.EXTENDED_OPERATION_FAILURE_CACHE ) );
    if ( cacheFailures )
    {
        final Map<String, Object> providerProps = this.getProviderProperties();
        final Map<String, Exception> cacheFailureMap = ( Map<String, Exception> ) providerProps.get( EXTENDED_FAILURE_CACHE_KEY );
        final String requestID = request.getID();
        if ( cacheFailureMap.containsKey( requestID ) )
        {
            LOGGER.debug( "previous extended operation request for " + requestID + " has failed, reissuing cached exception without attempting operation" );
            throw ( ChaiOperationException ) cacheFailureMap.get( requestID );
        }
    }
}
 
源代码2 项目: ldapchai   文件: AbstractProvider.java
protected void cacheExtendedOperationException( final ExtendedRequest request, final Exception e )
        throws ChaiOperationException
{
    final boolean cacheFailures = this.getChaiConfiguration().getBooleanSetting( ChaiSetting.EXTENDED_OPERATION_FAILURE_CACHE );
    if ( cacheFailures )
    {
        final ChaiOperationException opExcep = ChaiOperationException.forErrorMessage( e.getMessage() );
        if ( opExcep.getErrorCode() == ChaiError.UNSUPPORTED_OPERATION )
        {
            final Map<String, Object> providerProps = this.getProviderProperties();
            final Map<String, Exception> cacheFailureMap = ( Map<String, Exception> ) providerProps.get( EXTENDED_FAILURE_CACHE_KEY );
            final String requestID = request.getID();
            cacheFailureMap.put( requestID, opExcep );
            LOGGER.trace( "caching extended operation for " + requestID );
            throw opExcep;
        }
    }
}
 
源代码3 项目: ldapchai   文件: AbstractProvider.java
public final ExtendedResponse extendedOperation( final ExtendedRequest request )
{
    if ( request == null )
    {
        throw new NullPointerException( "request must not be null" );
    }

    return null;
}
 
源代码4 项目: ldapchai   文件: JNDIProviderImpl.java
@LdapOperation
@ModifyOperation
public final ExtendedResponse extendedOperation( final ExtendedRequest request )
        throws ChaiUnavailableException, ChaiOperationException

{
    activityPreCheck();

    getInputValidator().extendedOperation( request );

    preCheckExtendedOperation( request );

    final LdapContext ldapConnection = getLdapConnection();
    try
    {
        return ldapConnection.extendedOperation( request );
    }
    catch ( NamingException e )
    {
        cacheExtendedOperationException( request, e );

        // guaranteedb to throw ChaiException
        convertNamingException( e );
    }

    return null;
}
 
源代码5 项目: james-project   文件: RetryingLdapContext.java
@Override
public ExtendedResponse extendedOperation(final ExtendedRequest request) throws NamingException {
    return (ExtendedResponse) new LoggingRetryHandler(DEFAULT_EXCEPTION_CLASSES, this, getSchedule(), getMaxRetries()) {
            @Override
            public Object operation() throws NamingException {
                return ((LdapContext) getDelegate()).extendedOperation(request);
            }
        }.perform();
}
 
源代码6 项目: micro-integrator   文件: LdapContextWrapper.java
@Override
public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException {

    return ldapContext.extendedOperation(request);
}
 
public ExtendedResponse extendedOperation(ExtendedRequest extendedRequest)
        throws NamingException {
    return getLdapContext().extendedOperation(extendedRequest);
}
 
源代码8 项目: quarkus   文件: DelegatingLdapContext.java
@Override
public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException {
    if (!(delegating instanceof LdapContext))
        throw Assert.unsupported();
    return ((LdapContext) delegating).extendedOperation(request);
}
 
源代码9 项目: directory-ldap-api   文件: JavaStoredProcUtils.java
/**
 * Invoke a Stored Procedure
 *
 * @param ctx The execution context
 * @param procedureName The procedure to execute
 * @param arguments The procedure's arguments
 * @return The execution resut
 * @throws NamingException If we have had an error whil executing the stored procedure
 */
public static Object callStoredProcedure( LdapContext ctx, String procedureName, Object[] arguments )
    throws NamingException
{
    String language = "Java";

    Object responseObject;
    try
    {
        /**
         * Create a new stored procedure execution request.
         */
        StoredProcedureRequestImpl req = new StoredProcedureRequestImpl( 0, procedureName, language );

        /**
         * For each argument UTF-8-encode the type name
         * and Java-serialize the value
         * and add them to the request as a parameter object.
         */
        for ( int i = 0; i < arguments.length; i++ )
        {
            byte[] type;
            byte[] value;
            type = arguments[i].getClass().getName().getBytes( StandardCharsets.UTF_8 );
            value = SerializationUtils.serialize( ( Serializable ) arguments[i] );
            req.addParameter( type, value );
        }

        /**
         * 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();
        ne.setRootCause( e );
        throw ne;
    }

    return responseObject;
}
 
源代码10 项目: ldapchai   文件: ApacheLdapProviderImpl.java
@Override
protected void preCheckExtendedOperation( final ExtendedRequest request )
        throws ChaiOperationException
{
    super.preCheckExtendedOperation( request );
}
 
源代码11 项目: ldapchai   文件: ApacheLdapProviderImpl.java
@Override
protected void cacheExtendedOperationException( final ExtendedRequest request, final Exception e )
        throws ChaiOperationException
{
    super.cacheExtendedOperationException( request, e );
}
 
源代码12 项目: ldapchai   文件: WatchdogWrapper.java
@Override
public ExtendedResponse extendedOperation( final ExtendedRequest request )
        throws ChaiOperationException, ChaiUnavailableException, IllegalStateException
{
    return providerHolder.execute( chaiProvider -> chaiProvider.extendedOperation( request ) );
}
 
源代码13 项目: entando-components   文件: InitialLdapContext.java
@Override
public ExtendedResponse extendedOperation(ExtendedRequest er) throws NamingException {
	ExtendedResponse extResponse = super.extendedOperation(er);
	this.setExtendedResponse(extResponse);
	return extResponse;
}
 
源代码14 项目: spring-ldap   文件: DelegatingLdapContext.java
/**
 * @see javax.naming.ldap.LdapContext#extendedOperation(javax.naming.ldap.ExtendedRequest)
 */
public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException {
    this.assertOpen();
    return this.getDelegateLdapContext().extendedOperation(request);
}
 
源代码15 项目: spring-ldap   文件: DelegatingLdapContext.java
/**
 * @see LdapContext#extendedOperation(ExtendedRequest)
 */
public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException {
    this.assertOpen();
    return this.getDelegateLdapContext().extendedOperation(request);
}
 
源代码16 项目: ldapchai   文件: ChaiProvider.java
/**
 * Performs an extended operation against the server.  The extended operation must be understood by the server.
 *
 * @param request An ExtendedRequest bean that can be
 * @return An ExtendedResponse created in response to the request.
 * @throws ChaiOperationException   If an error is encountered during the operation
 * @throws ChaiUnavailableException If no directory servers are reachable
 * @throws IllegalStateException    If the underlying connection is not in an available state
 * @see ExtendedRequest
 * @see ExtendedResponse
 */
@ChaiProvider.LdapOperation
@ChaiProvider.ModifyOperation
ExtendedResponse extendedOperation( ExtendedRequest request )
        throws ChaiOperationException, ChaiUnavailableException, IllegalStateException;
 
 类所在包
 类方法
 同包方法