Subversion Repositories XServices

Rev

Rev 6 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 46
1
/*
1
/*
2
 *   Copyright 2010 Brian Rosenberger (Brutex Network)
2
 *   Copyright 2010 Brian Rosenberger (Brutex Network)
3
 *
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
6
 *   You may obtain a copy of the License at
7
 *
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
14
 *   limitations under the License.
15
 */
15
 */
16
 
16
 
17
package net.brutex.xservices.ws;
17
package net.brutex.xservices.ws;
18
 
18
 
19
import java.util.GregorianCalendar;
19
import java.util.GregorianCalendar;
20
import javax.xml.bind.annotation.XmlElement;
20
import javax.xml.bind.annotation.XmlElement;
21
import javax.xml.datatype.DatatypeConfigurationException;
21
import javax.xml.datatype.DatatypeConfigurationException;
22
import javax.xml.datatype.DatatypeFactory;
22
import javax.xml.datatype.DatatypeFactory;
23
import javax.xml.datatype.XMLGregorianCalendar;
23
import javax.xml.datatype.XMLGregorianCalendar;
24
 
24
 
25
/**
25
/**
26
 *
26
 *
27
 * @author Brian Rosenberger, bru@brutex.de
27
 * @author Brian Rosenberger, bru@brutex.de
28
 */
28
 */
29
public class XServicesFault extends Exception {
29
public class XServicesFault extends Exception {
-
 
30
 
-
 
31
    /**
-
 
32
	 * 
-
 
33
	 */
-
 
34
	private static final long serialVersionUID = -6779279189376374820L;
30
 
35
 
31
    public XServicesFault(String message, Exception e) {
36
	public XServicesFault(String message, Exception e) {
32
        this(message, e.getCause());
37
        this(message, e.getCause());
33
    }
38
    }
34
 
39
 
35
    public XServicesFault(String string) {
40
    public XServicesFault(String string) {
36
        this(string, new Exception(string).getCause());
41
        this(string, new Exception(string).getCause());
37
    }
42
    }
38
 
43
 
39
    public XServicesFault(Exception e) {
44
    public XServicesFault(Exception e) {
40
        this(e.getMessage(), e.getCause());
45
        this(e.getMessage(), e.getCause());
41
    }
46
    }
42
 
47
 
43
    public XServicesFault(String message, Throwable cause) {
48
    public XServicesFault(String message, Throwable cause) {
44
        super(message, cause);
49
        super(message, cause);
45
        this.faultstring=message;
50
        this.faultstring=message;
46
 
51
 
47
       
52
       
48
        try {
53
        try {
49
            timestamp = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
54
            timestamp = DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar());
50
        } catch (DatatypeConfigurationException ex) {
55
        } catch (DatatypeConfigurationException ex) {
51
            System.err.println(ex.getMessage());
56
            System.err.println(ex.getMessage());
52
        }
57
        }
53
 
58
 
54
 
59
 
55
    }
60
    }
56
    @XmlElement(name="faultstring")
61
    @XmlElement(name="faultstring")
57
    public String faultstring = "";
62
    public String faultstring = "";
58
 
63
 
59
    @XmlElement(name="username")
64
    @XmlElement(name="username")
60
    public String username = System.getProperty("user.name");
65
    public String username = System.getProperty("user.name");
61
 
66
 
62
    @XmlElement(name="homedir")
67
    @XmlElement(name="homedir")
63
    public String homedir = System.getProperty("user.home");
68
    public String homedir = System.getProperty("user.home");
64
 
69
 
65
    @XmlElement(name="timstamp")
70
    @XmlElement(name="timstamp")
66
    public XMLGregorianCalendar timestamp = null;
71
    public XMLGregorianCalendar timestamp = null;
67
}
72
}