Search in sources :

Example 1 with SoapSTSInstanceModule

use of org.forgerock.openam.sts.soap.config.SoapSTSInstanceModule in project OpenAM by OpenRock.

the class SoapSTSInstancePublisherImpl method publishInstance.

private void publishInstance(SoapSTSInstanceConfig instanceConfig) throws STSPublishException {
    Injector injector;
    try {
        injector = SoapSTSInjectorHolder.getInstance(Key.get(Injector.class)).createChildInjector(new SoapSTSInstanceModule(instanceConfig));
        final Server server = soapSTSInstanceLifecycleManager.exposeSTSInstanceAsWebService(injector.getInstance(Key.get(new TypeLiteral<Map<String, Object>>() {
        }, Names.named(AMSTSConstants.STS_WEB_SERVICE_PROPERTIES))), injector.getInstance(SecurityTokenServiceProvider.class), instanceConfig);
        publishedAndExposedInstances.put(instanceConfig.getDeploymentSubPath(), new ConfigAndServerHolder(instanceConfig, server));
        //TODO: add the sts element, or whatever is exposed in web.xml to the log message?
        logger.info("The following soap-sts instance has been successfully exposed at " + instanceConfig.getDeploymentSubPath() + ":\n" + instanceConfig);
    } catch (Exception e) {
        throw new STSPublishException(ResourceException.INTERNAL_ERROR, "Could not create injector corresponding to the " + "to-be-published instance " + instanceConfig.getDeploymentSubPath() + "; The exception: " + e, e);
    }
}
Also used : SoapSTSInstanceModule(org.forgerock.openam.sts.soap.config.SoapSTSInstanceModule) Server(org.apache.cxf.endpoint.Server) Injector(com.google.inject.Injector) STSPublishException(org.forgerock.openam.sts.STSPublishException) SecurityTokenServiceProvider(org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider) HashMap(java.util.HashMap) Map(java.util.Map) ResourceException(org.forgerock.json.resource.ResourceException) STSPublishException(org.forgerock.openam.sts.STSPublishException)

Aggregations

Injector (com.google.inject.Injector)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Server (org.apache.cxf.endpoint.Server)1 SecurityTokenServiceProvider (org.apache.cxf.ws.security.sts.provider.SecurityTokenServiceProvider)1 ResourceException (org.forgerock.json.resource.ResourceException)1 STSPublishException (org.forgerock.openam.sts.STSPublishException)1 SoapSTSInstanceModule (org.forgerock.openam.sts.soap.config.SoapSTSInstanceModule)1