1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.providers.xmpp; |
12 | |
|
13 | |
import org.mule.impl.endpoint.UserInfoEndpointBuilder; |
14 | |
import org.mule.providers.xmpp.i18n.XmppMessages; |
15 | |
import org.mule.umo.endpoint.MalformedEndpointException; |
16 | |
|
17 | |
import java.net.URI; |
18 | |
import java.util.Properties; |
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | 14 | public class XmppEndpointBuilder extends UserInfoEndpointBuilder |
26 | |
{ |
27 | |
protected void setEndpoint(URI uri, Properties props) throws MalformedEndpointException |
28 | |
{ |
29 | 14 | if (uri.getPath().length() == 0) |
30 | |
{ |
31 | 2 | throw new MalformedEndpointException(XmppMessages.noRecipientInUri(), uri.toString()); |
32 | |
} |
33 | 12 | if (props.getProperty(XmppConnector.XMPP_GROUP_CHAT, "false").equalsIgnoreCase("true")) |
34 | |
{ |
35 | 4 | if (props.getProperty(XmppConnector.XMPP_NICKNAME, null) == null) |
36 | |
{ |
37 | 2 | throw new MalformedEndpointException(XmppMessages.nicknameMustBeSet(), uri.toString()); |
38 | |
} |
39 | |
} |
40 | 10 | super.setEndpoint(uri, props); |
41 | 10 | } |
42 | |
} |