Package com.atlassian.bamboo.credentials
Class CredentialsHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<E>
com.atlassian.bamboo.persistence3.BambooHibernateObjectWithOidDao<MutableCredentialsData>
com.atlassian.bamboo.credentials.CredentialsHibernateDao
- All Implemented Interfaces:
CredentialsDao
,BambooObjectDao<MutableCredentialsData>
,BambooObjectWithOidDao<MutableCredentialsData>
,org.springframework.beans.factory.InitializingBean
public class CredentialsHibernateDao
extends BambooHibernateObjectWithOidDao<MutableCredentialsData>
implements CredentialsDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Long
@NotNull Long
int
deleteByProjectId
(long projectId) @NotNull Collection<? extends MutableCredentialsData>
findAll()
Shortcut forBambooObjectDao.findAll(Class)
.@NotNull Collection<? extends MutableCredentialsData>
findAll
(int firstResult, int maxResults) @NotNull List<? extends MutableCredentialsData>
findAllByPluginKey
(@NotNull String pluginKey) @NotNull Collection<? extends MutableCredentialsData>
findAllByProject
(Long projectId) @NotNull Collection<? extends MutableCredentialsData>
findAllByProjectAndPluginKey
(Long projectId, String pluginKey) @Nullable MutableCredentialsData
findById
(long id) Shortcut forBambooObjectDao.findById(long, Class)
.findByNameAndProjectId
(String name, long projectId) @Nullable MutableCredentialsData
findByOid
(@NotNull BambooEntityOid oid) Shortcut forBambooObjectWithOidDao.findByOid(BambooEntityOid, Class)
.@NotNull Collection<? extends MutableCredentialsData>
@Nullable MutableCredentialsData
findGlobalByName
(String name) @NotNull List<? extends MutableCredentialsData>
findGlobalByPluginKey
(@NotNull String pluginKey) @NotNull BambooEntityOid
getMaxCredentialOid
(int serverKey) @NotNull List<MutableCredentialsData>
getPaginatedSharedCredentials
(@Nullable Long projectId, int start, int limit, String filter) boolean
hasAnyGlobalCredentials
(@NotNull String pluginKey) @NotNull MutableCredentialsData
merge
(@NotNull MutableCredentialsData unmanagedEntity) Shortcut forBambooObjectDao.merge(BambooObject, Class)
.Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectWithOidDao
findByOid
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, findById, merge, save, saveAll
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectWithOidDao
findByOid
-
Constructor Details
-
CredentialsHibernateDao
public CredentialsHibernateDao()
-
-
Method Details
-
findAll
@NotNull public @NotNull Collection<? extends MutableCredentialsData> findAll(int firstResult, int maxResults) - Specified by:
findAll
in interfaceCredentialsDao
- Returns:
- A collection of all known credentials that match given parameters
-
getMaxCredentialOid
- Specified by:
getMaxCredentialOid
in interfaceCredentialsDao
-
findGlobalByName
- Specified by:
findGlobalByName
in interfaceCredentialsDao
- Returns:
- global credentials that match the given name
-
findByNameAndProjectId
- Specified by:
findByNameAndProjectId
in interfaceCredentialsDao
-
findAllByProject
@NotNull public @NotNull Collection<? extends MutableCredentialsData> findAllByProject(Long projectId) - Specified by:
findAllByProject
in interfaceCredentialsDao
-
findAllByProjectAndPluginKey
@NotNull public @NotNull Collection<? extends MutableCredentialsData> findAllByProjectAndPluginKey(Long projectId, String pluginKey) - Specified by:
findAllByProjectAndPluginKey
in interfaceCredentialsDao
-
hasAnyGlobalCredentials
- Specified by:
hasAnyGlobalCredentials
in interfaceCredentialsDao
- Returns:
- True if there are global credentials that match the given plugin key
-
findGlobalAll
- Specified by:
findGlobalAll
in interfaceCredentialsDao
- Returns:
- A list of all global credentials
-
countAllGlobalCredentials
- Specified by:
countAllGlobalCredentials
in interfaceCredentialsDao
- Returns:
- a count of all global credentials
-
countAllProjectsCredentials
- Specified by:
countAllProjectsCredentials
in interfaceCredentialsDao
- Returns:
- a count of all project credentials
-
findAll
Description copied from interface:CredentialsDao
Shortcut forBambooObjectDao.findAll(Class)
.- Specified by:
findAll
in interfaceCredentialsDao
-
findById
Description copied from interface:CredentialsDao
Shortcut forBambooObjectDao.findById(long, Class)
.- Specified by:
findById
in interfaceCredentialsDao
-
findByOid
Description copied from interface:CredentialsDao
Shortcut forBambooObjectWithOidDao.findByOid(BambooEntityOid, Class)
.- Specified by:
findByOid
in interfaceCredentialsDao
-
merge
@NotNull public @NotNull MutableCredentialsData merge(@NotNull @NotNull MutableCredentialsData unmanagedEntity) Description copied from interface:CredentialsDao
Shortcut forBambooObjectDao.merge(BambooObject, Class)
.- Specified by:
merge
in interfaceCredentialsDao
-
deleteByProjectId
public int deleteByProjectId(long projectId) - Specified by:
deleteByProjectId
in interfaceCredentialsDao
-
findGlobalByPluginKey
@NotNull public @NotNull List<? extends MutableCredentialsData> findGlobalByPluginKey(@NotNull @NotNull String pluginKey) - Specified by:
findGlobalByPluginKey
in interfaceCredentialsDao
- Returns:
- A list of global credentials that match the given plugin key
-
findAllByPluginKey
@NotNull public @NotNull List<? extends MutableCredentialsData> findAllByPluginKey(@NotNull @NotNull String pluginKey) - Specified by:
findAllByPluginKey
in interfaceCredentialsDao
- Returns:
- A list of global and project credentials that match the given plugin key
-