Search in sources :

Example 1 with PicketLinkFederationService

use of org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService in project wildfly by wildfly.

the class FederationDeploymentProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    PicketLinkFederationService federationService = deploymentUnit.getAttachment(FederationDependencyProcessor.DEPLOYMENT_ATTACHMENT_KEY);
    if (federationService != null) {
        ROOT_LOGGER.federationConfiguringDeployment(deploymentUnit.getName());
        federationService.configure(deploymentUnit);
    }
}
Also used : PicketLinkFederationService(org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 2 with PicketLinkFederationService

use of org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService in project wildfly by wildfly.

the class AbstractPicketLinkMetricsOperationHandler method execute.

@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
    context.addStep(new OperationStepHandler() {

        @Override
        public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
            final PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR));
            final String name = address.getLastElement().getValue();
            final String attributeName = operation.require(NAME).asString();
            final ServiceController<?> controller = context.getServiceRegistry(false).getRequiredService(createServiceName(name));
            try {
                PicketLinkFederationService<?> service = (PicketLinkFederationService<?>) controller.getValue();
                doPopulateResult(service.getMetrics(), context.getResult(), attributeName);
            } catch (Exception e) {
                throw PicketLinkLogger.ROOT_LOGGER.failedToGetMetrics(e.getMessage());
            }
            context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
        }
    }, OperationContext.Stage.RUNTIME);
    context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) PicketLinkFederationService(org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) PathAddress(org.jboss.as.controller.PathAddress) OperationFailedException(org.jboss.as.controller.OperationFailedException) ServiceController(org.jboss.msc.service.ServiceController) ModelNode(org.jboss.dmr.ModelNode) OperationFailedException(org.jboss.as.controller.OperationFailedException)

Aggregations

PicketLinkFederationService (org.wildfly.extension.picketlink.federation.service.PicketLinkFederationService)2 OperationContext (org.jboss.as.controller.OperationContext)1 OperationFailedException (org.jboss.as.controller.OperationFailedException)1 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)1 PathAddress (org.jboss.as.controller.PathAddress)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 ModelNode (org.jboss.dmr.ModelNode)1 ServiceController (org.jboss.msc.service.ServiceController)1