Package org.jivesoftware.openfire.server
Class RemoteServerManager
java.lang.Object
org.jivesoftware.openfire.server.RemoteServerManager
Manages the connection permissions for remote servers. When a remote server is allowed to
connect to this server then a special configuration for the remote server will be kept.
The configuration holds information such as the port to use when creating an outgoing connection.
- Author:
- Gaston Dombiak
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SystemProperty<Boolean>
Defines if the permission setting for server-to-server connection applies recursively for subdomains. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
allowAccess
(RemoteServerConfiguration configuration) Allows a remote server to connect to the local server with the specified configuration.static void
blockAccess
(String domain) Blocks a remote server from connecting to the local server.static boolean
Returns true if the remote server with the specified domain can connect to the local server.static void
deleteConfiguration
(String domain) Removes any existing defined permission and configuration for the specified remote server.static Collection<RemoteServerConfiguration>
Returns the list of registered remote servers that are allowed to connect to/from this server when using a whitelist policy.static Collection<RemoteServerConfiguration>
Returns the list of remote servers that are NOT allowed to connect to/from this server.static RemoteServerConfiguration
getConfiguration
(String domain) Returns the configuration for a remote server ornull
if none was found.Returns the permission policy being used for new XMPP entities that are trying to connect to the server.static int
getPortForServer
(String domain) Returns the remote port to connect for the specified remote server.static int
Returns the number of milliseconds to wait to connect to a remote server or read data from a remote server.static void
setPermissionPolicy
(String policy) Sets the permission policy being used for new XMPP entities that are trying to connect to the server.static void
Sets the permission policy being used for new XMPP entities that are trying to connect to the server.
-
Field Details
-
RECURSE
Defines if the permission setting for server-to-server connection applies recursively for subdomains.
-
-
Constructor Details
-
RemoteServerManager
public RemoteServerManager()
-
-
Method Details
-
allowAccess
Allows a remote server to connect to the local server with the specified configuration.- Parameters:
configuration
- the configuration for the remote server.
-
blockAccess
Blocks a remote server from connecting to the local server. If the remote server was connected when the permission was revoked then the connection of the entity will be closed.- Parameters:
domain
- the domain of the remote server that is not allowed to connect.
-
canAccess
Returns true if the remote server with the specified domain can connect to the local server.- Parameters:
domain
- the domain of the remote server.- Returns:
- true if the remote server with the specified domain can connect to the local server.
-
getAllowedServers
Returns the list of registered remote servers that are allowed to connect to/from this server when using a whitelist policy. However, when using a blacklist policy (i.e. anyone may connect to the server) the returned list of configurations will be used for obtaining the specific connection configuration for each remote server.- Returns:
- the configuration of the registered external components.
-
getBlockedServers
Returns the list of remote servers that are NOT allowed to connect to/from this server.- Returns:
- the configuration of the blocked external components.
-
getSocketTimeout
public static int getSocketTimeout()Returns the number of milliseconds to wait to connect to a remote server or read data from a remote server. Default timeout value is 120 seconds. Configure thexmpp.server.read.timeout
global property to override the default value.- Returns:
- the number of milliseconds to wait to connect to a remote server or read data from a remote server.
-
deleteConfiguration
Removes any existing defined permission and configuration for the specified remote server.- Parameters:
domain
- the domain of the remote server.
-
getConfiguration
Returns the configuration for a remote server ornull
if none was found.- Parameters:
domain
- the domain of the remote server.- Returns:
- the configuration for a remote server or
null
if none was found.
-
getPortForServer
Returns the remote port to connect for the specified remote server. If no port was defined then use the default port (e.g. 5269).- Parameters:
domain
- the domain of the remote server to get the remote port to connect to.- Returns:
- the remote port to connect for the specified remote server.
-
getPermissionPolicy
Returns the permission policy being used for new XMPP entities that are trying to connect to the server. There are two types of policies: 1) blacklist: where any entity is allowed to connect to the server except for those listed in the black list and 2) whitelist: where only the entities listed in the white list are allowed to connect to the server.- Returns:
- the permission policy being used for new XMPP entities that are trying to connect to the server.
-
setPermissionPolicy
Sets the permission policy being used for new XMPP entities that are trying to connect to the server. There are two types of policies: 1) blacklist: where any entity is allowed to connect to the server except for those listed in the black list and 2) whitelist: where only the entities listed in the white list are allowed to connect to the server.- Parameters:
policy
- the new PermissionPolicy to use.
-
setPermissionPolicy
Sets the permission policy being used for new XMPP entities that are trying to connect to the server. There are two types of policies: 1) blacklist: where any entity is allowed to connect to the server except for those listed in the black list and 2) whitelist: where only the entities listed in the white list are allowed to connect to the server.- Parameters:
policy
- the new policy to use.
-