use of org.wildfly.extension.picketlink.federation.service.IdentityProviderService in project wildfly by wildfly.
the class FederationDependencyProcessor method getFederationService.
private ServiceName getFederationService(DeploymentPhaseContext phaseContext) {
DeploymentUnit deployment = phaseContext.getDeploymentUnit();
ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();
// We assume the mgmt ops that trigger IdentityProviderAddHandler or ServiceProviderAddHandler
// run before the OperationStepHandler that triggers deploy. If not, that's a user mistake.
// Since those handlers run first, we can count on MSC having services *registered* even
// though we cannot count on them being *started*.
ServiceController<?> service = serviceRegistry.getService(IdentityProviderService.createServiceName(deployment.getName()));
if (service == null) {
service = serviceRegistry.getService(ServiceProviderService.createServiceName(deployment.getName()));
} else {
IdentityProviderService identityProviderService = (IdentityProviderService) service.getService();
IDPConfiguration idpType = identityProviderService.getValue().getConfiguration();
if (idpType.isExternal()) {
return null;
}
}
if (service == null) {
return null;
}
return service.getName();
}
use of org.wildfly.extension.picketlink.federation.service.IdentityProviderService in project wildfly by wildfly.
the class IdentityProviderAddHandler method launchServices.
static void launchServices(OperationContext context, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers, PathAddress pathAddress, boolean isRestart) throws OperationFailedException {
String alias = pathAddress.getLastElement().getValue();
IdentityProviderService service = new IdentityProviderService(toIDPConfig(context, model, alias));
ServiceBuilder<IdentityProviderService> serviceBuilder = context.getServiceTarget().addService(IdentityProviderService.createServiceName(alias), service);
String federationAlias = pathAddress.subAddress(0, pathAddress.size() - 1).getLastElement().getValue();
serviceBuilder.addDependency(FederationService.createServiceName(federationAlias), FederationService.class, service.getFederationService());
configureHandler(context, model, service);
IDPConfiguration configuration = service.getConfiguration();
if (!configuration.isExternal()) {
serviceBuilder.addDependency(SecurityDomainService.SERVICE_NAME.append(configuration.getSecurityDomain()));
}
if (verificationHandler != null) {
serviceBuilder.addListener(verificationHandler);
}
ServiceController<IdentityProviderService> controller = serviceBuilder.install();
if (newControllers != null) {
newControllers.add(controller);
}
if (isRestart) {
restartTrustDomains(alias, model, context);
}
}
Aggregations