Package com.avoka.fc.core.dao
Class ServiceConnectionDao
- java.lang.Object
-
- com.avoka.core.dao.BaseDao
-
- com.avoka.fc.core.dao.AbstractDao
-
- com.avoka.fc.core.dao.ServiceConnectionDao
-
public class ServiceConnectionDao extends AbstractDao
Provides a DAO for the ServiceConnection entity.- See Also:
ServiceConnection
-
-
Field Summary
-
Fields inherited from class com.avoka.core.dao.BaseDao
FETCH_LIMIT, STATEMENT_MAX_NO_PARAMETERS
-
-
Constructor Summary
Constructors Constructor Description ServiceConnectionDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
canCreateServiceConnection(Client targetClient, String name)
Check whether a service connection with the specified client and name can be created without conflict.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).ServiceConnection
getServiceConnectionForName(String name)
Deprecated.ServiceConnection
getServiceConnectionForPK(Object id)
Return the service connection with the specified OIDList<ServiceConnection>
getServiceConnectionList()
Return the list of all service connections, ordered by name and clientList<ServiceConnection>
getServiceConnectionList(Client client)
Returns a List of service connection which include only the global service connection and the connections belonging to the organisation.List<ServiceConnection>
getServiceConnectionList(String clientId, String keyword, boolean clientOnly)
Return list of service connections matching the given search criteriaServiceConnection
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).boolean
hasServiceConnection(Client client, String name)
Return whether there is a service connection for the given service nameboolean
hasServiceConnectionForName(String name)
Deprecated.Connection names are no longer unique.void
loadDefaultConnections()
Load the pre-defined service connections-
Methods inherited from class com.avoka.fc.core.dao.AbstractDao
andFilterClientExcludeNull, andFilterClientIncludeNull, andFilterClientOnly, isClientAccessAllowed, performQueryConfigCached
-
Methods inherited from class com.avoka.core.dao.BaseDao
addOrdering, addOrderingCaseInsensitive, addOrderingCaseSensitive, andQueryBetween, andQueryInExp, andQueryInExp, andQueryLikeIgnoreCaseExp, andQueryMatchDbExp, andQueryMatchExp, andQueryMatchIsNotNull, andQueryMatchIsNull, andQueryNoMatchExp, andQueryNotTrue, deleteObject, deleteObjects, findObject, getDataContext, getFetchLimit, getLogger, getObjectForPK, newObject, orQueryLikeIgnoreCaseExp, orQueryMatchExp, performNamedQuery, performNamedQuery, performNamedQuery, performNamedQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performNonSelectingQuery, performQuery, performQuery, performQuery, registerNewObject, setCacheStrategy, setFetchLimit, setLocalCacheStrategy, setLocalCacheStrategy, setSharedCacheStrategy, toMap, toMap
-
-
-
-
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 idkeyword
- the search keywordclientOnly
- 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
-
getServiceConnectionForName
@Deprecated public ServiceConnection getServiceConnectionForName(String name)
Deprecated.Return the service connection for the given service name- Parameters:
name
- the non-null service name- Returns:
- the service connection for the given name
-
hasServiceConnectionForName
@Deprecated public boolean hasServiceConnectionForName(String name)
Deprecated.Connection names are no longer unique. UsehasServiceConnection(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
-
-