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
-
-
Constructor Summary
Constructors Constructor Description CredentialsHibernateDao()
-
Method Summary
-
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 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
-
-
-
-
Method Detail
-
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
@NotNull public @NotNull BambooEntityOid getMaxCredentialOid(int serverKey)
- Specified by:
getMaxCredentialOid
in interfaceCredentialsDao
-
findGlobalByName
@Nullable public @Nullable MutableCredentialsData findGlobalByName(String name)
- Specified by:
findGlobalByName
in interfaceCredentialsDao
- Returns:
- global credentials that match the given name
-
findByNameAndProjectId
public MutableCredentialsData findByNameAndProjectId(String name, long projectId)
- 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
public boolean hasAnyGlobalCredentials(@NotNull @NotNull String pluginKey)
- Specified by:
hasAnyGlobalCredentials
in interfaceCredentialsDao
- Returns:
- True if there are global credentials that match the given plugin key
-
findGlobalAll
@NotNull public @NotNull Collection<? extends MutableCredentialsData> findGlobalAll()
- Specified by:
findGlobalAll
in interfaceCredentialsDao
- Returns:
- A list of all global credentials
-
countAllGlobalCredentials
@NotNull public @NotNull Long countAllGlobalCredentials()
- Specified by:
countAllGlobalCredentials
in interfaceCredentialsDao
- Returns:
- a count of all global credentials
-
countAllProjectsCredentials
@NotNull public @NotNull Long countAllProjectsCredentials()
- Specified by:
countAllProjectsCredentials
in interfaceCredentialsDao
- Returns:
- a count of all project credentials
-
findAllProjectsIdsUsingProjectSharedCredentials
@NotNull public @NotNull List<Long> findAllProjectsIdsUsingProjectSharedCredentials()
- Specified by:
findAllProjectsIdsUsingProjectSharedCredentials
in interfaceCredentialsDao
- Returns:
- a list containing all projects that use project credentials.
-
findAll
@NotNull public @NotNull Collection<? extends MutableCredentialsData> findAll()
Description copied from interface:CredentialsDao
Shortcut forBambooObjectDao.findAll(Class)
.- Specified by:
findAll
in interfaceCredentialsDao
-
findById
@Nullable public @Nullable MutableCredentialsData findById(long id)
Description copied from interface:CredentialsDao
Shortcut forBambooObjectDao.findById(long, Class)
.- Specified by:
findById
in interfaceCredentialsDao
-
findByOid
@Nullable public @Nullable MutableCredentialsData findByOid(@NotNull @NotNull BambooEntityOid oid)
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
-
getPaginatedSharedCredentials
@NotNull public @NotNull List<MutableCredentialsData> getPaginatedSharedCredentials(@Nullable @Nullable Long projectId, int start, int limit, String filter)
- Specified by:
getPaginatedSharedCredentials
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
-
-