GUACAMOLE-1: Refactor org.glyptodon package/groupId to org.apache.

This commit is contained in:
Michael Jumper
2016-03-22 14:05:53 -07:00
parent 2358d88683
commit 6990344697
402 changed files with 1536 additions and 1536 deletions

View File

@@ -0,0 +1,133 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apache.guacamole.net;
import java.util.concurrent.locks.ReentrantLock;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.io.GuacamoleReader;
import org.apache.guacamole.io.GuacamoleWriter;
/**
* Base GuacamoleTunnel implementation which synchronizes access to the
* underlying reader and writer with reentrant locks. Implementations need only
* provide the tunnel's UUID and socket.
*
* @author Michael Jumper
*/
public abstract class AbstractGuacamoleTunnel implements GuacamoleTunnel {
/**
* Lock acquired when a read operation is in progress.
*/
private final ReentrantLock readerLock;
/**
* Lock acquired when a write operation is in progress.
*/
private final ReentrantLock writerLock;
/**
* Creates a new GuacamoleTunnel which synchronizes access to the
* Guacamole instruction stream associated with the underlying
* GuacamoleSocket.
*/
public AbstractGuacamoleTunnel() {
readerLock = new ReentrantLock();
writerLock = new ReentrantLock();
}
/**
* Acquires exclusive read access to the Guacamole instruction stream
* and returns a GuacamoleReader for reading from that stream.
*
* @return A GuacamoleReader for reading from the Guacamole instruction
* stream.
*/
@Override
public GuacamoleReader acquireReader() {
readerLock.lock();
return getSocket().getReader();
}
/**
* Relinquishes exclusive read access to the Guacamole instruction
* stream. This function should be called whenever a thread finishes using
* a GuacamoleTunnel's GuacamoleReader.
*/
@Override
public void releaseReader() {
readerLock.unlock();
}
/**
* Returns whether there are threads waiting for read access to the
* Guacamole instruction stream.
*
* @return true if threads are waiting for read access the Guacamole
* instruction stream, false otherwise.
*/
@Override
public boolean hasQueuedReaderThreads() {
return readerLock.hasQueuedThreads();
}
/**
* Acquires exclusive write access to the Guacamole instruction stream
* and returns a GuacamoleWriter for writing to that stream.
*
* @return A GuacamoleWriter for writing to the Guacamole instruction
* stream.
*/
@Override
public GuacamoleWriter acquireWriter() {
writerLock.lock();
return getSocket().getWriter();
}
/**
* Relinquishes exclusive write access to the Guacamole instruction
* stream. This function should be called whenever a thread finishes using
* a GuacamoleTunnel's GuacamoleWriter.
*/
@Override
public void releaseWriter() {
writerLock.unlock();
}
@Override
public boolean hasQueuedWriterThreads() {
return writerLock.hasQueuedThreads();
}
@Override
public void close() throws GuacamoleException {
getSocket().close();
}
@Override
public boolean isOpen() {
return getSocket().isOpen();
}
}

View File

@@ -0,0 +1,104 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apache.guacamole.net;
import java.util.UUID;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.io.GuacamoleReader;
import org.apache.guacamole.io.GuacamoleWriter;
/**
* GuacamoleTunnel implementation which simply delegates all function calls to
* an underlying GuacamoleTunnel.
*
* @author Michael Jumper
*/
public class DelegatingGuacamoleTunnel implements GuacamoleTunnel {
/**
* The wrapped GuacamoleTunnel.
*/
private final GuacamoleTunnel tunnel;
/**
* Wraps the given tunnel such that all function calls against this tunnel
* will be delegated to it.
*
* @param tunnel
* The GuacamoleTunnel to wrap.
*/
public DelegatingGuacamoleTunnel(GuacamoleTunnel tunnel) {
this.tunnel = tunnel;
}
@Override
public GuacamoleReader acquireReader() {
return tunnel.acquireReader();
}
@Override
public void releaseReader() {
tunnel.releaseReader();
}
@Override
public boolean hasQueuedReaderThreads() {
return tunnel.hasQueuedReaderThreads();
}
@Override
public GuacamoleWriter acquireWriter() {
return tunnel.acquireWriter();
}
@Override
public void releaseWriter() {
tunnel.releaseWriter();
}
@Override
public boolean hasQueuedWriterThreads() {
return tunnel.hasQueuedWriterThreads();
}
@Override
public UUID getUUID() {
return tunnel.getUUID();
}
@Override
public GuacamoleSocket getSocket() {
return tunnel.getSocket();
}
@Override
public void close() throws GuacamoleException {
tunnel.close();
}
@Override
public boolean isOpen() {
return tunnel.isOpen();
}
}

