use of org.platformlayer.ids.FederationKey in project platformlayer by platformlayer.
the class FederationMap method buildRules.
private void buildRules(FederationConfiguration config) {
for (FederationRule federationRule : config.rules) {
Rule rule = new Rule();
rule.mappedItems = PlatformLayerKey.fromServiceAndItem(federationRule.serviceType, null);
for (PlatformLayerConnectionConfiguration system : config.systems) {
if (Objects.equal(system.key, federationRule.target)) {
if (rule.targetKey != null) {
throw new IllegalStateException();
}
FederationKey host = FederationKey.build(system.authenticationEndpoint);
ProjectId project = new ProjectId(system.tenant);
rule.targetKey = new FederationMapping(host, project);
}
}
if (rule.targetKey == null) {
throw new IllegalStateException();
}
addRule(rule);
}
}
use of org.platformlayer.ids.FederationKey in project platformlayer by platformlayer.
the class FederationMap method buildDefault.
private FederationMapping buildDefault(PlatformLayerKey original) {
FederationKey targetHost = original.getHost();
if (targetHost == null) {
targetHost = FederationKey.LOCAL;
}
ProjectId targetProject = original.getProject();
return new FederationMapping(targetHost, targetProject);
}
Aggregations