1 /*
2  * Copyright (C) 2004-2008 Jive Software. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package org.jivesoftware.openfire;
18 
19 import org.jivesoftware.util.SystemProperty;
20 import org.jivesoftware.util.Version;
21 
22 import java.util.Date;
23 
24 /**
25  * Information 'snapshot' of a server's state. Useful for statistics
26  * gathering and administration display.
27  *
28  * @author Iain Shigeoka
29  */
30 public interface XMPPServerInfo {
31 
32     SystemProperty<String> XMPP_DOMAIN = SystemProperty.Builder.ofType(String.class)
33         .setKey("xmpp.domain")
34         .setDynamic(false)
35         .build();
36 
37     /**
38      * Obtain the server's version information. Typically used for iq:version
39      * and logging information.
40      *
41      * @return the version of the server.
42      */
getVersion()43     Version getVersion();
44 
45     /**
46      * Obtain the fully qualified domain name (hostname or IP address) of this server node.
47      *
48      * @return the server's host name.
49      */
getHostname()50     String getHostname();
51 
52     /**
53      * Sets the fully qualified domain name of this server node. Preferrably, this is a network name, but can be an
54      * IP address.
55      *
56      * Note that some SASL implementations depend on the client sending the same FQDN value as the one that is
57      * configured in the server.
58      *
59      * When setting a new host name, the server note must be restarted.
60      *
61      * @param fqdn The hostname. When null or empty, a system default will be used instead.
62      */
setHostname( String fqdn )63     void setHostname( String fqdn );
64 
65     /**
66      * Obtain the server XMPP domain name, which is equal for all server nodes in an Openfire cluster.
67      *
68      * @return the name of the XMPP domain that this server is part of.
69      */
getXMPPDomain()70     String getXMPPDomain();
71 
72     /**
73      * Obtain the date when the server was last started.
74      *
75      * @return the date the server was started or null if server has not been started.
76      */
getLastStarted()77     Date getLastStarted();
78 }
79