Package org.openiam.authmanager.dao.impl
Class AuthManagerDAOImpl
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.jdbc.core.support.JdbcDaoSupport
-
- org.openiam.common.authmanager.jdbc.impl.AbstractJDBCDao
-
- org.openiam.authmanager.dao.impl.AuthManagerDAOImpl
-
- All Implemented Interfaces:
AuthManagerDAO
,org.springframework.beans.factory.InitializingBean
@Repository public class AuthManagerDAOImpl extends AbstractJDBCDao implements AuthManagerDAO
-
-
Field Summary
-
Fields inherited from class org.openiam.common.authmanager.jdbc.impl.AbstractJDBCDao
log, schemaName
-
-
Constructor Summary
Constructors Constructor Description AuthManagerDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getEdgeIds()
Map<EdgeVertexType,Set<String>>
getExpiredEdgeIds(Date now)
Map<VertexType,Map<String,String>>
getGraphVertexIds()
protected void
initSqlStatements()
void
nullOutEdges(Map<EdgeVertexType,Set<String>> edgeIdentity2EdgeIdMap)
The name of this method is somewhat misleading.String
selectGraphId(VertexType type, String openiamid)
void
updateEdge(String membershipId, String rightId, String edgeId, VertexType parentType, VertexType childType)
Updates the EDGE_ID field in the database, based on the membership id and right id The parentType and childType VertexTypes will dictate which XREF table gets updatedvoid
updateEdges(List<RightAwareEdgeDatabaseTuple> rightAwareEdgeDatabaseTuple, VertexType parentType, VertexType childType)
Batch updates the necessary database right xref database table The parentType and childType VertexTypes will dictate which XREF table gets updatedvoid
updateEdgesWithoutRights(List<RightAwareEdgeDatabaseTuple> edgeDatabaseTuples, VertexType parentType, VertexType childType)
Batch updates the necessary database right xref database table The parentType and childType VertexTypes will dictate which XREF table gets updatedvoid
updateGraphId(VertexType type, String id, String graphId)
Updates the underlying GraphID property in the database.void
updateGraphId(VertexType type, List<Tuple<String,String>> id2GraphIdMap)
Updates the underlying GraphID property in the database.-
Methods inherited from class org.openiam.common.authmanager.jdbc.impl.AbstractJDBCDao
getSchemaName, initDataSource
-
-
-
-
Method Detail
-
initSqlStatements
protected void initSqlStatements()
- Specified by:
initSqlStatements
in classAbstractJDBCDao
-
updateGraphId
public void updateGraphId(VertexType type, String id, String graphId)
Description copied from interface:AuthManagerDAO
Updates the underlying GraphID property in the database. This property is known only by JDBC, and not by hibernate, because only graph-specific actions require it, and the code that requires updating this propoerty will not necesssarily have access to Hibernate or JPA.- Specified by:
updateGraphId
in interfaceAuthManagerDAO
- Parameters:
type
- - type of entityid
- - ID in openiam databasegraphId
- - ID in graph database
-
updateGraphId
public void updateGraphId(VertexType type, List<Tuple<String,String>> id2GraphIdMap)
Description copied from interface:AuthManagerDAO
Updates the underlying GraphID property in the database. This property is known only by JDBC, and not by hibernate, because only graph-specific actions require it, and the code that requires updating this propoerty will not necesssarily have access to Hibernate or JPA.- Specified by:
updateGraphId
in interfaceAuthManagerDAO
- Parameters:
type
- - type of entityid2GraphIdMap
- - Tuple where key is openiam ID, and value is graph Database ID
-
selectGraphId
public String selectGraphId(VertexType type, String openiamid)
- Specified by:
selectGraphId
in interfaceAuthManagerDAO
-
getGraphVertexIds
public Map<VertexType,Map<String,String>> getGraphVertexIds()
- Specified by:
getGraphVertexIds
in interfaceAuthManagerDAO
- Returns:
- - Returns a Map of
VertexType
(User, Group, Role, etc) to the Map of OpenIAM Internal ID (key) to the graph ID (value)
-
getEdgeIds
public Map<String,String> getEdgeIds()
- Specified by:
getEdgeIds
in interfaceAuthManagerDAO
-
updateEdge
public void updateEdge(String membershipId, String rightId, String edgeId, VertexType parentType, VertexType childType)
Description copied from interface:AuthManagerDAO
Updates the EDGE_ID field in the database, based on the membership id and right id The parentType and childType VertexTypes will dictate which XREF table gets updated- Specified by:
updateEdge
in interfaceAuthManagerDAO
-
updateEdges
public void updateEdges(List<RightAwareEdgeDatabaseTuple> rightAwareEdgeDatabaseTuple, VertexType parentType, VertexType childType)
Description copied from interface:AuthManagerDAO
Batch updates the necessary database right xref database table The parentType and childType VertexTypes will dictate which XREF table gets updated- Specified by:
updateEdges
in interfaceAuthManagerDAO
-
updateEdgesWithoutRights
public void updateEdgesWithoutRights(List<RightAwareEdgeDatabaseTuple> edgeDatabaseTuples, VertexType parentType, VertexType childType)
Description copied from interface:AuthManagerDAO
Batch updates the necessary database right xref database table The parentType and childType VertexTypes will dictate which XREF table gets updated- Specified by:
updateEdgesWithoutRights
in interfaceAuthManagerDAO
-
getExpiredEdgeIds
public Map<EdgeVertexType,Set<String>> getExpiredEdgeIds(Date now)
- Specified by:
getExpiredEdgeIds
in interfaceAuthManagerDAO
-
nullOutEdges
public void nullOutEdges(Map<EdgeVertexType,Set<String>> edgeIdentity2EdgeIdMap)
Description copied from interface:AuthManagerDAO
The name of this method is somewhat misleading. It updates the `EDGE_ID` column to `NULL`. The key ofedgeIdentity2EdgeIdMap
tells us what type of edge it is Most likely, the argument into this method is the result of the call togetExpiredEdgeIds
- Specified by:
nullOutEdges
in interfaceAuthManagerDAO
-
-