org.jivesoftware.openfire.XMPPServer类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(150)

本文整理了Java中org.jivesoftware.openfire.XMPPServer类的一些代码示例,展示了XMPPServer类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XMPPServer类的具体详情如下:
包路径:org.jivesoftware.openfire.XMPPServer
类名称:XMPPServer

XMPPServer介绍

[英]The main XMPP server that will load, initialize and start all the server's modules. The server is unique in the JVM and could be obtained by using the #getInstance() method.

The loaded modules will be initialized and may access through the server other modules. This means that the only way for a module to locate another module is through the server. The server maintains a list of loaded modules.

After starting up all the modules the server will load any available plugin. For more information see: org.jivesoftware.openfire.container.PluginManager.

A configuration file keeps the server configuration. This information is required for the server to work correctly. The server assumes that the configuration file is named openfire.xml and is located in the conf folder. The folder that keeps the configuration file must be located under the home folder. The server will try different methods to locate the home folder.

  1. system property - The server will use the value defined in the openfireHome system property.
  2. working folder - The server will check if there is a conf folder in the working directory. This is the case when running in standalone mode.
  3. openfire_init.xml file - Attempt to load the value from openfire_init.xml which must be in the classpath
    [中]将加载、初始化和启动所有服务器模块的主XMPP服务器。服务器在JVM中是唯一的,可以使用#getInstance()方法获得。
    加载的模块将被初始化,并可通过服务器访问其他模块。这意味着一个模块找到另一个模块的唯一方法是通过服务器。服务器维护已加载模块的列表。
    启动所有模块后,服务器将加载任何可用的插件。有关更多信息,请参阅:org。jivesoftware。明火。容器插件管理器。
    配置文件保存服务器配置。此信息是服务器正常工作所必需的。服务器假定配置文件名为openfire。xml,位于conf文件夹中。保存配置文件的文件夹必须位于主文件夹下。服务器将尝试不同的方法来定位主文件夹。
    1.系统属性-服务器将使用openfireHome系统属性中定义的值。
    1.工作文件夹-服务器将检查工作目录中是否有conf文件夹。在独立模式下运行时就是这种情况。
    1.openfire_init。xml文件-尝试从openfire_init加载值。必须在类路径中的xml

代码示例

代码示例来源:origin: igniterealtime/Openfire

public PrivacyList(String username, String name, boolean isDefault, Element listElement) {
  this.userJID = XMPPServer.getInstance().createJID(username, null, true);
  this.name = name;
  this.isDefault = isDefault;
  // Set the new list items
  updateList(listElement);
}

代码示例来源: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

@Override
public void initialize(XMPPServer server) {
  super.initialize(server);
  messageStrategy = server.getOfflineMessageStrategy();
  routingTable = server.getRoutingTable();
  sessionManager = server.getSessionManager();
  multicastRouter = server.getMulticastRouter();
  userManager = server.getUserManager();
  serverName = server.getServerInfo().getXMPPDomain();
}

代码示例来源:origin: igniterealtime/Openfire

@Override
public void initialize(XMPPServer server) {
  super.initialize(server);
  infoHandler = server.getIQDiscoInfoHandler();
  itemsHandler = server.getIQDiscoItemsHandler();
  messageStore = server.getOfflineMessageStore();
  userManager = server.getUserManager();
  routingTable = server.getRoutingTable();
}

代码示例来源:origin: igniterealtime/Openfire

@Override
  public void initialize(XMPPServer server) {
    super.initialize(server);
    iqRouter = server.getIQRouter();
    messageRouter = server.getMessageRouter();
    presenceRouter = server.getPresenceRouter();
  }
}

代码示例来源: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

@Override
public void run() {
  XMPPServer.getInstance().getMultiUserChatManager().unregisterMultiUserChatService(subdomain);
}

代码示例来源: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
public void initialize(XMPPServer server) {
  super.initialize(server);
  TaskEngine.getInstance().scheduleAtFixedRate(new TimeoutTask(), 5000, 5000);
  serverName = server.getServerInfo().getXMPPDomain();
  routingTable = server.getRoutingTable();
  multicastRouter = server.getMulticastRouter();
  iqHandlers.addAll(server.getIQHandlers());
  sessionManager = server.getSessionManager();
  userManager = server.getUserManager();
}

代码示例来源:origin: igniterealtime/Openfire

@Override
  public void initialize(XMPPServer server) {
    super.initialize(server);
    localServer = server;
    serverName = server.getServerInfo().getXMPPDomain();
    routingTable = server.getRoutingTable();
    deliverer = server.getPacketDeliverer();
    presenceManager = server.getPresenceManager();
    rosterManager = server.getRosterManager();
    userManager = server.getUserManager();
  }
}

