Package io.goobi.viewer.managedbeans
Class AdminClientsBean
java.lang.Object
io.goobi.viewer.managedbeans.AdminClientsBean
- All Implemented Interfaces:
Serializable
Backing bean for pages adminClientEdit.xhtml and adminClients.xhtml.
- Author:
- Florian Alpers
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault table filter key covering name, IP address, and client identifier columns. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ClientApplication client) 'Accept' a registered client by setting itsClientApplication.getAccessStatus()toClientApplication.AccessStatus.GRANTED.delete(ClientApplication client) Deletes given client from database.Get a list of all clients withClientApplication.AccessStatus.GRANTED.Gets the internally created client representing all clients for access rights purposes.Get a list of all clients withClientApplication.AccessStatus.GRANTEDprClientApplication.AccessStatus.DENIED.Gets the model used for paginated listing configured clients.Get a list of all clients withClientApplication.AccessStatus.REQUESTED.Gets the currently edited client.Gets the id of the client currently being edited.booleanCheck if the current session is with a client application, i.e. if client requests contain the client-application-id headerbooleanChecks if a client application is logged in that is applicable for access privileges.booleanreject(ClientApplication client) Reject a registered client by callingdelete(ClientApplication)on it.voidsave(ClientApplication client) Saves the given client to database.voidsetSelectedClient(ClientApplication selectedClient) Sets the currently edited client.voidSet the client currently being edited by its database id.
-
Field Details
-
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
Gets the model used for paginated listing configured clients.- Returns:
- the
TableDataProviderused for paginated listing of configured client applications
-
setSelectedClientId
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
Gets the id of the client currently being edited.- Returns:
- client database id or null if no client is selected
-
setSelectedClient
Sets the currently edited client.- Parameters:
selectedClient- the client application currently being edited in the admin interface
-
getSelectedClient
Gets the currently edited client.- Returns:
- the
ClientApplicationcurrently being edited, or null if none selected
-
accept
'Accept' a registered client by setting itsClientApplication.getAccessStatus()toClientApplication.AccessStatus.GRANTED.- Parameters:
client- client application to grant access to
-
reject
Reject a registered client by callingdelete(ClientApplication)on it.- Parameters:
client- client application to reject and delete- Returns:
- pretty url of admin/clients overview page
-
save
Saves the given client to database.- Parameters:
client- client application to persist
-
delete
Deletes given client from database.- Parameters:
client- client application to remove from the database- Returns:
- Navigation outcome
-
getNotConfiguredClients
Get a list of all clients withClientApplication.AccessStatus.REQUESTED.- Returns:
- List of clients that are not configured
- Throws:
DAOException
-
getAllAcceptedClients
Get a list of all clients withClientApplication.AccessStatus.GRANTED.- Returns:
- List of clients that have been granted
- Throws:
DAOException
-
getAllConfiguredClients
Get a list of all clients withClientApplication.AccessStatus.GRANTEDprClientApplication.AccessStatus.DENIED.- Returns:
- List of clients that have been either granted or denied
- Throws:
DAOException
-
getAllClients
Gets the internally created client representing all clients for access rights purposes.- Returns:
- the
ClientApplicationrepresenting 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.GRANTEDand if the request ip matches the client's subnet mask
-
isLoggedInClientFromAllowedIP
public boolean isLoggedInClientFromAllowedIP()
-