}
}// OU grants SbiOrgUnitGrant
List exportedSbiOUGrantList = importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitGrant", null);
Iterator iterOUGrantVal = exportedSbiOUGrantList.iterator();
while (iterOUGrantVal.hasNext()) {
SbiOrgUnitGrant ouGrantVal = (SbiOrgUnitGrant) iterOUGrantVal.next();
String label = ouGrantVal.getLabel();
Object existObj = importer.checkExistence(label, sessionCurrDB, new SbiOrgUnitGrant());
if (existObj != null) {
SbiOrgUnitGrant dsCurr = (SbiOrgUnitGrant) existObj;
metaAss.insertCoupleIdOuGrantAssociation(ouGrantVal.getId(), dsCurr.getId());
metaLog.log("Found an existing ou grant " + dsCurr.getId() + " with "
+ "the same label of one exported ou grant");
}
}// OU grant nodes SbiOrgUnitGrantNodes
List exportedSbiOUGrantNodeList = importer.getAllExportedSbiObjects(sessionExpDB, "SbiOrgUnitGrantNodes", null);
Iterator iterOUGrantNodesVal = exportedSbiOUGrantNodeList.iterator();
while (iterOUGrantNodesVal.hasNext()) {
SbiOrgUnitGrantNodes ouGrantNode = (SbiOrgUnitGrantNodes) iterOUGrantNodesVal.next();
Map uniqueMap = new HashMap();
Map nodeAss = metaAss.getOuNodeAssociation();
Map miAss = metaAss.getModelInstanceIDAssociation();
Map grantAss = metaAss.getOuGrantAssociation();
if(ouGrantNode.getId() != null){
Integer newGrantId = (Integer)grantAss.get(ouGrantNode.getId().getGrantId());
uniqueMap.put("grantId", newGrantId );
Integer newNodeId = (Integer)nodeAss.get(ouGrantNode.getId().getNodeId());
uniqueMap.put("nodeId", newNodeId);
Integer newMiId = (Integer)miAss.get(ouGrantNode.getId().getKpiModelInstNodeId());
uniqueMap.put("modelInstId", newMiId);
}
Object existObj = importer.checkExistence(uniqueMap, sessionCurrDB, new SbiOrgUnitGrantNodes());
if (existObj != null) {
SbiOrgUnitGrantNodes dsCurr = (SbiOrgUnitGrantNodes) existObj;
metaAss.insertCoupleIdOuGrantNodesAssociation(ouGrantNode.getId(), dsCurr.getId());
metaLog.log("Found an existing ou grant node with grant id " + dsCurr.getId().getGrantId() + " with "
+ "the same id of one exported ou grant node");
}
}
logger.debug("OUT");
}