Class ClientDao


  • public class ClientDao
    extends AbstractDao
    Provides a DAO for the Client entity.
    See Also:
    Client
    • Constructor Detail

      • ClientDao

        public ClientDao()
    • Method Detail

      • getClientForPK

        public Client getClientForPK​(Object id)
        Return the client with the specified OID
        Parameters:
        id - the OID
        Returns:
        the matching client, or null if not found
      • getTmMonitorClientId

        public Long getTmMonitorClientId()
        Return TM Monitor Client ID or null if not defined
        Returns:
        TM Monitor Client ID or null if not defined
        Since:
        5.1.5
      • getClientByName

        public Client getClientByName​(String clientName)
        Return the client with the specified name
        Parameters:
        clientName - the client name
        Returns:
        the matching client, or null if not found
      • getClientByCode

        public Client getClientByCode​(String clientCode)
        Return the client with the specified client code
        Parameters:
        clientCode - the client code
        Returns:
        the matching client, or null if not found
      • getClientByCodeRefresh

        public Client getClientByCodeRefresh​(String clientCode)
        Return the client with the specified client code. The query will not use caching to ensure that the result is accurate.
        Parameters:
        clientCode - the client code
        Returns:
        the matching client, or null if not found
      • getClientByNormalizedCode

        public Client getClientByNormalizedCode​(String clientCodeNormalized)
        Return the client with the specified normalized client code
        Parameters:
        clientCodeNormalized - the normalized client code
        Returns:
        the matching client, or null if not found
      • getClientsByPaymentGatewayType

        public List<Client> getClientsByPaymentGatewayType​(ServiceDefinition paymentService)
        Return the list of clients with the specified payment service.
        Parameters:
        paymentService - the payment gateway service definition (required)
        Returns:
        the list of clients with the specified payment service
        Since:
        4.0.0
      • getClientByKey

        public Client getClientByKey​(String clientKey)
        Return the client with the specified surrogate key
        Parameters:
        clientKey - the surrogate key
        Returns:
        the matching client, or null if not found
      • getClientList

        public List<Client> getClientList​(String keyword,
                                          boolean activeOnly)
        Return the list of clients matching a set of search criteria
        Parameters:
        keyword - a search keyword
        activeOnly - whether to return only active clients (if not set, clients won't be filtered by status)
        Returns:
        the list of matching clients
      • getClientsWithoutKeys

        public List<Client> getClientsWithoutKeys()
        Return all clients for which no surrogate key is set
        Returns:
        the list of matching clients
      • getActiveClientList

        public List<Client> getActiveClientList()
        Return the list of all active clients, sorted by client name
        Returns:
        the list of active clients
      • getAllClients

        public List<Client> getAllClients()
        Return all clients, sorted by client name
        Returns:
        the list of clients
      • getClientsSearch

        public List<Client> getClientsSearch​(String value)
        Return the list of client whose name, code or description contain the search string, or whose OID matches the search string if it is numeric
        Parameters:
        value - the non-empty search string
        Returns:
        the list of matching clients
      • getClientPropertyValue

        public String getClientPropertyValue​(Client client,
                                             String name)
        Returns the client property value providing the client and property name.
        Parameters:
        client - the client
        name - the property name
        Returns:
        the client property value
      • getNonPurgePolicyList

        public List<Long> getNonPurgePolicyList​(String dateField)
        Gets the client ids for clients that haven't defined purge policy.
        Parameters:
        dateField - the "dateField" parameter for the named query
        Returns:
        the non purge policy list
      • isKeystoreRolloverRequired

        public boolean isKeystoreRolloverRequired​(Client client)
        Return true if the client's key store requires rollover.
        Parameters:
        client - the client organization
        Returns:
        true if the client's key store requires rollover.