001/** 002 * Copyright 2017, Digi International Inc. 003 * 004 * This Source Code Form is subject to the terms of the Mozilla Public 005 * License, v. 2.0. If a copy of the MPL was not distributed with this 006 * file, you can obtain one at http://mozilla.org/MPL/2.0/. 007 * 008 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 009 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 010 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 011 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 012 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 013 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 014 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 015 */ 016package com.digi.xbee.api.exceptions; 017 018/** 019 * This exception will be thrown when the user does not have the appropriate 020 * access to the connection interface. Usually happens when the XBee device is 021 * communicating through a serial port. 022 * 023 * @see ConnectionException 024 */ 025public class PermissionDeniedException extends ConnectionException { 026 027 // Constants 028 private static final long serialVersionUID = 1L; 029 private static final String DEFAULT_MESSAGE = "You don't have the required permissions to access the connection interface."; 030 031 /** 032 * Creates a {@code PermissionDeniedException} with 033 * {@value #DEFAULT_MESSAGE} as its error detail message. 034 */ 035 public PermissionDeniedException() { 036 super(DEFAULT_MESSAGE); 037 } 038 039 /** 040 * Creates a {@code PermissionDeniedException} with the specified message. 041 * 042 * @param message The associated message. 043 */ 044 public PermissionDeniedException(String message) { 045 super(message); 046 } 047 048 /** 049 * Creates a {@code PermissionDeniedException} with the specified 050 * message and cause. 051 * 052 * @param message The associated message. 053 * @param cause The cause of this exception. 054 * 055 * @see Throwable 056 */ 057 public PermissionDeniedException(String message, Throwable cause) { 058 super(message, cause); 059 } 060}