当前位置: 首页>>代码示例>>Java>>正文


Java InvalidConnectionException类代码示例

本文整理汇总了Java中org.apache.directory.ldap.client.api.exception.InvalidConnectionException的典型用法代码示例。如果您正苦于以下问题:Java InvalidConnectionException类的具体用法?Java InvalidConnectionException怎么用?Java InvalidConnectionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


InvalidConnectionException类属于org.apache.directory.ldap.client.api.exception包,在下文中一共展示了InvalidConnectionException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: schema

import org.apache.directory.ldap.client.api.exception.InvalidConnectionException; //导入依赖的package包/类
@Override
public Schema schema() {
   	if (!connectionManager.isConnected()) {
   		return null;
   	}
   	// always fetch fresh schema when this method is called
   	schemaManager = null;
   	schemaTranslator = null;
   	try {
   		return getSchemaTranslator().translateSchema(connectionManager);
   	} catch (InvalidConnectionException e) {
   		// The connection might have been disconnected. Try to reconnect.
   		connectionManager.connect();
		try {
			return getSchemaTranslator().translateSchema(connectionManager);
		} catch (InvalidConnectionException e1) {
			throw new ConnectorException("Reconnect error: "+e.getMessage(), e);
		}
   	}
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:21,代码来源:AbstractLdapConnector.java

示例2: checkSession

import org.apache.directory.ldap.client.api.exception.InvalidConnectionException; //导入依赖的package包/类
/**
 * Check that a session is valid, ie we can send requests to the
 * server
 *
 * @throws Exception If the session is not valid
 */
private void checkSession() throws InvalidConnectionException
{
    if ( ldapSession == null )
    {
        throw new InvalidConnectionException( "Cannot connect on the server, the connection is null" );
    }

    if ( !connected.get() )
    {
        throw new InvalidConnectionException( "Cannot connect on the server, the connection is invalid" );
    }
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:19,代码来源:LdapNetworkConnection.java

示例3: prepareIcfSchema

import org.apache.directory.ldap.client.api.exception.InvalidConnectionException; //导入依赖的package包/类
private void prepareIcfSchema() {
 	try {
 		getSchemaTranslator().prepareIcfSchema(connectionManager);
 	} catch (InvalidConnectionException e) {
 		// The connection might have been disconnected. Try to reconnect.
 		connectionManager.connect();
try {
	getSchemaTranslator().prepareIcfSchema(connectionManager);
} catch (InvalidConnectionException e1) {
	throw new ConnectorException("Reconnect error: "+e.getMessage(), e);
}
 	}
 }
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:14,代码来源:AbstractLdapConnector.java

示例4: writeRequest

import org.apache.directory.ldap.client.api.exception.InvalidConnectionException; //导入依赖的package包/类
/**
 * a reusable code block to be used in various bind methods
 */
private void writeRequest( Request request ) throws LdapException
{
    // Send the request to the server
    WriteFuture writeFuture = ldapSession.write( request );

    long localTimeout = timeout;

    while ( localTimeout > 0 )
    {
        // Wait only 100 ms
        boolean done = writeFuture.awaitUninterruptibly( 100 );

        if ( done )
        {
            return;
        }

        // Wait for the message to be sent to the server
        if ( !ldapSession.isConnected() )
        {
            // We didn't received anything : this is an error
            LOG.error( "Message failed : something wrong has occurred" );

            Exception exception = ( Exception ) ldapSession.removeAttribute( EXCEPTION_KEY );

            if ( exception != null )
            {
                if ( exception instanceof LdapException )
                {
                    throw ( LdapException ) exception;
                }
                else
                {
                    throw new InvalidConnectionException( exception.getMessage(), exception );
                }
            }

            throw new InvalidConnectionException( "Error while sending some message : the session has been closed" );
        }

        localTimeout -= 100;
    }

    LOG.error( "TimeOut has occurred" );
    throw new LdapException( TIME_OUT_ERROR );
}
 
开发者ID:apache,项目名称:directory-ldap-api,代码行数:50,代码来源:LdapNetworkConnection.java

示例5: prepareIcfSchema

import org.apache.directory.ldap.client.api.exception.InvalidConnectionException; //导入依赖的package包/类
/**
 * Make sure that we have icfSchema  
 */
public void prepareIcfSchema(ConnectionManager<C> connectionManager) throws InvalidConnectionException {
	if (icfSchema == null) {
		translateSchema(connectionManager);
	}
}
 
开发者ID:Evolveum,项目名称:connector-ldap,代码行数:9,代码来源:AbstractSchemaTranslator.java


注:本文中的org.apache.directory.ldap.client.api.exception.InvalidConnectionException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。