Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
8652d843
Commit
8652d843
authored
Jun 05, 2014
by
Sven Bunge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract more properties related to connections
parent
706eebc7
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
39 deletions
+62
-39
ClientConnectionHandler.java
...rg/jivesoftware/openfire/nio/ClientConnectionHandler.java
+3
-2
RemoteServerManager.java
...org/jivesoftware/openfire/server/RemoteServerManager.java
+2
-2
ConnectionSettings.java
...org/jivesoftware/openfire/session/ConnectionSettings.java
+19
-1
ConnectionManagerImpl.java
.../org/jivesoftware/openfire/spi/ConnectionManagerImpl.java
+28
-27
client-connections-settings.jsp
src/web/client-connections-settings.jsp
+10
-7
No files found.
src/java/org/jivesoftware/openfire/nio/ClientConnectionHandler.java
View file @
8652d843
...
...
@@ -21,6 +21,7 @@ package org.jivesoftware.openfire.nio;
import
org.apache.mina.common.IdleStatus
;
import
org.apache.mina.common.IoSession
;
import
org.jivesoftware.openfire.session.ConnectionSettings
;
import
org.jivesoftware.util.JiveGlobals
;
import
org.jivesoftware.openfire.Connection
;
import
org.jivesoftware.openfire.XMPPServer
;
...
...
@@ -59,7 +60,7 @@ public class ClientConnectionHandler extends ConnectionHandler {
@Override
int
getMaxIdleTime
()
{
return
JiveGlobals
.
getIntProperty
(
"xmpp.client.idle"
,
6
*
60
*
1000
)
/
1000
;
return
JiveGlobals
.
getIntProperty
(
ConnectionSettings
.
Client
.
IDLE_TIMEOUT
,
6
*
60
*
1000
)
/
1000
;
}
/**
...
...
@@ -86,7 +87,7 @@ public class ClientConnectionHandler extends ConnectionHandler {
public
void
sessionIdle
(
IoSession
session
,
IdleStatus
status
)
throws
Exception
{
super
.
sessionIdle
(
session
,
status
);
final
boolean
doPing
=
JiveGlobals
.
getBooleanProperty
(
"xmpp.client.idle.ping"
,
true
);
final
boolean
doPing
=
JiveGlobals
.
getBooleanProperty
(
ConnectionSettings
.
Client
.
KEEP_ALIVE_PING
,
true
);
if
(
doPing
&&
session
.
getIdleCount
(
status
)
==
1
)
{
final
ClientStanzaHandler
handler
=
(
ClientStanzaHandler
)
session
.
getAttribute
(
HANDLER
);
final
JID
entity
=
handler
.
getAddress
();
...
...
src/java/org/jivesoftware/openfire/server/RemoteServerManager.java
View file @
8652d843
...
...
@@ -299,13 +299,13 @@ public class RemoteServerManager {
* @return the remote port to connect for the specified remote server.
*/
public
static
int
getPortForServer
(
String
domain
)
{
int
port
=
JiveGlobals
.
getIntProperty
(
ConnectionSettings
.
Server
.
PORT
,
ConnectionManager
.
DEFAULT_SERVER_PORT
);
int
port
=
JiveGlobals
.
getIntProperty
(
ConnectionSettings
.
Server
.
REMOTE_SERVER_
PORT
,
ConnectionManager
.
DEFAULT_SERVER_PORT
);
RemoteServerConfiguration
config
=
getConfiguration
(
domain
);
if
(
config
!=
null
)
{
port
=
config
.
getRemotePort
();
if
(
port
==
0
)
{
port
=
JiveGlobals
.
getIntProperty
(
ConnectionSettings
.
Server
.
PORT
,
ConnectionManager
.
DEFAULT_SERVER_PORT
);
.
getIntProperty
(
ConnectionSettings
.
Server
.
REMOTE_SERVER_
PORT
,
ConnectionManager
.
DEFAULT_SERVER_PORT
);
}
}
return
port
;
...
...
src/java/org/jivesoftware/openfire/session/ConnectionSettings.java
View file @
8652d843
...
...
@@ -7,7 +7,15 @@ public final class ConnectionSettings {
public
static
final
class
Client
{
public
static
final
String
SOCKET_ACTIVE
=
"xmpp.socket.plain.active"
;
public
static
final
String
PORT
=
"xmpp.socket.plain.port"
;
public
static
final
String
IDLE_TIMEOUT
=
"xmpp.client.idle"
;
public
static
final
String
KEEP_ALIVE_PING
=
"xmpp.client.idle.ping"
;
public
static
final
String
TLS_POLICY
=
"xmpp.client.tls.policy"
;
public
static
final
String
OLD_SSLPORT
=
"xmpp.socket.ssl.port"
;
public
static
final
String
ENABLE_OLD_SSLPORT
=
"xmpp.socket.ssl.active"
;
public
static
final
String
AUTH_PER_CLIENTCERT_POLICY
=
"xmpp.client.cert.policy"
;
public
static
final
String
COMPRESSION_SETTINGS
=
"xmpp.client.compression.policy"
;
public
static
final
String
LOGIN_ALLOWED
=
"xmpp.client.login.allowed"
;
...
...
@@ -20,7 +28,8 @@ public final class ConnectionSettings {
public
static
final
class
Server
{
public
static
final
String
SOCKET_ACTIVE
=
"xmpp.server.socket.active"
;
public
static
final
String
PORT
=
"xmpp.server.socket.remotePort"
;
public
static
final
String
PORT
=
"xmpp.server.socket.port"
;
public
static
final
String
REMOTE_SERVER_PORT
=
"xmpp.server.socket.remotePort"
;
public
static
final
String
SOCKET_READ_TIMEOUT
=
"xmpp.server.read.timeout"
;
public
static
final
String
QUEUE_MAX_THREADS
=
"xmpp.server.outgoing.max.threads"
;
...
...
@@ -43,10 +52,19 @@ public final class ConnectionSettings {
}
public
static
final
class
Multiplex
{
public
static
final
String
SOCKET_ACTIVE
=
"xmpp.multiplex.socket.active"
;
public
static
final
String
PORT
=
"xmpp.multiplex.socket.port"
;
public
static
final
String
TLS_POLICY
=
"xmpp.multiplex.tls.policy"
;
public
static
final
String
COMPRESSION_SETTINGS
=
"xmpp.multiplex.compression.policy"
;
private
Multiplex
()
{
}
}
public
static
final
class
Component
{
public
static
final
String
SOCKET_ACTIVE
=
"xmpp.component.socket.active"
;
public
static
final
String
PORT
=
"xmpp.component.socket.port"
;
}
}
src/java/org/jivesoftware/openfire/spi/ConnectionManagerImpl.java
View file @
8652d843
This diff is collapsed.
Click to expand it.
src/web/client-connections-settings.jsp
View file @
8652d843
...
...
@@ -31,6 +31,7 @@
<%@ page
import=
"java.util.HashMap"
%>
<%@ page
import=
"java.util.Iterator"
%>
<%@ page
import=
"java.util.Map"
%>
<%@ page
import=
"org.jivesoftware.openfire.session.ConnectionSettings"
%>
<jsp:useBean
id=
"webManager"
class=
"org.jivesoftware.util.WebManager"
/>
<%
webManager
.
init
(
request
,
response
,
session
,
application
,
out
);
%>
...
...
@@ -88,14 +89,16 @@
response
.
sendRedirect
(
"client-connections-settings.jsp?success=true"
);
if
(!
idleDisco
)
{
JiveGlobals
.
setProperty
(
"xmpp.client.idle"
,
"-1"
);
JiveGlobals
.
setProperty
(
ConnectionSettings
.
Client
.
IDLE_TIMEOUT
,
"-1"
);
}
else
{
JiveGlobals
.
setProperty
(
"xmpp.client.idle"
,
String
.
valueOf
(
clientIdle
));
JiveGlobals
.
setProperty
(
ConnectionSettings
.
Client
.
IDLE_TIMEOUT
,
String
.
valueOf
(
clientIdle
));
}
JiveGlobals
.
setProperty
(
"xmpp.client.idle.ping"
,
String
.
valueOf
(
pingIdleClients
));
JiveGlobals
.
setProperty
(
ConnectionSettings
.
Client
.
KEEP_ALIVE_PING
,
String
.
valueOf
(
pingIdleClients
));
// Log the events
webManager
.
logEvent
(
"set server property xmpp.client.idle"
,
"xmpp.client.idle = "
+
clientIdle
);
webManager
.
logEvent
(
"set server property xmpp.client.idle.ping"
,
"xmpp.client.idle.ping = "
+
pingIdleClients
);
webManager
.
logEvent
(
"set server property "
+
ConnectionSettings
.
Client
.
IDLE_TIMEOUT
,
ConnectionSettings
.
Client
.
IDLE_TIMEOUT
+
" = "
+
clientIdle
);
webManager
.
logEvent
(
"set server property "
+
ConnectionSettings
.
Client
.
KEEP_ALIVE_PING
,
ConnectionSettings
.
Client
.
KEEP_ALIVE_PING
+
" = "
+
pingIdleClients
);
return
;
}
...
...
@@ -103,8 +106,8 @@
sslEnabled
=
connectionManager
.
isClientSSLListenerEnabled
();
port
=
connectionManager
.
getClientListenerPort
();
sslPort
=
connectionManager
.
getClientSSLListenerPort
();
clientIdle
=
JiveGlobals
.
getIntProperty
(
"xmpp.client.idle"
,
6
*
60
*
1000
);
pingIdleClients
=
JiveGlobals
.
getBooleanProperty
(
"xmpp.client.idle.ping"
,
true
);
clientIdle
=
JiveGlobals
.
getIntProperty
(
ConnectionSettings
.
Client
.
IDLE_TIMEOUT
,
6
*
60
*
1000
);
pingIdleClients
=
JiveGlobals
.
getBooleanProperty
(
ConnectionSettings
.
Client
.
KEEP_ALIVE_PING
,
true
);
}
%>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment