Interface Server<S extends Server<S>>

Type Parameters:
S - the type of a Server
All Superinterfaces:
ApplicationManager<Application<?,?>>, AutoCloseable, Clearable, Closeable, EmptinessRequestable, GroupCloseable, OpennessRequestable, SecurityModeHolder
All Known Implementing Classes:
AbstractServer, LocalServer, Server, SslServer

public interface Server<S extends Server<S>> extends ApplicationManager<Application<?,?>>, Clearable, GroupCloseable, SecurityModeHolder
Author:
Silvan Wyss
  • Method Details

    • addApplication

      <C extends BackendClient<C,T>, T> S addApplication(Application<C,T> application)
      Adds the given application to the current Server.
      Type Parameters:
      C - the type of the BackendClients of the given application
      T - the type of the application service of the given application
      Parameters:
      application -
      Returns:
      the current Server
      Throws:
      RuntimeException - if the given application is null
      RuntimeException - if the current Server contains already a Application with the same name or URL name as the given application
    • addDefaultApplication

      <C extends BackendClient<C,T>, T> S addDefaultApplication(Application<C,T> defaultApplication)
      Adds the given defaultApplication to the current Server.
      Type Parameters:
      C - the type of the BackendClients of the given defaultApplication
      T - the type of the application service of the given defaultApplication
      Parameters:
      defaultApplication -
      Returns:
      the current Server
      Throws:
      RuntimeException - if the given defaultApplication is null
      RuntimeException - if the current Server contains already a Application with the same name or URL name as the given defaultApplication
    • containsApplicationWithName

      boolean containsApplicationWithName(String name)
      Parameters:
      name -
      Returns:
      true if the current Server contains a Application with the given name, false otherwise
    • containsDefaultApplication

      boolean containsDefaultApplication()
      Returns:
      true if the current Server contains a default Application, false otherwise
    • getStoredApplicationByName

      Application<?,?> getStoredApplicationByName(String name)
      Parameters:
      name -
      Returns:
      the Application with the given name from the current Server
      Throws:
      RuntimeException - if the current Server does not contain a Application with the given name.
    • getStoredApplicationByUrlName

      Application<?,?> getStoredApplicationByUrlName(String urlName)
      Parameters:
      urlName -
      Returns:
      the Application with the given urlName from the current Server
      Throws:
      RuntimeException - if the current Server does not contain a Application with the given urlName.
    • getStoredDefaultApplication

      Application<?,?> getStoredDefaultApplication()
      Returns:
      the default Application of the current Server
      Throws:
      RuntimeException - if the current Server does not contain a default Application.
    • hasClientConnected

      boolean hasClientConnected()
      Returns:
      true if the current Server has a Client connected, false otherwise
    • removeApplicationByName

      void removeApplicationByName(String name)
      Removes the Application with the given name from the current Server.
      Parameters:
      name -
      Throws:
      RuntimeException - if the current Server does not contain a Application with the given instanceName
    • toTarget

      IServerTarget toTarget()
      Returns:
      a IServerTarget representation of the current Server