Class AdminClientsBean

java.lang.Object
io.goobi.viewer.managedbeans.AdminClientsBean
All Implemented Interfaces:
Serializable

@Named @SessionScoped public class AdminClientsBean extends Object implements Serializable
Backing bean for pages adminClientEdit.xhtml and adminClients.xhtml.
Author:
Florian Alpers
See Also:
  • Field Details

    • DEFAULT_TABLE_FILTER

      public static final String DEFAULT_TABLE_FILTER
      Default table filter key covering name, IP address, and client identifier columns.
      See Also:
  • Constructor Details

    • AdminClientsBean

      public AdminClientsBean()
      Creates a new AdminClientsBean instance.
  • Method Details

    • getConfiguredClientsModel

      public TableDataProvider<ClientApplication> getConfiguredClientsModel()
      Gets the model used for paginated listing configured clients.
      Returns:
      the TableDataProvider used for paginated listing of configured client applications
    • setSelectedClientId

      public void setSelectedClientId(Long id) throws DAOException
      Set the client currently being edited by its database id.
      Parameters:
      id - database id. If null or not matching an existing client, the selected client will be null
      Throws:
      DAOException
    • getSelectedClientId

      public Long getSelectedClientId()
      Gets the id of the client currently being edited.
      Returns:
      client database id or null if no client is selected
    • setSelectedClient

      public void setSelectedClient(ClientApplication selectedClient)
      Sets the currently edited client.
      Parameters:
      selectedClient - the client application currently being edited in the admin interface
    • getSelectedClient

      public ClientApplication getSelectedClient()
      Gets the currently edited client.
      Returns:
      the ClientApplication currently being edited, or null if none selected
    • accept

      public void accept(ClientApplication client)
      'Accept' a registered client by setting its ClientApplication.getAccessStatus() to ClientApplication.AccessStatus.GRANTED.
      Parameters:
      client - client application to grant access to
    • reject

      public String reject(ClientApplication client)
      Reject a registered client by calling delete(ClientApplication) on it.
      Parameters:
      client - client application to reject and delete
      Returns:
      pretty url of admin/clients overview page
    • save

      public void save(ClientApplication client)
      Saves the given client to database.
      Parameters:
      client - client application to persist
    • delete

      public String delete(ClientApplication client)
      Deletes given client from database.
      Parameters:
      client - client application to remove from the database
      Returns:
      Navigation outcome
    • getNotConfiguredClients

      public List<ClientApplication> getNotConfiguredClients() throws DAOException
      Get a list of all clients with ClientApplication.AccessStatus.REQUESTED.
      Returns:
      List of clients that are not configured
      Throws:
      DAOException
    • getAllAcceptedClients

      public List<ClientApplication> getAllAcceptedClients() throws DAOException
      Get a list of all clients with ClientApplication.AccessStatus.GRANTED.
      Returns:
      List of clients that have been granted
      Throws:
      DAOException
    • getAllConfiguredClients

      public List<ClientApplication> getAllConfiguredClients() throws DAOException
      Returns:
      List of clients that have been either granted or denied
      Throws:
      DAOException
    • getAllClients

      public ClientApplication getAllClients() throws DAOException
      Gets the internally created client representing all clients for access rights purposes.
      Returns:
      the ClientApplication representing all clients in access rights configuration
      Throws:
      DAOException
    • isClientLoggedIn

      public boolean isClientLoggedIn()
      Check if the current session is with a client application, i.e. if client requests contain the client-application-id header
      Returns:
      true if session belongs to a client application
    • isLoggedInClientAccessGranted

      public boolean isLoggedInClientAccessGranted()
      Checks if a client application is logged in that is applicable for access privileges.
      Returns:
      true if the session contains a clientApplication with the accessStatus ClientApplication.AccessStatus.GRANTED and if the request ip matches the client's subnet mask
    • isLoggedInClientFromAllowedIP

      public boolean isLoggedInClientFromAllowedIP()