代码示例来源:origin: igniterealtime/Openfire

iq.setTo(packet.getFrom());
String serverName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();
iq.setFrom(serverName);
verAttributes.put(packetId, caps);
final IQRouter iqRouter = XMPPServer.getInstance().getIQRouter();
iqRouter.addIQResultListener(packetId, this);
iqRouter.route(iq);

代码示例来源: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

@Override
public void initialize(XMPPServer server) {
  super.initialize(server);
  serverName = server.getServerInfo().getXMPPDomain();
  routingTable = server.getRoutingTable();
  updateHandler = server.getPresenceUpdateHandler();
  subscribeHandler = server.getPresenceSubscribeHandler();
  presenceManager = server.getPresenceManager();
  multicastRouter = server.getMulticastRouter();
  sessionManager = server.getSessionManager();
  entityCapsManager = EntityCapabilitiesManager.getInstance();
}

代码示例来源:origin: igniterealtime/Openfire

@Override
public void execute(SessionData sessionData, Element command) {
  Element note = command.addElement("note");
  Collection<JID> admins = XMPPServer.getInstance().getAdmins();
  if (admins.size() <= 0) {
    note.addAttribute("type", "error");
  String servicename = servicehostname.replace("."+XMPPServer.getInstance().getServerInfo().getXMPPDomain(), "");
  MultiUserChatService mucService;
  mucService = XMPPServer.getInstance().getMultiUserChatManager().getMultiUserChatService(servicename);
  if (mucService == null) {
    note.addAttribute("type", "error");

代码示例来源:origin: igniterealtime/Openfire

@Override
public void initialize(XMPPServer server) {
  super.initialize(server);
  localServer = server;
  rosterManager = server.getRosterManager();
  presenceManager = server.getPresenceManager();
  deliverer = server.getPacketDeliverer();
  messageStore = server.getOfflineMessageStore();
  sessionManager = server.getSessionManager();
  userManager = server.getUserManager();
  routingTable = server.getRoutingTable();
  directedPresencesCache = CacheFactory.createCache(PRESENCE_CACHE_NAME);
  // TODO Add as route listener (to remove direct presences info for removed routes). Mainly for c2s sessions which is uncommon.
  // Listen to cluster events
  ClusterManager.addListener(this);
}

代码示例来源:origin: igniterealtime/Openfire

XMPPServer server = XMPPServer.getInstance();
if (server.isLocal(user)) {
  try {
    getUser(user.getNode());
      iq.setFrom(server.getServerInfo().getXMPPDomain());
      iq.setTo(user.toBareJID());
      iq.setChildElement("query", "http://jabber.org/protocol/disco#info");
      server.getIQRouter().addIQResultListener(iq.getID(), this);
      synchronized ((user.toBareJID() + MUTEX_SUFFIX).intern()) {
        server.getIQRouter().route(iq);

代码示例来源:origin: igniterealtime/Openfire

int clientPortNum = -1;
int componentPortNum = -1;
final ConnectionManager connectionManager = XMPPServer.getInstance().getConnectionManager();
if ( connectionManager != null )
    jmdns = new JmDNS();
  String serverName = XMPPServer.getInstance().getServerInfo().getXMPPDomain();

代码示例来源:origin: igniterealtime/Openfire

@Override
public void initialize(XMPPServer server) {
  super.initialize(server);
  this.server = server;
  offlinePresenceCache = CacheFactory.createCache("Offline Presence Cache");
  lastActivityCache = CacheFactory.createCache("Last Activity Cache");
  deliverer = server.getPacketDeliverer();
  sessionManager = server.getSessionManager();
  userManager = server.getUserManager();
  presenceUpdateHandler = server.getPresenceUpdateHandler();
  rosterManager = server.getRosterManager();
  routingTable = server.getRoutingTable();
}

代码示例来源:origin: igniterealtime/Openfire

@Override
public void initialize(XMPPServer server) {
  super.initialize(server);
  this.server = server;
  serverName = server.getServerInfo().getXMPPDomain();
  iqRouter = server.getIQRouter();
  messageRouter = server.getMessageRouter();
  presenceRouter = server.getPresenceRouter();
  presenceUpdateHandler = server.getPresenceUpdateHandler();
  // Listen to cluster events
  ClusterManager.addListener(this);
}

代码示例来源:origin: igniterealtime/Openfire

@Override
public void query(Component component, IQ packet, IQResultListener listener) throws ComponentException {
  XMPPServer.getInstance().getIQRouter().addIQResultListener(packet.getID(), listener);
  sendPacket(component, packet);
}

相关文章