/** * Retrieves the configured TCP port on which a listener accepts connections. * * @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 a port number. */ public int getPort( ConnectionType type, boolean startInSslMode ) { return getListener( type, startInSslMode ).getPort(); }
/** * Sets the TCP port on which a listener accepts connections. * * @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. * @param port a port number. */ public void setPort( ConnectionType type, boolean startInSslMode, int port ) { getListener( type, startInSslMode ).setPort( port ); }
public NioSocketAcceptor getSocketAcceptor( ConnectionType type, boolean startInSslMode ) { return getListener( type, startInSslMode ).getSocketAcceptor(); }
@Override public ConnectionConfiguration getConfiguration() { // 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.getListener( ConnectionType.SOCKET_C2S, true ).generateConnectionConfiguration(); }
protected String getEncryptionCipherSuitesCommaSeparated() { final String propertyName = type.getPrefix() + "ciphersuites"; final String defaultValue = ""; if ( type.getFallback() == null ) { return JiveGlobals.getProperty( propertyName, defaultValue ); } else { return JiveGlobals.getProperty( propertyName, getConnectionListener( type.getFallback() ).getEncryptionCipherSuitesCommaSeparated() ); } }
private boolean isHttpCompressionEnabled() { final ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager()); final ConnectionConfiguration configuration = connectionManager.getListener( ConnectionType.BOSH_C2S, true ).generateConnectionConfiguration(); return configuration.getCompressionPolicy() == null || configuration.getCompressionPolicy().equals( Connection.CompressionPolicy.optional ); }
/** * Return if the configuration allows this listener to be enabled (but does not verify that the listener is * indeed active) * * 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 true if configuration allows this listener to be enabled, otherwise false. */ public boolean isEnabled( ConnectionType type, boolean startInSslMode ) { return getListener( type, startInSslMode ).isEnabled(); }
/** * Enables or disables a connection listener. Does nothing if the particular listener is already in the requested * state. * * 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. * @param enabled true if the listener is to be enabled, otherwise false. */ public void enable( ConnectionType type, boolean startInSslMode, boolean enabled ) { getListener( type, startInSslMode ).enable( enabled ); }
@Override public void propertySet( String property, Map<String, Object> params ) { processPropertyValueChange( property, params ); }
@Override public int compare(ClientSession o1, ClientSession o2) { int thisVal = getShowValue(o1); int anotherVal = getShowValue(o2); return (thisVal<anotherVal ? -1 : (thisVal==anotherVal ? 0 : 1)); }
@Override public StreamID createStreamID() { return factory.createStreamID(); } }
@Override public boolean isLocalRoute(JID jid) { return localRoutingTable.isLocalRoute(jid); }
public synchronized int getPort() { return configuration.getPort(); }
public static StreamID createStreamID(String name) { return new BasicStreamID(name); }
@Override public ConnectionConfiguration getConfiguration() { if (configuration == null) { final ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager()); configuration = connectionManager.getListener( connectionType, true ).generateConnectionConfiguration(); } return configuration; }
@Override public void propertyDeleted( String property, Map<String, Object> params ) { processPropertyValueChange( property, params ); }
@Override public ConnectionConfiguration getConfiguration() { // This is an ugly hack to get backwards compatibility with the pre-MINA era. As this implementation is being // 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.getListener( ConnectionType.SOCKET_S2S, false ).generateConnectionConfiguration(); }
@Override public void xmlPropertySet( String property, Map<String, Object> params ) { processPropertyValueChange( property, params ); }
@Override public ConnectionConfiguration getConfiguration() { if (configuration == null) { final ConnectionManagerImpl connectionManager = ((ConnectionManagerImpl) XMPPServer.getInstance().getConnectionManager()); configuration = connectionManager.getListener( connectionType, true ).generateConnectionConfiguration(); } return configuration; }
@Override public void xmlPropertyDeleted( String property, Map<String, Object> params ) { processPropertyValueChange( property, params ); }