mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-1007: Add Translatable versions of GuacamoleException subclasses for convenience.
This commit is contained in:
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleClientBadTypeException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleClientBadTypeException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleClientBadTypeException extends GuacamoleClientBadTypeException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientBadTypeException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientBadTypeException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientBadTypeException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleClientBadTypeException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientBadTypeException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientBadTypeException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientBadTypeException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleClientBadTypeException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleClientException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleClientException} whose associated message is translatable
|
||||
* and can be passed through an arbitrary translation service, producing a
|
||||
* human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleClientException extends GuacamoleClientException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleClientException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleClientException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleClientOverrunException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleClientOverrunException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleClientOverrunException extends GuacamoleClientOverrunException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientOverrunException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientOverrunException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientOverrunException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleClientOverrunException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientOverrunException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientOverrunException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientOverrunException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleClientOverrunException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleClientTimeoutException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleClientTimeoutException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleClientTimeoutException extends GuacamoleClientTimeoutException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTimeoutException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTimeoutException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTimeoutException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTimeoutException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTimeoutException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTimeoutException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTimeoutException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTimeoutException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleClientTooManyException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleClientTooManyException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleClientTooManyException extends GuacamoleClientTooManyException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTooManyException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTooManyException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTooManyException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTooManyException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTooManyException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTooManyException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleClientTooManyException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleClientTooManyException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleConnectionClosedException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleConnectionClosedException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleConnectionClosedException extends GuacamoleConnectionClosedException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleConnectionClosedException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleConnectionClosedException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleConnectionClosedException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleConnectionClosedException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleConnectionClosedException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleConnectionClosedException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleConnectionClosedException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleConnectionClosedException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
|
||||
import org.apache.guacamole.net.auth.credentials.GuacamoleCredentialsException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleCredentialsException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleCredentialsException
|
||||
extends GuacamoleCredentialsException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleCredentialsException with the given
|
||||
* message, cause, and associated credential information. The message must
|
||||
* be provided in both non-translatable (readable as-written) and
|
||||
* translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleCredentialsException(String message,
|
||||
TranslatableMessage translatableMessage, Throwable cause, CredentialsInfo credentialsInfo) {
|
||||
super(message, cause, credentialsInfo);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleCredentialsException with the given
|
||||
* message, and associated credential information. The message must be
|
||||
* provided in both non-translatable (readable as-written) and translatable
|
||||
* forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleCredentialsException(String message,
|
||||
TranslatableMessage translatableMessage, CredentialsInfo credentialsInfo) {
|
||||
super(message, credentialsInfo);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleCredentialsException with the given
|
||||
* message, cause, and associated credential information. The message must
|
||||
* be provided in both non-translatable (readable as-written) and
|
||||
* translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleCredentialsException(String message,
|
||||
String key, Throwable cause, CredentialsInfo credentialsInfo) {
|
||||
this(message, new TranslatableMessage(key), cause, credentialsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleCredentialsException with the given
|
||||
* message, and associated credential information. The message must be
|
||||
* provided in both non-translatable (readable as-written) and translatable
|
||||
* forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleCredentialsException(String message,
|
||||
String key, CredentialsInfo credentialsInfo) {
|
||||
this(message, new TranslatableMessage(key), credentialsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
|
||||
import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleInsufficientCredentialsException} whose associated message
|
||||
* is translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleInsufficientCredentialsException
|
||||
extends GuacamoleInsufficientCredentialsException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInsufficientCredentialsException with
|
||||
* the given message, cause, and associated credential information. The
|
||||
* message must be provided in both non-translatable (readable as-written)
|
||||
* and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInsufficientCredentialsException(String message,
|
||||
TranslatableMessage translatableMessage, Throwable cause, CredentialsInfo credentialsInfo) {
|
||||
super(message, cause, credentialsInfo);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInsufficientCredentialsException with
|
||||
* the given message, and associated credential information. The message
|
||||
* must be provided in both non-translatable (readable as-written) and
|
||||
* translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInsufficientCredentialsException(String message,
|
||||
TranslatableMessage translatableMessage, CredentialsInfo credentialsInfo) {
|
||||
super(message, credentialsInfo);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInsufficientCredentialsException with
|
||||
* the given message, cause, and associated credential information. The
|
||||
* message must be provided in both non-translatable (readable as-written)
|
||||
* and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInsufficientCredentialsException(String message,
|
||||
String key, Throwable cause, CredentialsInfo credentialsInfo) {
|
||||
this(message, new TranslatableMessage(key), cause, credentialsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInsufficientCredentialsException with
|
||||
* the given message, and associated credential information. The message
|
||||
* must be provided in both non-translatable (readable as-written) and
|
||||
* translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInsufficientCredentialsException(String message,
|
||||
String key, CredentialsInfo credentialsInfo) {
|
||||
this(message, new TranslatableMessage(key), credentialsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
|
||||
import org.apache.guacamole.net.auth.credentials.GuacamoleInvalidCredentialsException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleInvalidCredentialsException} whose associated message
|
||||
* is translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleInvalidCredentialsException
|
||||
extends GuacamoleInvalidCredentialsException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInvalidCredentialsException with
|
||||
* the given message, cause, and associated credential information. The
|
||||
* message must be provided in both non-translatable (readable as-written)
|
||||
* and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInvalidCredentialsException(String message,
|
||||
TranslatableMessage translatableMessage, Throwable cause, CredentialsInfo credentialsInfo) {
|
||||
super(message, cause, credentialsInfo);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInvalidCredentialsException with
|
||||
* the given message, and associated credential information. The message
|
||||
* must be provided in both non-translatable (readable as-written) and
|
||||
* translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInvalidCredentialsException(String message,
|
||||
TranslatableMessage translatableMessage, CredentialsInfo credentialsInfo) {
|
||||
super(message, credentialsInfo);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInvalidCredentialsException with
|
||||
* the given message, cause, and associated credential information. The
|
||||
* message must be provided in both non-translatable (readable as-written)
|
||||
* and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInvalidCredentialsException(String message,
|
||||
String key, Throwable cause, CredentialsInfo credentialsInfo) {
|
||||
this(message, new TranslatableMessage(key), cause, credentialsInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleInvalidCredentialsException with
|
||||
* the given message, and associated credential information. The message
|
||||
* must be provided in both non-translatable (readable as-written) and
|
||||
* translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param credentialsInfo
|
||||
* Information describing the form of valid credentials.
|
||||
*/
|
||||
public TranslatableGuacamoleInvalidCredentialsException(String message,
|
||||
String key, CredentialsInfo credentialsInfo) {
|
||||
this(message, new TranslatableMessage(key), credentialsInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleResourceClosedException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleResourceClosedException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleResourceClosedException extends GuacamoleResourceClosedException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceClosedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceClosedException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceClosedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceClosedException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceClosedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceClosedException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceClosedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceClosedException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleResourceConflictException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleResourceConflictException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleResourceConflictException extends GuacamoleResourceConflictException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceConflictException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceConflictException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceConflictException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceConflictException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceConflictException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceConflictException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceConflictException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceConflictException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleResourceNotFoundException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleResourceNotFoundException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleResourceNotFoundException extends GuacamoleResourceNotFoundException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceNotFoundException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceNotFoundException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceNotFoundException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceNotFoundException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceNotFoundException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceNotFoundException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleResourceNotFoundException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleResourceNotFoundException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleSecurityException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleSecurityException} whose associated message is translatable
|
||||
* and can be passed through an arbitrary translation service, producing a
|
||||
* human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleSecurityException extends GuacamoleSecurityException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSecurityException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSecurityException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSecurityException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleSecurityException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSecurityException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSecurityException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSecurityException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleSecurityException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleServerBusyException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleServerBusyException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleServerBusyException extends GuacamoleServerBusyException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerBusyException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleServerBusyException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerBusyException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleServerBusyException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerBusyException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleServerBusyException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerBusyException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleServerBusyException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleServerException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleServerException} whose associated message is translatable
|
||||
* and can be passed through an arbitrary translation service, producing a
|
||||
* human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleServerException extends GuacamoleServerException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleServerException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleServerException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleServerException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleServerException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleServerException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleSessionClosedException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleSessionClosedException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleSessionClosedException extends GuacamoleSessionClosedException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionClosedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionClosedException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionClosedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionClosedException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionClosedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionClosedException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionClosedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionClosedException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleSessionConflictException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleSessionConflictException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleSessionConflictException extends GuacamoleSessionConflictException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionConflictException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionConflictException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionConflictException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionConflictException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionConflictException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionConflictException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionConflictException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionConflictException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleSessionTimeoutException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleSessionTimeoutException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleSessionTimeoutException extends GuacamoleSessionTimeoutException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionTimeoutException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionTimeoutException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionTimeoutException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionTimeoutException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionTimeoutException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionTimeoutException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleSessionTimeoutException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleSessionTimeoutException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleUnauthorizedException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleUnauthorizedException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleUnauthorizedException extends GuacamoleUnauthorizedException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnauthorizedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUnauthorizedException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnauthorizedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleUnauthorizedException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnauthorizedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUnauthorizedException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnauthorizedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleUnauthorizedException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleUnsupportedException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleUnsupportedException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleUnsupportedException extends GuacamoleUnsupportedException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnsupportedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUnsupportedException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnsupportedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleUnsupportedException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnsupportedException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUnsupportedException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUnsupportedException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleUnsupportedException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleUpstreamException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleUpstreamException} whose associated message is translatable
|
||||
* and can be passed through an arbitrary translation service, producing a
|
||||
* human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleUpstreamException extends GuacamoleUpstreamException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamException with the given
|
||||
* message and cause. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamException with the given
|
||||
* message. The message must be provided in both non-translatable (readable
|
||||
* as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleUpstreamNotFoundException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleUpstreamNotFoundException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleUpstreamNotFoundException extends GuacamoleUpstreamNotFoundException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamNotFoundException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamNotFoundException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamNotFoundException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamNotFoundException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamNotFoundException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamNotFoundException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamNotFoundException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamNotFoundException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleUpstreamTimeoutException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleUpstreamTimeoutException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleUpstreamTimeoutException extends GuacamoleUpstreamTimeoutException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamTimeoutException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamTimeoutException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamTimeoutException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamTimeoutException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamTimeoutException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamTimeoutException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamTimeoutException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamTimeoutException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.guacamole.language;
|
||||
|
||||
import org.apache.guacamole.GuacamoleUpstreamUnavailableException;
|
||||
|
||||
/**
|
||||
* A {@link GuacamoleUpstreamUnavailableException} whose associated message is
|
||||
* translatable and can be passed through an arbitrary translation service,
|
||||
* producing a human-readable message in the user's native language.
|
||||
*/
|
||||
public class TranslatableGuacamoleUpstreamUnavailableException extends GuacamoleUpstreamUnavailableException implements Translatable {
|
||||
|
||||
/**
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
private final TranslatableMessage translatableMessage;
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamUnavailableException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamUnavailableException(String message, TranslatableMessage translatableMessage, Throwable cause) {
|
||||
super(message, cause);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamUnavailableException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param translatableMessage
|
||||
* A translatable, human-readable description of the exception that
|
||||
* occurred.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamUnavailableException(String message, TranslatableMessage translatableMessage) {
|
||||
super(message);
|
||||
this.translatableMessage = translatableMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamUnavailableException with the
|
||||
* given message and cause. The message must be provided in both
|
||||
* non-translatable (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*
|
||||
* @param cause
|
||||
* The cause of this exception.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamUnavailableException(String message, String key, Throwable cause) {
|
||||
this(message, new TranslatableMessage(key), cause);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new TranslatableGuacamoleUpstreamUnavailableException with the
|
||||
* given message. The message must be provided in both non-translatable
|
||||
* (readable as-written) and translatable forms.
|
||||
*
|
||||
* @param message
|
||||
* A human-readable description of the exception that occurred. This
|
||||
* message should be readable on its own and as-written, without
|
||||
* requiring a translation service.
|
||||
*
|
||||
* @param key
|
||||
* The arbitrary key which can be used to look up the message to be
|
||||
* displayed in the user's native language.
|
||||
*/
|
||||
public TranslatableGuacamoleUpstreamUnavailableException(String message, String key) {
|
||||
this(message, new TranslatableMessage(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public TranslatableMessage getTranslatableMessage() {
|
||||
return translatableMessage;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user