2019-12-21 00:27:48 +01:00
|
|
|
package org.mercury_im.messenger.xmpp;
|
|
|
|
|
|
|
|
import org.jivesoftware.smack.XMPPConnection;
|
|
|
|
import org.mercury_im.messenger.entity.Account;
|
|
|
|
|
|
|
|
public class MercuryConnection {
|
|
|
|
|
2019-12-21 01:45:30 +01:00
|
|
|
private static final XmppConnectionFactory connectionFactory = new XmppConnectionFactory();
|
2019-12-21 00:27:48 +01:00
|
|
|
|
2019-12-21 01:45:30 +01:00
|
|
|
private final Account account;
|
2019-12-21 00:27:48 +01:00
|
|
|
private XMPPConnection connection;
|
|
|
|
|
|
|
|
public MercuryConnection(Account account) {
|
|
|
|
this.account = account;
|
2019-12-21 01:45:30 +01:00
|
|
|
this.connection = connectionFactory.createConnection(account);
|
2019-12-21 00:27:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public Account getAccount() {
|
|
|
|
return account;
|
|
|
|
}
|
|
|
|
|
|
|
|
public XMPPConnection getConnection() {
|
|
|
|
return connection;
|
|
|
|
}
|
|
|
|
}
|