KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > osgi > service > upnp > UPnPException


1 /*
2  * $Header: /cvshome/build/org.osgi.service.upnp/src/org/osgi/service/upnp/UPnPException.java,v 1.14 2006/07/12 21:21:34 hargrave Exp $
3  *
4  * Copyright (c) OSGi Alliance (2005, 2006). All Rights Reserved.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.osgi.service.upnp;
19
20
21 /**
22  * There are several defined error situations describing UPnP problems while a
23  * control point invokes actions to UPnPDevices.
24  *
25  * @since 1.1
26  */

27 public class UPnPException extends Exception JavaDoc {
28     static final long serialVersionUID = -262013318122195146L;
29
30     /**
31      * No Action found by that name at this service.
32      */

33     public final static int INVALID_ACTION = 401;
34
35     /**
36      * Not enough arguments, too many arguments with a specific name, or one of
37      * more of the arguments are of the wrong type.
38      */

39     public final static int INVALID_ARGS = 402;
40
41     /**
42      * The different end-points are no longer in synchronization.
43      */

44     public final static int INVALID_SEQUENCE_NUMBER = 403;
45
46     /**
47      * Refers to a non existing variable.
48      */

49     public final static int INVALID_VARIABLE = 404;
50
51     /**
52      * The invoked action failed during execution.
53      */

54     public final static int DEVICE_INTERNAL_ERROR = 501;
55
56     /**
57      * Key for an error information that is an int type variable and that is
58      * used to identify occured errors.
59      */

60     private final int errorCode;
61
62     /**
63      * This constructor creates a UPnPException on the specified error code and
64      * error description.
65      *
66      * @param errorCode errorCode which defined UPnP Device Architecture V1.0.
67      * @param errordesc errorDescription which explain the type of propblem.
68      */

69     public UPnPException(int errorCode, String JavaDoc errordesc) {
70         super(errordesc);
71         this.errorCode = errorCode;
72     }
73
74     /**
75      * Returns the UPnPError Code occured by UPnPDevices during invocation.
76      *
77      * @return The UPnPErrorCode defined by a UPnP Forum working committee or
78      * specified by a UPnP vendor.
79      */

80     public int getUPnPError_Code() {
81         return errorCode;
82     }
83 }
84
Popular Tags