View File

@@ -0,0 +1,73 @@
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apache.guacamole.net;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.io.GuacamoleReader;
import org.apache.guacamole.io.GuacamoleWriter;
/**
* Provides abstract socket-like access to a Guacamole connection.
*
* @author Michael Jumper
*/
public interface GuacamoleSocket {
/**
* Returns a GuacamoleReader which can be used to read from the
* Guacamole instruction stream associated with the connection
* represented by this GuacamoleSocket.
*
* @return A GuacamoleReader which can be used to read from the
* Guacamole instruction stream.
*/
public GuacamoleReader getReader();
/**
* Returns a GuacamoleWriter which can be used to write to the
* Guacamole instruction stream associated with the connection
* represented by this GuacamoleSocket.
*
* @return A GuacamoleWriter which can be used to write to the
* Guacamole instruction stream.
*/
public GuacamoleWriter getWriter();
/**
* Releases all resources in use by the connection represented by this
* GuacamoleSocket.
*
* @throws GuacamoleException If an error occurs while releasing resources.
*/
public void close() throws GuacamoleException;
/**
* Returns whether this GuacamoleSocket is open and can be used for reading
* and writing.
*
* @return true if this GuacamoleSocket is open, false otherwise.
*/
public boolean isOpen();
}

View File

@@ -0,0 +1,119 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apache.guacamole.net;
import java.util.UUID;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.io.GuacamoleReader;
import org.apache.guacamole.io.GuacamoleWriter;
/**
* Provides a unique identifier and synchronized access to the GuacamoleReader
* and GuacamoleWriter associated with a GuacamoleSocket.
*
* @author Michael Jumper
*/
public interface GuacamoleTunnel {
/**
* Acquires exclusive read access to the Guacamole instruction stream
* and returns a GuacamoleReader for reading from that stream.
*
* @return A GuacamoleReader for reading from the Guacamole instruction
* stream.
*/
GuacamoleReader acquireReader();
/**
* Relinquishes exclusive read access to the Guacamole instruction
* stream. This function should be called whenever a thread finishes using
* a GuacamoleTunnel's GuacamoleReader.
*/
void releaseReader();
/**
* Returns whether there are threads waiting for read access to the
* Guacamole instruction stream.
*
* @return true if threads are waiting for read access the Guacamole
* instruction stream, false otherwise.
*/
boolean hasQueuedReaderThreads();
/**
* Acquires exclusive write access to the Guacamole instruction stream
* and returns a GuacamoleWriter for writing to that stream.
*
* @return A GuacamoleWriter for writing to the Guacamole instruction
* stream.
*/
GuacamoleWriter acquireWriter();
/**
* Relinquishes exclusive write access to the Guacamole instruction
* stream. This function should be called whenever a thread finishes using
* a GuacamoleTunnel's GuacamoleWriter.
*/
void releaseWriter();
/**
* Returns whether there are threads waiting for write access to the
* Guacamole instruction stream.
*
* @return true if threads are waiting for write access the Guacamole
* instruction stream, false otherwise.
*/
boolean hasQueuedWriterThreads();
/**
* Returns the unique identifier associated with this GuacamoleTunnel.
*
* @return The unique identifier associated with this GuacamoleTunnel.
*/
UUID getUUID();
/**
* Returns the GuacamoleSocket used by this GuacamoleTunnel for reading
* and writing.
*
* @return The GuacamoleSocket used by this GuacamoleTunnel.
*/
GuacamoleSocket getSocket();
/**
* Release all resources allocated to this GuacamoleTunnel.
*
* @throws GuacamoleException if an error occurs while releasing
* resources.
*/
void close() throws GuacamoleException;
/**
* Returns whether this GuacamoleTunnel is open, or has been closed.
*
* @return true if this GuacamoleTunnel is open, false if it is closed.
*/
boolean isOpen();
}

