本文整理了Java中org.jivesoftware.openfire.XMPPServer.getInstance()
方法的一些代码示例,展示了XMPPServer.getInstance()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMPPServer.getInstance()
方法的具体详情如下:
包路径:org.jivesoftware.openfire.XMPPServer
类名称:XMPPServer
方法名:getInstance
[英]Returns a singleton instance of XMPPServer.
[中]返回XMPPServer的单例实例。
代码示例来源:origin: igniterealtime/Openfire
public PubSubInfo()
{
super( XMPPServer.getInstance().getPubSubModule() );
}
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the XMPP server object -- can get many config items from here.
*/
public XMPPServer getXMPPServer() {
final XMPPServer xmppServer = XMPPServer.getInstance();
if (xmppServer == null) {
// Show that the server is down
showServerDown();
return null;
}
return xmppServer;
}
代码示例来源:origin: igniterealtime/Openfire
public void pluginsMonitored()
{
Log.debug( "Received plugin monitor event! Plugins should now be loaded." );
// Stop listening for plugin events
XMPPServer.getInstance().getPluginManager().removePluginManagerListener( this );
// Start listeners
startListeners();
}
} );
代码示例来源:origin: igniterealtime/Openfire
private boolean isHostUnknown(String host) {
if (host == null) {
// Answer false since when using server dialback the stream header will not
// have a TO attribute
return false;
}
if (XMPPServer.getInstance().getServerInfo().getXMPPDomain().equals( host )) {
// requested host matched the server name
return false;
}
return true;
}
代码示例来源:origin: igniterealtime/Openfire
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static boolean isServiceEnabled() {
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
return connectionManager.isComponentListenerEnabled();
}
代码示例来源:origin: igniterealtime/Openfire
@Override
StanzaHandler createStanzaHandler( NIOConnection connection )
{
return new ServerStanzaHandler( XMPPServer.getInstance().getPacketRouter(), connection );
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void leftCluster() {
if (!XMPPServer.getInstance().isShuttingDown()) {
restoreCacheContent();
}
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the fully-qualifed domain name of this chat service.
* The domain is composed by the service name and the
* name of the XMPP server where the service is running.
*
* @return the file transfer server domain (service name + host name).
*/
public String getServiceDomain() {
return proxyServiceName + "." + XMPPServer.getInstance().getServerInfo().getXMPPDomain();
}
代码示例来源:origin: igniterealtime/Openfire
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static void setServiceEnabled(boolean enabled) throws ModificationNotAllowedException {
// Alert listeners about this event
for (ExternalComponentManagerListener listener : listeners) {
listener.serviceEnabled(enabled);
}
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
connectionManager.enableComponentListener(enabled);
}
代码示例来源:origin: igniterealtime/Openfire
/**
* @deprecated Obtain and use the corresponding {@link org.jivesoftware.openfire.spi.ConnectionListener} instead.
*/
@Deprecated
public static void setServicePort(int port) throws ModificationNotAllowedException {
// Alert listeners about this event
for (ExternalComponentManagerListener listener : listeners) {
listener.portChanged(port);
}
ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
connectionManager.setComponentListenerPort(port);
}
代码示例来源:origin: igniterealtime/Openfire
public PubSubServiceInfo(PubSubService pubSubService) {
if (pubSubService == null) {
throw new IllegalArgumentException("Argument 'pubSubService' cannot be null.");
}
this.pubSubService = pubSubService;
xmppServer = XMPPServer.getInstance();
pubSubModule = xmppServer.getPubSubModule();
groupManager = GroupManager.getInstance();
userManager = xmppServer.getUserManager();
}
代码示例来源:origin: igniterealtime/Openfire
private boolean validateHost(String host) {
boolean result = true;
if (JiveGlobals.getBooleanProperty("xmpp.client.validate.host", false)) {
result = XMPPServer.getInstance().getServerInfo().getXMPPDomain().equals(host);
}
return result;
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void sendPacket(Component component, Packet packet) {
if (packet != null && packet.getFrom() == null) {
throw new IllegalArgumentException("Packet with no FROM address was received from component.");
}
PacketRouter router = XMPPServer.getInstance().getPacketRouter();
if (router != null) {
router.route(packet);
}
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public ConnectionConfiguration getConfiguration() {
if (configuration == null) {
final ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager());
configuration = connectionManager.getListener( connectionType, true ).generateConnectionConfiguration();
}
return configuration;
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns an iterator for all groups that the User is a member of.
*
* @param user the user.
* @return all groups the user belongs to.
*/
public Collection<Group> getGroups(User user) {
return getGroups(XMPPServer.getInstance().createJID(user.getUsername(), null, true));
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Returns the name of the directory of the parent for this plugin. The value is retrieved from the plugin.xml file
* of the plugin (which is casted down to lower-case). If the value could not be found, <tt>null</tt> will be returned.
*
* @param plugin The plugin (cannot be null)
* @return the parent plugin's directory name
*/
public static String getParentPlugin( Plugin plugin )
{
return getParentPlugin( XMPPServer.getInstance().getPluginManager().getPluginPath( plugin ) );
}
代码示例来源:origin: igniterealtime/Openfire
private void broadcast(org.xmpp.packet.Roster roster) {
JID recipient = XMPPServer.getInstance().createJID(username, null, true);
roster.setTo(recipient);
// When roster versioning is enabled, the server MUST include
// the updated roster version with each roster push.
if (RosterManager.isRosterVersioningEnabled()) {
roster.getChildElement().addAttribute("ver", String.valueOf( roster.hashCode() ) );
}
SessionManager.getInstance().userBroadcast(username, roster);
}
代码示例来源:origin: igniterealtime/Openfire
/**
* Sends a presence probe to the probee for each connected resource of this user.
*/
private void probePresence(JID probee) {
final PresenceManager presenceManager = XMPPServer.getInstance().getPresenceManager();
for (ClientSession session : SessionManager.getInstance().getSessions(username)) {
presenceManager.probePresence(session.getAddress(), probee);
}
}
代码示例来源:origin: igniterealtime/Openfire
private void startProxy() {
connectionManager.processConnections(bindInterface, getProxyPort());
routingTable.addComponentRoute(getAddress(), this);
XMPPServer server = XMPPServer.getInstance();
server.getIQDiscoItemsHandler().addServerItemsProvider(this);
}
代码示例来源:origin: igniterealtime/Openfire
@Override
public void stop() {
super.stop();
XMPPServer.getInstance().getIQDiscoItemsHandler()
.removeComponentItem(getAddress().toString());
routingTable.removeComponentRoute(getAddress());
connectionManager.disable();
}
内容来源于网络,如有侵权,请联系作者删除!