Class ServiceConnectionDao

    • Constructor Detail

      • ServiceConnectionDao

        public ServiceConnectionDao()
    • Method Detail

      • getServiceConnectionForPK

        public ServiceConnection getServiceConnectionForPK​(Object id)
        Return the service connection with the specified OID
        Parameters:
        id - the OID
        Returns:
        the matching service connection, or null if not found
      • getServiceConnection

        public ServiceConnection getServiceConnection​(Client client,
                                                      String name)
        Return the service connection for the given service name and client (or the global service connection if client is null).
        Parameters:
        client - the client (optional; if not set, only global service definitions will be considered)
        name - the non-null service name
        Returns:
        the global/client service connection for the given name
        Since:
        5.0.0
      • getServiceConnectionWithFallback

        public ServiceConnection getServiceConnectionWithFallback​(Client client,
                                                                  String name)
        Return the service connection for the given service name and client (or the global service connection if clientId is null).
        Parameters:
        client - theclient (optional; if not set, only global service definitions will be considered)
        name - the service connection name (required)
        Returns:
        the global/client service connection for the given name
        Since:
        5.0.0
      • getServiceConnectionList

        public List<ServiceConnection> getServiceConnectionList()
        Return the list of all service connections, ordered by name and client
        Returns:
        the list of service connections
      • hasServiceConnection

        public boolean hasServiceConnection​(Client client,
                                            String name)
        Return whether there is a service connection for the given service name
        Parameters:
        client - the client (optional; if not set, only global service connections will be considered)
        name - the non-null service connection name
        Returns:
        true if there is a service connection with the given name
        Since:
        5.0.0
      • canCreateServiceConnection

        public boolean canCreateServiceConnection​(Client targetClient,
                                                  String name)
        Check whether a service connection with the specified client and name can be created without conflict. Conflicts occur when a service connection with the same name already exists on the global level (if targetClient was specified) or for any client (if targetClient was null) If this method returns false, this means that the specified name/client combination is not valid and cannot be used for a service connection. NOTE: This method does not check if a service connection with the specified name and client already exists. It only checks is such a service connection is theoretically possible.
        Parameters:
        targetClient - the client with which the new service connection will be associated (optional; leave it null to denote a global service connection)
        name - the desired service connection name (required)
        Returns:
        true if such a service connection can be created, false if a conflict was found
        Since:
        5.0.0
      • getServiceConnectionList

        public List<ServiceConnection> getServiceConnectionList​(String clientId,
                                                                String keyword,
                                                                boolean clientOnly)
        Return list of service connections matching the given search criteria
        Parameters:
        clientId - the client id
        keyword - the search keyword
        clientOnly - the flag to show only client scope services
        Returns:
        the list of matching service connections ordered by name and client code
      • getServiceConnectionList

        public List<ServiceConnection> getServiceConnectionList​(Client client)
        Returns a List of service connection which include only the global service connection and the connections belonging to the organisation.
        Parameters:
        client - the organisation of the service connections requested
        Returns:
        List of service connection which include only the global service connection and the connections belonging to the organisation.
        Since:
        18.11.0
      • loadDefaultConnections

        public void loadDefaultConnections()
        Load the pre-defined service connections
      • hasServiceConnectionForName

        @Deprecated
        public boolean hasServiceConnectionForName​(String name)
        Deprecated.
        Connection names are no longer unique. Use hasServiceConnection(Client, String) instead.
        Return whether there is a service connection for the given service name
        Parameters:
        name - the non-null service connection name (required)
        Returns:
        true if there is a service connection with the given name