blob: a72f310506deefe32a9008dcc57a6ef78efb347a (
plain)
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
|
/*
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
*
* Copyright @ 2015 Atlassian Pty Ltd
*
* 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 net.java.sip.communicator.impl.protocol.jabber.extensions.jibri;
import org.jivesoftware.smack.packet.*;
import java.util.*;
/**
* Wraps Smack's <tt>XMPPError</tt> into <tt>PacketExtension</tt>, so that it
* can be easily inserted into {@link RecordingStatus}.
*/
public class XMPPErrorPE
implements PacketExtension
{
/**
* <tt>XMPPError</tt> wrapped into this <tt>XMPPErrorPE</tt>.
*/
private XMPPError error;
/**
* Creates new instance of <tt>XMPPErrorPE</tt>.
* @param xmppError the instance of <tt>XMPPError</tt> that will be wrapped
* by the newly created <tt>XMPPErrorPE</tt>.
*/
public XMPPErrorPE(XMPPError xmppError)
{
setError(xmppError);
}
/**
* Returns the underlying instance of <tt>XMPPError</tt>.
*/
public XMPPError getError()
{
return error;
}
/**
* Sets new instance of <tt>XMPPError</tt> to be wrapped by this
* <tt>XMPPErrorPE</tt>.
* @param error <tt>XMPPError</tt> that will be wrapped by this
* <TT>XMPPErrorPE</TT>.
*/
public void setError(XMPPError error)
{
Objects.requireNonNull(error, "error");
this.error = error;
}
/**
* {@inheritDoc}
*/
@Override
public String getElementName()
{
return "error";
}
/**
* {@inheritDoc}
*/
@Override
public String getNamespace()
{
return "";
}
/**
* {@inheritDoc}
*/
@Override
public String toXML()
{
return error.toXML();
}
}
|