Class SqlCacheMembershipDao
java.lang.Object
edu.internet2.middleware.grouper.sqlCache.SqlCacheMembershipDao
dao for sql cache memberships
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
delete
(SqlCacheMembership sqlCacheMembership) static int
deleteSqlCacheMembershipsBySqlCacheGroupInternalId
(Long sqlCacheGroupInternalId, Connection connection) static int
deleteSqlCacheMembershipsIfCacheable
(Collection<MultiKey> ownerIdFieldNameSourceIdSubjectIdsEndedMicros, Connection connection) Things to delete from sql cache memberships.static int
insertSqlCacheMembershipsIfCacheable
(Collection<MultiKey> ownerIdFieldNameSourceIdSubjectIdStartedMicros, Connection connection) things to add to sql cache memberships.static SqlCacheMembership
retrieveByCacheGroupInternalIdAndMemberInternalId
(Long cacheGroupInternalId, Long memberInternalId) select grouper sync by idstatic Map<MultiKey,
SqlCacheMembership> retrieveByCacheGroupInternalIdsMemberInternalIds
(Collection<MultiKey> cacheGroupInternalIdsMemberInternalIds, Connection connection) select caches by cache group internal ids and member internal idsretrieveSqlCacheGroupIdsCachedInHistory
(Set<Long> sqlCacheGroupIds, Connection connection) static boolean
store
(SqlCacheMembership sqlCacheMembership) static int
store
(Collection<SqlCacheMembership> sqlCacheMemberships) static int
store
(Collection<SqlCacheMembership> sqlCacheMemberships, Connection connection, boolean isInsert, boolean retryBatchStoreFailures, boolean ignoreRetriedBatchStoreFailures)
-
Constructor Details
-
SqlCacheMembershipDao
public SqlCacheMembershipDao()
-
-
Method Details
-
store
- Parameters:
connectionName
-- Returns:
- true if changed
-
retrieveByCacheGroupInternalIdAndMemberInternalId
public static SqlCacheMembership retrieveByCacheGroupInternalIdAndMemberInternalId(Long cacheGroupInternalId, Long memberInternalId) select grouper sync by id- Parameters:
theConnectionName
-id
-- Returns:
- the sync
-
delete
- Parameters:
sqlCacheMembership
-
-
insertSqlCacheMembershipsIfCacheable
public static int insertSqlCacheMembershipsIfCacheable(Collection<MultiKey> ownerIdFieldNameSourceIdSubjectIdStartedMicros, Connection connection) things to add to sql cache memberships. 5 fields in multikey: ownerId, fieldName, sourceId, subjectId, microsSince1970whenMembershipStarted (Long)- Parameters:
ownerIdFieldNameSourceIdSubjectIdStartedMicros
-connection
- optionally pass connection to use- Returns:
- number of cache membership inserts
-
deleteSqlCacheMembershipsIfCacheable
public static int deleteSqlCacheMembershipsIfCacheable(Collection<MultiKey> ownerIdFieldNameSourceIdSubjectIdsEndedMicros, Connection connection) Things to delete from sql cache memberships. Also possibly add to history if cachable. 5 fields in multikey: ownerId, fieldName, sourceId, subjectId, microsSince1970whenMembershipEnded (Long)- Parameters:
ownerIdFieldNameSourceIdSubjectIdStartedMillis
-connection
- optionally pass connection to use- Returns:
- number of cache membership deletes
-
deleteSqlCacheMembershipsBySqlCacheGroupInternalId
public static int deleteSqlCacheMembershipsBySqlCacheGroupInternalId(Long sqlCacheGroupInternalId, Connection connection) - Parameters:
sqlCacheGroupInternalId
-connection
- optionally pass connection to use- Returns:
- number of changes
-
store
- Parameters:
sqlCacheMemberships
-- Returns:
- number of changes
-
store
public static int store(Collection<SqlCacheMembership> sqlCacheMemberships, Connection connection, boolean isInsert, boolean retryBatchStoreFailures, boolean ignoreRetriedBatchStoreFailures) - Parameters:
sqlCacheMemberships
-connection
- optionally pass connection to useisInsert
-- Returns:
- number of changes
-
retrieveByCacheGroupInternalIdsMemberInternalIds
public static Map<MultiKey,SqlCacheMembership> retrieveByCacheGroupInternalIdsMemberInternalIds(Collection<MultiKey> cacheGroupInternalIdsMemberInternalIds, Connection connection) select caches by cache group internal ids and member internal ids- Parameters:
cacheGroupInternalIdsMemberInternalIds
-connection
-- Returns:
- the caches if they exist
-
retrieveSqlCacheGroupIdsCachedInHistory
public static Set<Long> retrieveSqlCacheGroupIdsCachedInHistory(Set<Long> sqlCacheGroupIds, Connection connection) - Parameters:
sqlCacheGroupIds
-connection
-- Returns:
- sqlCacheGroupIds being cached in history
-