View File

@@ -0,0 +1,150 @@
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apache.guacamole.net;
import org.apache.guacamole.io.GuacamoleReader;
import org.apache.guacamole.io.ReaderGuacamoleReader;
import org.apache.guacamole.io.WriterGuacamoleWriter;
import org.apache.guacamole.io.GuacamoleWriter;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.net.SocketTimeoutException;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
import org.apache.guacamole.GuacamoleUpstreamTimeoutException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provides abstract socket-like access to a Guacamole connection over a given
* hostname and port.
*
* @author Michael Jumper
*/
public class InetGuacamoleSocket implements GuacamoleSocket {
/**
* Logger for this class.
*/
private Logger logger = LoggerFactory.getLogger(InetGuacamoleSocket.class);
/**
* The GuacamoleReader this socket should read from.
*/
private GuacamoleReader reader;
/**
* The GuacamoleWriter this socket should write to.
*/
private GuacamoleWriter writer;
/**
* The number of milliseconds to wait for data on the TCP socket before
* timing out.
*/
private static final int SOCKET_TIMEOUT = 15000;
/**
* The TCP socket that the GuacamoleReader and GuacamoleWriter exposed
* by this class should affect.
*/
private Socket sock;
/**
* Creates a new InetGuacamoleSocket which reads and writes instructions
* to the Guacamole instruction stream of the Guacamole proxy server
* running at the given hostname and port.
*
* @param hostname The hostname of the Guacamole proxy server to connect to.
* @param port The port of the Guacamole proxy server to connect to.
* @throws GuacamoleException If an error occurs while connecting to the
* Guacamole proxy server.
*/
public InetGuacamoleSocket(String hostname, int port) throws GuacamoleException {
try {
logger.debug("Connecting to guacd at {}:{}.", hostname, port);
// Get address
SocketAddress address = new InetSocketAddress(
InetAddress.getByName(hostname),
port
);
// Connect with timeout
sock = new Socket();
sock.connect(address, SOCKET_TIMEOUT);
// Set read timeout
sock.setSoTimeout(SOCKET_TIMEOUT);
// On successful connect, retrieve I/O streams
reader = new ReaderGuacamoleReader(new InputStreamReader(sock.getInputStream(), "UTF-8"));
writer = new WriterGuacamoleWriter(new OutputStreamWriter(sock.getOutputStream(), "UTF-8"));
}
catch (SocketTimeoutException e) {
throw new GuacamoleUpstreamTimeoutException("Connection timed out.", e);
}
catch (IOException e) {
throw new GuacamoleServerException(e);
}
}
@Override
public void close() throws GuacamoleException {
try {
logger.debug("Closing socket to guacd.");
sock.close();
}
catch (IOException e) {
throw new GuacamoleServerException(e);
}
}
@Override
public GuacamoleReader getReader() {
return reader;
}
@Override
public GuacamoleWriter getWriter() {
return writer;
}
@Override
public boolean isOpen() {
return !sock.isClosed();
}
}

View File

