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
690d43e1
Commit
690d43e1
authored
Nov 28, 2015
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce complexity by removing a wrapper method.
parent
a1c7f9cb
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
28 deletions
+14
-28
ClearspaceManager.java
...g/jivesoftware/openfire/clearspace/ClearspaceManager.java
+5
-3
AdminConsolePlugin.java
...g/jivesoftware/openfire/container/AdminConsolePlugin.java
+1
-1
HttpBindManager.java
src/java/org/jivesoftware/openfire/http/HttpBindManager.java
+1
-1
ClientSessionConnection.java
...esoftware/openfire/multiplex/ClientSessionConnection.java
+1
-1
SocketConnection.java
src/java/org/jivesoftware/openfire/net/SocketConnection.java
+1
-1
LocalConnectionMultiplexerSession.java
...e/openfire/session/LocalConnectionMultiplexerSession.java
+1
-1
ConnectionManagerImpl.java
.../org/jivesoftware/openfire/spi/ConnectionManagerImpl.java
+0
-16
connection-settings-socket-c2s.jsp
src/web/connection-settings-socket-c2s.jsp
+2
-2
connection-settings-socket-s2s.jsp
src/web/connection-settings-socket-s2s.jsp
+2
-2
No files found.
src/java/org/jivesoftware/openfire/clearspace/ClearspaceManager.java
View file @
690d43e1
...
...
@@ -87,6 +87,7 @@ import org.jivesoftware.openfire.muc.spi.MultiUserChatServiceImpl;
import
org.jivesoftware.openfire.net.MXParser
;
import
org.jivesoftware.openfire.session.ComponentSession
;
import
org.jivesoftware.openfire.session.LocalClientSession
;
import
org.jivesoftware.openfire.spi.ConnectionConfiguration
;
import
org.jivesoftware.openfire.spi.ConnectionManagerImpl
;
import
org.jivesoftware.openfire.spi.ConnectionType
;
import
org.jivesoftware.openfire.user.UserNotFoundException
;
...
...
@@ -781,13 +782,14 @@ public class ClearspaceManager extends BasicModule implements ExternalComponentM
private
void
updateClearspaceClientSettings
()
{
String
xmppBoshSslPort
=
"0"
;
String
xmppBoshPort
=
"0"
;
final
ConnectionManagerImpl
connectionManager
=
((
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
());
String
xmppPort
=
String
.
valueOf
(
connectionManager
.
getConfiguration
(
ConnectionType
.
SOCKET_C2S
,
false
).
getPort
()
);
final
ConnectionManagerImpl
connectionManager
=
(
(
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
()
);
final
ConnectionConfiguration
configuration
=
connectionManager
.
getListener
(
ConnectionType
.
SOCKET_C2S
,
false
).
generateConnectionConfiguration
();
String
xmppPort
=
String
.
valueOf
(
configuration
.
getPort
()
);
if
(
JiveGlobals
.
getBooleanProperty
(
HttpBindManager
.
HTTP_BIND_ENABLED
,
HttpBindManager
.
HTTP_BIND_ENABLED_DEFAULT
))
{
int
boshSslPort
=
HttpBindManager
.
getInstance
().
getHttpBindSecurePort
();
int
boshPort
=
HttpBindManager
.
getInstance
().
getHttpBindUnsecurePort
();
try
{
if
(
HttpBindManager
.
getInstance
().
isHttpsBindActive
()
&&
con
nectionManager
.
getConfiguration
(
ConnectionType
.
SOCKET_C2S
,
false
)
.
getTlsPolicy
()
!=
org
.
jivesoftware
.
openfire
.
Connection
.
TLSPolicy
.
disabled
)
{
if
(
HttpBindManager
.
getInstance
().
isHttpsBindActive
()
&&
con
figuration
.
getTlsPolicy
()
!=
org
.
jivesoftware
.
openfire
.
Connection
.
TLSPolicy
.
disabled
)
{
xmppBoshSslPort
=
String
.
valueOf
(
boshSslPort
);
}
}
...
...
src/java/org/jivesoftware/openfire/container/AdminConsolePlugin.java
View file @
690d43e1
...
...
@@ -156,7 +156,7 @@ public class AdminConsolePlugin implements Plugin {
}
final
ConnectionManagerImpl
connectionManager
=
(
(
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
()
);
final
ConnectionConfiguration
configuration
=
connectionManager
.
get
Configuration
(
ConnectionType
.
WEBADMIN
,
true
);
final
ConnectionConfiguration
configuration
=
connectionManager
.
get
Listener
(
ConnectionType
.
WEBADMIN
,
true
).
generateConnectionConfiguration
(
);
final
SslContextFactory
sslContextFactory
=
new
EncryptionArtifactFactory
(
configuration
).
getSslContextFactory
();
final
ServerConnector
httpsConnector
;
...
...
src/java/org/jivesoftware/openfire/http/HttpBindManager.java
View file @
690d43e1
...
...
@@ -258,7 +258,7 @@ public final class HttpBindManager {
}
final
ConnectionManagerImpl
connectionManager
=
((
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
());
final
ConnectionConfiguration
configuration
=
connectionManager
.
get
Configuration
(
ConnectionType
.
BOSH_C2S
,
true
);
final
ConnectionConfiguration
configuration
=
connectionManager
.
get
Listener
(
ConnectionType
.
BOSH_C2S
,
true
).
generateConnectionConfiguration
(
);
final
SslContextFactory
sslContextFactory
=
new
EncryptionArtifactFactory
(
configuration
).
getSslContextFactory
();
final
HttpConfiguration
httpsConfig
=
new
HttpConfiguration
();
...
...
src/java/org/jivesoftware/openfire/multiplex/ClientSessionConnection.java
View file @
690d43e1
...
...
@@ -122,7 +122,7 @@ public class ClientSessionConnection extends VirtualConnection {
// Here, a client-to-server configuration is mocked. It is likely not used, as actual connection handling takes
// place at the connection manager.
final
ConnectionManagerImpl
connectionManager
=
((
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
());
return
connectionManager
.
get
Configuration
(
ConnectionType
.
SOCKET_C2S
,
false
);
return
connectionManager
.
get
Listener
(
ConnectionType
.
SOCKET_C2S
,
true
).
generateConnectionConfiguration
(
);
}
public
byte
[]
getAddress
()
throws
UnknownHostException
{
...
...
src/java/org/jivesoftware/openfire/net/SocketConnection.java
View file @
690d43e1
...
...
@@ -237,7 +237,7 @@ public class SocketConnection implements Connection {
// removed (it is marked as deprecated - at the time of writing, it is only used for S2S). The ugly hack: assume
// S2S:
final
ConnectionManagerImpl
connectionManager
=
((
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
());
return
connectionManager
.
get
Configuration
(
ConnectionType
.
SOCKET_S2S
,
false
);
return
connectionManager
.
get
Listener
(
ConnectionType
.
SOCKET_S2S
,
false
).
generateConnectionConfiguration
(
);
}
public
boolean
validate
()
{
...
...
src/java/org/jivesoftware/openfire/session/LocalConnectionMultiplexerSession.java
View file @
690d43e1
...
...
@@ -266,7 +266,7 @@ public class LocalConnectionMultiplexerSession extends LocalSession implements C
private
void
sendClientOptions
()
{
final
ConnectionManagerImpl
connectionManager
=
((
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
());
final
ConnectionConfiguration
configuration
=
connectionManager
.
get
Configuration
(
ConnectionType
.
SOCKET_C2S
,
false
);
final
ConnectionConfiguration
configuration
=
connectionManager
.
get
Listener
(
ConnectionType
.
SOCKET_C2S
,
false
).
generateConnectionConfiguration
(
);
IQ
options
=
new
IQ
(
IQ
.
Type
.
set
);
Element
child
=
options
.
setChildElement
(
"configuration"
,
...
...
src/java/org/jivesoftware/openfire/spi/ConnectionManagerImpl.java
View file @
690d43e1
...
...
@@ -453,22 +453,6 @@ public class ConnectionManagerImpl extends BasicModule implements ConnectionMana
return
result
;
}
/**
* Returns connection configuration that under the current settings is applicable.
*
* The #startInSslMode parameter is used to distinguish between listeners that expect to receive SSL encrypted data
* immediately, as opposed to connections that initially accept plain text data (the latter are typically subject to
* StartTLS for in-band encryption configuration). When for a particular connection type only one of these options
* is implemented, the parameter value is ignored.
*
* @param type The connection type for which a listener is to be configured.
* @param startInSslMode true when the listener to be configured is in legacy SSL mode, otherwise false.
* @return The applicable connection configuration (never null).
*/
public
ConnectionConfiguration
getConfiguration
(
ConnectionType
type
,
boolean
startInSslMode
)
{
return
getListener
(
type
,
startInSslMode
).
generateConnectionConfiguration
();
}
/**
* Return if the configuration allows this listener to be enabled (but does not verify that the listener is
* indeed active)
...
...
src/web/connection-settings-socket-c2s.jsp
View file @
690d43e1
...
...
@@ -20,8 +20,8 @@
final
ConnectionType
connectionType
=
ConnectionType
.
SOCKET_C2S
;
final
ConnectionManagerImpl
manager
=
(
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
();
final
ConnectionConfiguration
plaintextConfiguration
=
manager
.
get
Configuration
(
connectionType
,
false
);
final
ConnectionConfiguration
legacymodeConfiguration
=
manager
.
get
Configuration
(
connectionType
,
true
);
final
ConnectionConfiguration
plaintextConfiguration
=
manager
.
get
Listener
(
connectionType
,
false
).
generateConnectionConfiguration
(
);
final
ConnectionConfiguration
legacymodeConfiguration
=
manager
.
get
Listener
(
connectionType
,
true
).
generateConnectionConfiguration
(
);
final
boolean
update
=
request
.
getParameter
(
"update"
)
!=
null
;
final
Map
<
String
,
String
>
errors
=
new
HashMap
<
>
();
...
...
src/web/connection-settings-socket-s2s.jsp
View file @
690d43e1
...
...
@@ -21,8 +21,8 @@
final
ConnectionType
connectionType
=
ConnectionType
.
SOCKET_S2S
;
final
ConnectionManagerImpl
manager
=
(
ConnectionManagerImpl
)
XMPPServer
.
getInstance
().
getConnectionManager
();
// final ConnectionConfiguration plaintextConfiguration = manager.get
Configuration( connectionType, false
);
final
ConnectionConfiguration
legacymodeConfiguration
=
manager
.
get
Configuration
(
connectionType
,
true
);
// final ConnectionConfiguration plaintextConfiguration = manager.get
Listener( connectionType, false ).generateConnectionConfiguration(
);
final
ConnectionConfiguration
legacymodeConfiguration
=
manager
.
get
Listener
(
connectionType
,
true
).
generateConnectionConfiguration
(
);
final
boolean
update
=
request
.
getParameter
(
"update"
)
!=
null
;
final
boolean
closeSettings
=
request
.
getParameter
(
"closeSettings"
)
!=
null
;
...
...
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