1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
/*
* Copyright (c) OSGi Alliance (2005, 2013). All Rights Reserved.
*
* Licensed 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.osgi.service.upnp;
/**
* There are several defined error situations describing UPnP problems while a
* control point invokes actions to UPnPDevices.
*
* @since 1.1
* @author $Id$
*/
public class UPnPException extends Exception {
static final long serialVersionUID = -262013318122195146L;
/**
* No Action found by that name at this service.
*/
public final static int INVALID_ACTION = 401;
/**
* Not enough arguments, too many arguments with a specific name, or one of
* more of the arguments are of the wrong type.
*/
public final static int INVALID_ARGS = 402;
/**
* The different end-points are no longer in synchronization.
*/
public final static int INVALID_SEQUENCE_NUMBER = 403;
/**
* Refers to a non existing variable.
*/
public final static int INVALID_VARIABLE = 404;
/**
* The invoked action failed during execution.
*/
public final static int DEVICE_INTERNAL_ERROR = 501;
/**
* Key for an error information that is an int type variable and that is
* used to identify occurred errors.
*/
private final int errorCode;
/**
* This constructor creates a {@code UPnPException} on the specified error
* code and error description.
*
* @param errorCode error code which defined by UPnP Device Architecture
* V1.0.
* @param errorDescription error description which explain the type of
* problem.
*/
public UPnPException(int errorCode, String errorDescription) {
super(errorDescription);
this.errorCode = errorCode;
}
/**
* This constructor creates a {@code UPnPException} on the specified error
* code, error description and error cause.
*
* @param errorCode error code which defined by UPnP Device Architecture
* V1.0.
* @param errorDescription error description which explain the type of the
* problem.
* @param errorCause cause of that {@code UPnPException}.
*
* @since 1.2
*/
public UPnPException(int errorCode, String errorDescription, Throwable errorCause) {
super(errorDescription, errorCause);
this.errorCode = errorCode;
}
/**
* Returns the UPnP Error Code occurred by UPnPDevices during invocation.
*
* @return The UPnPErrorCode defined by a UPnP Forum working committee or
* specified by a UPnP vendor.
*
* @since 1.2
*/
public int getUPnPErrorCode() {
return errorCode;
}
/**
* Returns the UPnPError Code occurred by UPnPDevices during invocation.
*
* @return The UPnPErrorCode defined by a UPnP Forum working committee or
* specified by a UPnP vendor.
* @deprecated As of version 1.2, replaced by {@link #getUPnPErrorCode()}
*/
public int getUPnPError_Code() {
return getUPnPErrorCode();
}
}
|