@@ -0,0 +1,149 @@
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apache.guacamole.net;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory;
import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.GuacamoleServerException;
import org.apache.guacamole.io.GuacamoleReader;
import org.apache.guacamole.io.GuacamoleWriter;
import org.apache.guacamole.io.ReaderGuacamoleReader;
import org.apache.guacamole.io.WriterGuacamoleWriter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Provides abstract socket-like access to a Guacamole connection over SSL to
* a given hostname and port.
*
* @author Michael Jumper
*/
public class SSLGuacamoleSocket implements GuacamoleSocket {
/**
* Logger for this class.
*/
private Logger logger = LoggerFactory.getLogger(SSLGuacamoleSocket.class);
/**
* The GuacamoleReader this socket should read from.
*/
private GuacamoleReader reader;
/**
* The GuacamoleWriter this socket should write to.
*/
private GuacamoleWriter writer;
/**
* The number of milliseconds to wait for data on the TCP socket before
* timing out.
*/
private static final int SOCKET_TIMEOUT = 15000;
/**
* The TCP socket that the GuacamoleReader and GuacamoleWriter exposed
* by this class should affect.
*/
private Socket sock;
/**
* Creates a new SSLGuacamoleSocket which reads and writes instructions
* to the Guacamole instruction stream of the Guacamole proxy server
* running at the given hostname and port using SSL.
*
* @param hostname The hostname of the Guacamole proxy server to connect to.
* @param port The port of the Guacamole proxy server to connect to.
* @throws GuacamoleException If an error occurs while connecting to the
* Guacamole proxy server.
*/
public SSLGuacamoleSocket(String hostname, int port) throws GuacamoleException {
// Get factory for SSL sockets
SocketFactory socket_factory = SSLSocketFactory.getDefault();
try {
logger.debug("Connecting to guacd at {}:{} via SSL/TLS.",
hostname, port);
// Get address
SocketAddress address = new InetSocketAddress(
InetAddress.getByName(hostname),
port
);
// Connect with timeout
sock = socket_factory.createSocket();
sock.connect(address, SOCKET_TIMEOUT);
// Set read timeout
sock.setSoTimeout(SOCKET_TIMEOUT);
// On successful connect, retrieve I/O streams
reader = new ReaderGuacamoleReader(new InputStreamReader(sock.getInputStream(), "UTF-8"));
writer = new WriterGuacamoleWriter(new OutputStreamWriter(sock.getOutputStream(), "UTF-8"));
}
catch (IOException e) {
throw new GuacamoleServerException(e);
}
}
@Override
public void close() throws GuacamoleException {
try {
logger.debug("Closing socket to guacd.");
sock.close();
}
catch (IOException e) {
throw new GuacamoleServerException(e);
}
}
@Override
public GuacamoleReader getReader() {
return reader;
}
@Override
public GuacamoleWriter getWriter() {
return writer;
}
@Override
public boolean isOpen() {
return !sock.isClosed();
}
}

View File

@@ -0,0 +1,69 @@
/*
* Copyright (C) 2015 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.apache.guacamole.net;
import java.util.UUID;
/**
* GuacamoleTunnel implementation which uses a provided socket. The UUID of
* the tunnel will be randomly generated.
*
* @author Michael Jumper
*/
public class SimpleGuacamoleTunnel extends AbstractGuacamoleTunnel {
/**
* The UUID associated with this tunnel. Every tunnel must have a
* corresponding UUID such that tunnel read/write requests can be
* directed to the proper tunnel.
*/
private final UUID uuid = UUID.randomUUID();
/**
* The GuacamoleSocket that tunnel should use for communication on
* behalf of the connecting user.
*/
private final GuacamoleSocket socket;
/**
* Creates a new GuacamoleTunnel which synchronizes access to the
* Guacamole instruction stream associated with the given GuacamoleSocket.
*
* @param socket The GuacamoleSocket to provide synchronized access for.
*/
public SimpleGuacamoleTunnel(GuacamoleSocket socket) {
this.socket = socket;
}
@Override
public UUID getUUID() {
return uuid;
}
@Override
public GuacamoleSocket getSocket() {
return socket;
}
}

View File

@@ -0,0 +1,28 @@
/*
* Copyright (C) 2013 Glyptodon LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Classes which apply to network-specific concepts, such as low-level sockets
* and tunnels.
*/
package org.apache.guacamole.net;