diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientBadTypeException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientBadTypeException.java new file mode 100644 index 000000000..9bb9ac1c6 --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientBadTypeException.java @@ -0,0 +1,71 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which is thrown when data has been submitted with an unsupported + * mimetype. + * + * @author Michael Jumper + */ +public class GuacamoleClientBadTypeException extends GuacamoleClientException { + + /** + * Creates a new GuacamoleClientBadTypeException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleClientBadTypeException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleClientBadTypeException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleClientBadTypeException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleClientBadTypeException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleClientBadTypeException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.CLIENT_BAD_TYPE; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientOverrunException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientOverrunException.java new file mode 100644 index 000000000..1e900013b --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientOverrunException.java @@ -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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which is thrown when the client has sent too much data. This + * usually indicates that a server-side buffer is not large enough to + * accommodate the data, or protocol specifications prohibit data of the size + * received. + * + * @author Michael Jumper + */ +public class GuacamoleClientOverrunException extends GuacamoleClientException { + + /** + * Creates a new GuacamoleClientOverrunException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleClientOverrunException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleClientOverrunException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleClientOverrunException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleClientOverrunException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleClientOverrunException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.CLIENT_OVERRUN; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientTimeoutException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientTimeoutException.java new file mode 100644 index 000000000..46378a2b4 --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientTimeoutException.java @@ -0,0 +1,70 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which is thrown when the client is taking too long to respond. + * + * @author Michael Jumper + */ +public class GuacamoleClientTimeoutException extends GuacamoleClientException { + + /** + * Creates a new GuacamoleClientTimeoutException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleClientTimeoutException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleClientTimeoutException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleClientTimeoutException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleClientTimeoutException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleClientTimeoutException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.CLIENT_TIMEOUT; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientTooManyException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientTooManyException.java new file mode 100644 index 000000000..91e77c1e1 --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleClientTooManyException.java @@ -0,0 +1,72 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which is thrown when too many requests have been received + * by the current client, and further requests are being rejected, either + * temporarily or permanently. + * + * @author Michael Jumper + */ +public class GuacamoleClientTooManyException extends GuacamoleClientException { + + /** + * Creates a new GuacamoleClientTooManyException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleClientTooManyException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleClientTooManyException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleClientTooManyException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleClientTooManyException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleClientTooManyException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.CLIENT_TOO_MANY; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleResourceConflictException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleResourceConflictException.java new file mode 100644 index 000000000..9138bae2e --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleResourceConflictException.java @@ -0,0 +1,72 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which is thrown when a resource has been requested, but that + * resource is locked or currently in use, and cannot be accessed by the + * current user. + * + * @author Michael Jumper + */ +public class GuacamoleResourceConflictException extends GuacamoleClientException { + + /** + * Creates a new GuacamoleResourceConflictException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleResourceConflictException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleResourceConflictException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleResourceConflictException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleResourceConflictException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleResourceConflictException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.RESOURCE_CONFLICT; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleServerBusyException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleServerBusyException.java new file mode 100644 index 000000000..96473fe71 --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleServerBusyException.java @@ -0,0 +1,71 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which is thrown when the server is too busy to service the + * request. + * + * @author Michael Jumper + */ +public class GuacamoleServerBusyException extends GuacamoleServerException { + + /** + * Creates a new GuacamoleServerBusyException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleServerBusyException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleServerBusyException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleServerBusyException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleServerBusyException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleServerBusyException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.SERVER_BUSY; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUnauthorizedException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUnauthorizedException.java new file mode 100644 index 000000000..a9db5afe4 --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUnauthorizedException.java @@ -0,0 +1,72 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * A security-related exception thrown when parts of the Guacamole API is + * denying access to a resource, but access MAY be granted were the user + * authorized (logged in). + * + * @author Michael Jumper + */ +public class GuacamoleUnauthorizedException extends GuacamoleSecurityException { + + /** + * Creates a new GuacamoleUnauthorizedException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleUnauthorizedException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleUnauthorizedException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleUnauthorizedException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleUnauthorizedException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleUnauthorizedException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.CLIENT_UNAUTHORIZED; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUnsupportedException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUnsupportedException.java new file mode 100644 index 000000000..8aa1869ab --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUnsupportedException.java @@ -0,0 +1,71 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which is thrown when the requested operation is unsupported + * or unimplemented. + * + * @author Michael Jumper + */ +public class GuacamoleUnsupportedException extends GuacamoleServerException { + + /** + * Creates a new GuacamoleUnsupportedException with the given message and cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleUnsupportedException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleUnsupportedException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleUnsupportedException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleUnsupportedException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleUnsupportedException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.UNSUPPORTED; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUpstreamException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUpstreamException.java new file mode 100644 index 000000000..c0bfb80fe --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUpstreamException.java @@ -0,0 +1,72 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which indicates than an upstream server (such as the remote + * desktop) is returning an error or is otherwise unreachable. + * + * @author Michael Jumper + */ +public class GuacamoleUpstreamException extends GuacamoleException { + + /** + * Creates a new GuacamoleUpstreamException with the given message and + * cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleUpstreamException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleUpstreamException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleUpstreamException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleUpstreamException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleUpstreamException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.UPSTREAM_ERROR; + } + +} diff --git a/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUpstreamTimeoutException.java b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUpstreamTimeoutException.java new file mode 100644 index 000000000..e1e0998b3 --- /dev/null +++ b/guacamole-common/src/main/java/org/glyptodon/guacamole/GuacamoleUpstreamTimeoutException.java @@ -0,0 +1,72 @@ +/* + * 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.glyptodon.guacamole; + +import org.glyptodon.guacamole.protocol.GuacamoleStatus; + + +/** + * An exception which indicates than an upstream server (such as the remote + * desktop) is taking too long to respond. + * + * @author Michael Jumper + */ +public class GuacamoleUpstreamTimeoutException extends GuacamoleUpstreamException { + + /** + * Creates a new GuacamoleUpstreamException with the given message and + * cause. + * + * @param message A human readable description of the exception that + * occurred. + * @param cause The cause of this exception. + */ + public GuacamoleUpstreamTimeoutException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new GuacamoleUpstreamException with the given message. + * + * @param message A human readable description of the exception that + * occurred. + */ + public GuacamoleUpstreamTimeoutException(String message) { + super(message); + } + + /** + * Creates a new GuacamoleUpstreamException with the given cause. + * + * @param cause The cause of this exception. + */ + public GuacamoleUpstreamTimeoutException(Throwable cause) { + super(cause); + } + + @Override + public GuacamoleStatus getStatus() { + return GuacamoleStatus.UPSTREAM_TIMEOUT; + } + +}