Class AbstractServer<S extends AbstractServer<S>>
java.lang.Object
ch.nolix.base.net.clientserver.AbstractServer<S>
- Type Parameters:
S- the type of aAbstractServer.
- All Implemented Interfaces:
Clearable, EmptinessRequestable, Server<S>, SecurityModeHolder, ApplicationManager<Application<?,?>>, Closeable, GroupCloseable, OpennessRequestable, AutoCloseable
- Direct Known Subclasses:
LocalServer, Server, SslServer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal <C extends BackendClient<C,T>, T>
SaddApplication(Application<C, T> application) Adds the given application to the currentServer.final <T extends AbstractSession<C,U>, C extends AbstractBackendClient<C, U>, U>
SaddApplicationWithNameAndInitialSessionClassAndContext(String applicationName, Class<T> initialSessionClass, U applicationService) Adds a newAbstractApplicationwith the given instanceName, initialSessionClass and applicationService to the currentAbstractServer.final <T extends AbstractSession<C,Object>, C extends AbstractBackendClient<C, Object>>
SaddApplicationWithNameAndInitialSessionClassAndVoidContext(String name, Class<T> initialSessionClass) Adds a newAbstractApplicationwith the given name, initialSessionClass and a void context to the currentAbstractServer.<C extends BackendClient<C,T>, T>
SaddDefaultApplication(Application<C, T> defaultApplication) Adds the given defaultApplication to the currentServer.final <T extends AbstractSession<C,U>, C extends AbstractBackendClient<C, U>, U>
SaddDefaultApplicationWithNameAndInitialSessionClassAndContext(String name, Class<T> initialSessionClass, U applicationService) Adds a new defaultAbstractApplicationwith the given name, initialSessionClass and applicationService to the currentAbstractServer.final <T extends AbstractSession<C,Object>, C extends AbstractBackendClient<C, Object>>
SaddDefaultApplicationWithNameAndInitialSessionClassAndVoidContext(String name, Class<T> initialSessionClass) Adds a newAbstractApplicationwith the given name, initialSessionClass and a void context as defaultAbstractApplicationthe currentAbstractServer.final voidclear()Removes the elements of the currentClearable.final booleanfinal booleanfinal Application<?, ?> final Application<?, ?> getStoredApplicationByUrlName(String urlName) final ExtendedIterable<? extends Application<?, ?>> final ICloseControllerfinal AbstractApplication<?, ?> final booleanfinal booleanisEmpty()final voidLets the currentGroupCloseablenote a close.final voidRemoves theApplicationwith the given name from the currentServer.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EmptinessRequestable
containsAnyMethods inherited from interface GroupCloseable
close, createCloseDependencyTo, isClosedMethods inherited from interface OpennessRequestable
isOpenMethods inherited from interface SecurityModeHolder
getSecurityMode
-
Constructor Details
-
AbstractServer
public AbstractServer()
-
-
Method Details
-
addApplication
Adds the given application to the currentServer.- Specified by:
addApplicationin interfaceServer<S extends AbstractServer<S>>- Type Parameters:
C- the type of theBackendClients of the given applicationT- the type of the application service of the given application- Parameters:
application-- Returns:
- the current
Server
-
addApplicationWithNameAndInitialSessionClassAndContext
public final <T extends AbstractSession<C,U>, C extends AbstractBackendClient<C, S addApplicationWithNameAndInitialSessionClassAndContextU>, U> (String applicationName, Class<T> initialSessionClass, U applicationService) Adds a newAbstractApplicationwith the given instanceName, initialSessionClass and applicationService to the currentAbstractServer.- Type Parameters:
T- the type of the given initialSessionClassC- the type of theAbstractBackendClientof the given initialSessionClassU- the type of the given applicationService- Parameters:
applicationName-initialSessionClass-applicationService-- Returns:
- the current
AbstractServer - Throws:
RuntimeException- if the given instanceName is nullRuntimeException- if the given instanceName is blankRuntimeException- if the currentAbstractServercontains already aAbstractApplicationwith the given instanceNameRuntimeException- if the given initialSessionClass is null
-
addApplicationWithNameAndInitialSessionClassAndVoidContext
public final <T extends AbstractSession<C,Object>, C extends AbstractBackendClient<C, S addApplicationWithNameAndInitialSessionClassAndVoidContextObject>> (String name, Class<T> initialSessionClass) Adds a newAbstractApplicationwith the given name, initialSessionClass and a void context to the currentAbstractServer.- Type Parameters:
T- the type of the given initialSessionClassC- the type of theAbstractBackendClientof the given initialSessionClass- Parameters:
name-initialSessionClass-- Returns:
- the current
AbstractServer - Throws:
RuntimeException- if the given name is nullRuntimeException- if the given name is blankRuntimeException- if the currentAbstractServercontains already aAbstractApplicationwith an instanceName that equals the given nameRuntimeException- if the given initialSessionClass is null
-
addDefaultApplication
public <C extends BackendClient<C,T>, T> S addDefaultApplication(Application<C, T> defaultApplication) Adds the given defaultApplication to the currentServer.- Specified by:
addDefaultApplicationin interfaceServer<S extends AbstractServer<S>>- Type Parameters:
C- the type of theBackendClients of the given defaultApplicationT- the type of the application service of the given defaultApplication- Parameters:
defaultApplication-- Returns:
- the current
Server
-
addDefaultApplicationWithNameAndInitialSessionClassAndContext
public final <T extends AbstractSession<C,U>, C extends AbstractBackendClient<C, S addDefaultApplicationWithNameAndInitialSessionClassAndContextU>, U> (String name, Class<T> initialSessionClass, U applicationService) Adds a new defaultAbstractApplicationwith the given name, initialSessionClass and applicationService to the currentAbstractServer.- Type Parameters:
T- the type of the given initialSessionClassC- the type of theAbstractBackendClientof the given initialSessionClassU- the type of the given applicationService- Parameters:
name-initialSessionClass-applicationService-- Returns:
- the current
AbstractServer - Throws:
RuntimeException- if the given instanceName is nullRuntimeException- if the given instanceName is blankRuntimeException- if the currentAbstractServercontains already a defaultAbstractApplicationRuntimeException- if the currentAbstractServercontains already aAbstractApplicationwith the given instanceNameRuntimeException- if the given initialSessionClass is null
-
addDefaultApplicationWithNameAndInitialSessionClassAndVoidContext
public final <T extends AbstractSession<C,Object>, C extends AbstractBackendClient<C, S addDefaultApplicationWithNameAndInitialSessionClassAndVoidContextObject>> (String name, Class<T> initialSessionClass) Adds a newAbstractApplicationwith the given name, initialSessionClass and a void context as defaultAbstractApplicationthe currentAbstractServer.- Type Parameters:
T- the type of the given initialSessionClassC- the type of theAbstractBackendClientof the given initialSessionClass- Parameters:
name-initialSessionClass-- Returns:
- the current
AbstractServer - Throws:
RuntimeException- if the given name is nullRuntimeException- if the given name is blankRuntimeException- if the currentAbstractServercontains already aAbstractApplicationwith an instanceName that equals the given nameRuntimeException- if the given initialSessionClass is null
-
clear
-
containsApplicationWithName
- Specified by:
containsApplicationWithNamein interfaceServer<S extends AbstractServer<S>>- Parameters:
name-- Returns:
- true if the current
Servercontains aApplicationwith the given name, false otherwise
-
containsDefaultApplication
public final boolean containsDefaultApplication()- Specified by:
containsDefaultApplicationin interfaceServer<S extends AbstractServer<S>>- Returns:
- true if the current
Servercontains a defaultApplication, false otherwise
-
getStoredApplicationByName
- Specified by:
getStoredApplicationByNamein interfaceServer<S extends AbstractServer<S>>- Parameters:
name-- Returns:
- the
Applicationwith the given name from the currentServer
-
getStoredApplicationByUrlName
- Specified by:
getStoredApplicationByUrlNamein interfaceServer<S extends AbstractServer<S>>- Parameters:
urlName-- Returns:
- the
Applicationwith the given urlName from the currentServer
-
getStoredApplications
- Specified by:
getStoredApplicationsin interfaceApplicationManager<S extends AbstractServer<S>>- Returns:
- the applications of the current
ApplicationManager
-
getStoredCloseController
- Specified by:
getStoredCloseControllerin interfaceGroupCloseable- Returns:
- the
ICloseControllerof the currentGroupCloseable.
-
getStoredDefaultApplication
- Specified by:
getStoredDefaultApplicationin interfaceServer<S extends AbstractServer<S>>- Returns:
- the default
Applicationof the currentServer
-
isEmpty
public final boolean isEmpty()- Specified by:
isEmptyin interfaceEmptinessRequestable- Returns:
- true if
EmptinessRequestabledoes not contain an element, false otherwise
-
hasClientConnected
public final boolean hasClientConnected()- Specified by:
hasClientConnectedin interfaceServer<S extends AbstractServer<S>>- Returns:
- true if the current
Serverhas aClientconnected, false otherwise
-
noteClose
public final void noteClose()Lets the currentGroupCloseablenote a close.- Specified by:
noteClosein interfaceGroupCloseable
-
removeApplicationByName
Removes theApplicationwith the given name from the currentServer.- Specified by:
removeApplicationByNamein interfaceServer<S extends AbstractServer<S>>- Parameters:
name-
-