Search in sources :

Example 1 with SubsystemType

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);
            }
        }
    }
}
Also used : SubsystemType(ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.SubsystemType) MemberType(ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.MemberType) SecurityServerId(ee.ria.xroad.common.identifier.SecurityServerId) ClientId(ee.ria.xroad.common.identifier.ClientId) SecurityServerType(ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.SecurityServerType)

Aggregations

MemberType (ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.MemberType)1 SecurityServerType (ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.SecurityServerType)1 SubsystemType (ee.ria.xroad.common.conf.globalconf.sharedparameters.v2.SubsystemType)1 ClientId (ee.ria.xroad.common.identifier.ClientId)1 SecurityServerId (ee.ria.xroad.common.identifier.SecurityServerId)1