use of ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.SubsystemType in project X-Road by nordic-institute.
the class SharedParametersV2 method cacheSecurityServers.
private void cacheSecurityServers() {
// Map of XML ID fields mapped to client IDs
Map<String, ClientId> clientIds = getClientIds();
for (SecurityServerType securityServer : confType.getSecurityServer()) {
// Cache the server.
for (byte[] certHash : securityServer.getAuthCertHash()) {
serverByAuthCert.put(encodeBase64(certHash), securityServer);
}
// Add owner of the security server.
MemberType owner = (MemberType) securityServer.getOwner();
addServerClient(createMemberId(owner), securityServer);
// cache security server information by serverId
SecurityServerId securityServerId = SecurityServerId.create(confType.getInstanceIdentifier(), owner.getMemberClass().getCode(), owner.getMemberCode(), securityServer.getServerCode());
securityServersById.put(securityServerId, securityServer);
// Add clients of the security server.
for (JAXBElement<?> client : securityServer.getClient()) {
Object val = client.getValue();
if (val instanceof MemberType) {
addServerClient(createMemberId((MemberType) val), securityServer);
} else if (val instanceof SubsystemType) {
addServerClient(clientIds.get(((SubsystemType) val).getId()), securityServer);
}
}
}
}
Aggregations