Package de.xima.fc.fs
Class FSConnectionManager
- java.lang.Object
-
- de.xima.fc.fs.FSConnectionManager
-
public final class FSConnectionManager extends Object
- Author:
- XIMA MEDIA GmbH
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancleanup(FrontendServer fServerEntity)static booleanconnect(FrontendServer fServerEntity)static booleandisconnect(FrontendServer fServerEntity)static BooleandisconnectAll()static <TEvent extends Serializable>
voidfireEvent(TEvent event, Long fsId)Fires an event on the frontend server with the given ID.static FSConnectiongetConnection(long fsConnectionID)static FSConnectiongetConnection(FrontendServer frontendServer)Gets the connection for the given frontend server, if available.static Map<Long,FSConnection>getConnectionsMap()static EConnectionStatusgetStatus(Long frontendserver_id)static booleanisUseSSL(FrontendServer fs)Determines if SSL should be used for the given frontend server.static booleanreconnect(FrontendServer fs)static BooleanstartConnectThread(FrontendServer fs)static BooleanstartConnectThreads()static voidstopConnectThreads()static voidstopReconnect(FrontendServer fs)static booleantestConnection(long fsConnectionID)static booleantestConnection(FrontendServer fs)static BooleantestLookup(FrontendServer fs)Method to test the connection to a frontend-server (lookup only)static booleantriggerRestart(FrontendServer fServerEntity, boolean forceCreateKeystoreIfSSLModeAuto)Triggers a restart of the frontend server associated with the given entity.
-
-
-
Method Detail
-
getConnectionsMap
public static Map<Long,FSConnection> getConnectionsMap()
-
getConnection
public static FSConnection getConnection(long fsConnectionID)
-
getConnection
public static FSConnection getConnection(FrontendServer frontendServer)
Gets the connection for the given frontend server, if available.- Parameters:
frontendServer- The frontend server to get the connection for- Returns:
- The connection for the given frontend server, or null if no connection is available
-
connect
public static boolean connect(FrontendServer fServerEntity)
-
disconnect
public static boolean disconnect(FrontendServer fServerEntity)
-
cleanup
public static boolean cleanup(FrontendServer fServerEntity)
-
disconnectAll
public static Boolean disconnectAll()
-
reconnect
public static boolean reconnect(FrontendServer fs)
-
stopReconnect
public static void stopReconnect(FrontendServer fs)
-
getStatus
public static EConnectionStatus getStatus(Long frontendserver_id)
-
startConnectThread
public static Boolean startConnectThread(FrontendServer fs)
-
startConnectThreads
public static Boolean startConnectThreads()
-
stopConnectThreads
public static void stopConnectThreads()
-
isUseSSL
public static boolean isUseSSL(FrontendServer fs)
Determines if SSL should be used for the given frontend server.- Parameters:
fs- the frontend server to check- Returns:
- true if SSL should be used, false otherwise
-
testLookup
public static Boolean testLookup(FrontendServer fs)
Method to test the connection to a frontend-server (lookup only)- Parameters:
fs- the frontend-server to test the lookup- Returns:
Booleanif the server can be reached
-
testConnection
public static boolean testConnection(FrontendServer fs)
-
testConnection
public static boolean testConnection(long fsConnectionID)
-
fireEvent
public static <TEvent extends Serializable> void fireEvent(TEvent event, Long fsId)
Fires an event on the frontend server with the given ID. If no frontend server ID is provided, the event is fired on all connected frontend servers.- Type Parameters:
TEvent- the type of the event- Parameters:
event- the event to firefsId- the ID of the frontend server. If null, the event is fired on all connected frontend servers.- Throws:
IllegalArgumentException- if the event is null or if the specified frontend server ID does not exist
-
triggerRestart
public static boolean triggerRestart(FrontendServer fServerEntity, boolean forceCreateKeystoreIfSSLModeAuto)
Triggers a restart of the frontend server associated with the given entity.- Parameters:
fServerEntity- the frontend server entity to restartforceCreateKeystoreIfSSLModeAuto- whether to force create a keystore (which includes updating SSL certificate used for connections) if SSL mode is set to auto- Returns:
- true if the restart was triggered successfully, false otherwise
-
-