| | |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.protocols.internal; |
| | | |
| | |
| | | * |
| | | * @param bindpoint The socket address to which to bind. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void bind(SocketAddress bindpoint) |
| | | { |
| | | // No implementation is required. |
| | |
| | | /** |
| | | * Closes this socket. This will make it unavailable for use. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public synchronized void close() |
| | | { |
| | | try |
| | |
| | | * |
| | | * @param endpoint The address of the remote endpoint. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public synchronized void connect(SocketAddress endpoint) |
| | | { |
| | | closed = false; |
| | |
| | | * @param timeout The maximum length of time in milliseconds to |
| | | * wait for the connection to be established. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void connect(SocketAddress endpoint, int timeout) |
| | | { |
| | | closed = false; |
| | |
| | | * @return {@code null} because this implementation does not |
| | | * support use with NIO channels. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public SocketChannel getChannel() |
| | | { |
| | | // This implementation does not support use with NIO channels. |
| | |
| | | * |
| | | * @return The address to which this socket is connected. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public InetAddress getInetAddress() |
| | | { |
| | | try |
| | |
| | | * |
| | | * @return The input stream for this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public InternalLDAPInputStream getInputStream() |
| | | { |
| | | return inputStream; |
| | |
| | | * @return {@code true} if SO_KEEPALIVE is enabled, or |
| | | * {@code false} if not. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean getKeepAlive() |
| | | { |
| | | return keepAlive; |
| | |
| | | * |
| | | * @return The local address to which this socket is bound. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public InetAddress getLocalAddress() |
| | | { |
| | | try |
| | |
| | | * |
| | | * @return The local port to which this socket is bound. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public int getLocalPort() |
| | | { |
| | | return 389; |
| | |
| | | * |
| | | * @return The local socket address to which this socket is bound. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public SocketAddress getLocalSocketAddress() |
| | | { |
| | | try |
| | |
| | | * @return {@code true} if OOBINLINE is enabled, or {@code false} |
| | | * if it is not. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean getOOBInline() |
| | | { |
| | | return oobInline; |
| | |
| | | * |
| | | * @return The output stream for this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public InternalLDAPOutputStream getOutputStream() |
| | | { |
| | | return outputStream; |
| | |
| | | * |
| | | * @return The remote port to which this socket is connected. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public int getPort() |
| | | { |
| | | return 389; |
| | |
| | | * |
| | | * @return The value of the SO_RCVBUF option for this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public int getReceiveBufferSize() |
| | | { |
| | | return receiveBufferSize; |
| | |
| | | * @return The remote socket address to which this socket is |
| | | * connected. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public SocketAddress getRemoteSocketAddress() |
| | | { |
| | | try |
| | |
| | | * @return {@code true} if SO_REUSEADDR is enabled, or |
| | | * {@code false} if it is not. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean getReuseAddress() |
| | | { |
| | | return reuseAddress; |
| | |
| | | * |
| | | * @return The value of the SO_SNDBUF option for this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public int getSendBufferSize() |
| | | { |
| | | return sendBufferSize; |
| | |
| | | * |
| | | * @return The value of the SO_LINGER option for this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public int getSoLinger() |
| | | { |
| | | return lingerDuration; |
| | |
| | | * |
| | | * @return The value of the SO_TIMEOUT option for this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public int getSoTimeout() |
| | | { |
| | | return timeout; |
| | |
| | | * @return {@code true} if TCP_NODELAY is enabled, or {@code false} |
| | | * if it is not. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean getTcpNoDelay() |
| | | { |
| | | return tcpNoDelay; |
| | |
| | | * |
| | | * @return The traffic class for this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public int getTrafficClass() |
| | | { |
| | | return trafficClass; |
| | |
| | | * @return {@code true} to indicate that the socket is bound to a |
| | | * local address. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean isBound() |
| | | { |
| | | return true; |
| | |
| | | * |
| | | * @return {@code false} to indicate that the socket is not closed. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean isClosed() |
| | | { |
| | | return closed; |
| | |
| | | * |
| | | * @return {@code true} to indicate that the socket is connected. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean isConnected() |
| | | { |
| | | return (! closed); |
| | |
| | | * @return {@code false} to indicate that the input side of this |
| | | * socket is not closed. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean isInputShutdown() |
| | | { |
| | | return closed; |
| | |
| | | * @return {@code false} to indicate that the output side of this |
| | | * socket is not closed. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public boolean isOutputShutdown() |
| | | { |
| | | return closed; |
| | |
| | | * @throws IOException If a problem occurs while trying to write |
| | | * the provided data over this socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void sendUrgentData(int data) |
| | | throws IOException |
| | | { |
| | |
| | | * |
| | | * @param on The value to use for the SO_KEEPALIVE option. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setKeepAlive(boolean on) |
| | | { |
| | | keepAlive = on; |
| | |
| | | * |
| | | * @param on The value to use for the OOBINLINE option. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setOOBInline(boolean on) |
| | | { |
| | | oobInline = on; |
| | |
| | | * @param bandwidth An {@code int} expressing the relative |
| | | * importance of high bandwidth. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setPerformancePreferences(int connectionTime, |
| | | int latency, int bandwidth) |
| | | { |
| | |
| | | * |
| | | * @param size The value to use for the SO_RCVBUF option. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setReceiveBufferSize(int size) |
| | | { |
| | | receiveBufferSize = size; |
| | |
| | | * |
| | | * @param on The value to use for the SO_REUSEADDR option. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setReuseAddress(boolean on) |
| | | { |
| | | reuseAddress = on; |
| | |
| | | * |
| | | * @param size The value to use for the SO_SNDBUF option. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setSendBufferSize(int size) |
| | | { |
| | | sendBufferSize = size; |
| | |
| | | * @param linger The length of time in milliseconds to allow the |
| | | * connection to linger. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setSoLinger(boolean on, int linger) |
| | | { |
| | | lingerDuration = linger; |
| | |
| | | * |
| | | * @param timeout The value to use for the SO_TIMEOUT option. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setSoTimeout(int timeout) |
| | | { |
| | | this.timeout = timeout; |
| | |
| | | * |
| | | * @param on The value to use for the TCP_NODELAY option. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setTcpNoDelay(boolean on) |
| | | { |
| | | tcpNoDelay = on; |
| | |
| | | * |
| | | * @param tc The value to use for the traffic class. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void setTrafficClass(int tc) |
| | | { |
| | | trafficClass = tc; |
| | |
| | | * Shuts down the input side of this socket. This will have the |
| | | * effect of closing the entire socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void shutdownInput() |
| | | { |
| | | close(); |
| | |
| | | * Shuts down the output side of this socket. This will have the |
| | | * effect of closing the entire socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public void shutdownOutput() |
| | | { |
| | | close(); |
| | |
| | | * |
| | | * @return A string representation of this internal LDAP socket. |
| | | */ |
| | | @Override() |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return "InternalLDAPSocket"; |