Java Code Examples for org.apache.directory.server.protocol.shared.transport.Transport#getPort()

The following examples show how to use org.apache.directory.server.protocol.shared.transport.Transport#getPort() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LdapServer.java    From MyVirtualDirectory with Apache License 2.0 6 votes vote down vote up
/**
 * @return The underlying TCP transport port, or -1 if no transport has been 
 * initialized
 */
public int getPort()
{
    if ( transports == null )
    {
        return -1;
    }

    for ( Transport transport : transports )
    {
        if ( transport instanceof UdpTransport )
        {
            continue;
        }

        if ( !transport.isSSLEnabled() )
        {
            return transport.getPort();
        }
    }

    return -1;
}
 
Example 2
Source File: LdapServer.java    From MyVirtualDirectory with Apache License 2.0 6 votes vote down vote up
/**
 * @return The underlying SSL enabled TCP transport port, or -1 if no transport has been 
 * initialized
 */
public int getPortSSL()
{
    if ( transports == null )
    {
        return -1;
    }

    for ( Transport transport : transports )
    {
        if ( transport instanceof UdpTransport )
        {
            continue;
        }

        if ( transport.isSSLEnabled() )
        {
            return transport.getPort();
        }
    }

    return -1;
}
 
Example 3
Source File: LdapServer.java    From MyVirtualDirectory with Apache License 2.0 6 votes vote down vote up
/**
 * @return The underlying TCP transport port, or -1 if no transport has been 
 * initialized
 */
public int getPort()
{
    if ( transports == null )
    {
        return -1;
    }

    for ( Transport transport : transports )
    {
        if ( transport instanceof UdpTransport )
        {
            continue;
        }

        if ( !transport.isSSLEnabled() )
        {
            return transport.getPort();
        }
    }

    return -1;
}
 
Example 4
Source File: LdapServer.java    From MyVirtualDirectory with Apache License 2.0 6 votes vote down vote up
/**
 * @return The underlying SSL enabled TCP transport port, or -1 if no transport has been 
 * initialized
 */
public int getPortSSL()
{
    if ( transports == null )
    {
        return -1;
    }

    for ( Transport transport : transports )
    {
        if ( transport instanceof UdpTransport )
        {
            continue;
        }

        if ( transport.isSSLEnabled() )
        {
            return transport.getPort();
        }
    }

    return -1;
}