Search in sources :

Example 1 with OpenServiceSecurityManagerProvider

use of org.nhindirect.common.rest.provider.OpenServiceSecurityManagerProvider in project nhin-d by DirectProject.

the class NHINDSecurityAndTrustMailet method getServiceSecurityManagerProvider.

/**
	 * Gets a custom service security manager provider.  If this is null, the system will us a default provider.
	 * @return Gets a service security manager provider.
	 */
protected Provider<ServiceSecurityManager> getServiceSecurityManagerProvider() {
    Provider<ServiceSecurityManager> retVal = null;
    String providerClazz = GatewayConfiguration.getConfigurationParam(SecurityAndTrustMailetOptions.SERVICE_SECURITY_MANAGER_PROVIDER, this, "");
    if (providerClazz != null && !providerClazz.isEmpty()) {
        try {
            // create an instance of the provider
            @SuppressWarnings("unchecked") Class<Provider<ServiceSecurityManager>> clazz = (Class<Provider<ServiceSecurityManager>>) getClass().getClassLoader().loadClass(providerClazz);
            retVal = clazz.newInstance();
        } catch (Exception e) {
            LOGGER.warn("Failed to load service security manager provider class " + providerClazz + ": " + e.getMessage(), e);
            retVal = new OpenServiceSecurityManagerProvider();
        }
    } else {
        retVal = new OpenServiceSecurityManagerProvider();
    }
    if (retVal instanceof MailetAwareProvider)
        ((MailetAwareProvider) retVal).setMailet(this);
    return retVal;
}
Also used : ServiceSecurityManager(org.nhindirect.common.rest.ServiceSecurityManager) OpenServiceSecurityManagerProvider(org.nhindirect.common.rest.provider.OpenServiceSecurityManagerProvider) MailetAwareProvider(org.nhindirect.gateway.smtp.provider.MailetAwareProvider) MessagingException(javax.mail.MessagingException) InvocationTargetException(java.lang.reflect.InvocationTargetException) SmtpAgentException(org.nhindirect.gateway.smtp.SmtpAgentException) MalformedURLException(java.net.MalformedURLException) ServiceException(org.nhindirect.common.rest.exceptions.ServiceException) RejectedRecipientDSNCreatorProvider(org.nhindirect.gateway.smtp.dsn.provider.RejectedRecipientDSNCreatorProvider) URLAccessedConfigProvider(org.nhindirect.gateway.smtp.provider.URLAccessedConfigProvider) SecureURLAccessedConfigProvider(org.nhindirect.gateway.smtp.provider.SecureURLAccessedConfigProvider) OpenServiceSecurityManagerProvider(org.nhindirect.common.rest.provider.OpenServiceSecurityManagerProvider) WSSmtpAgentConfigProvider(org.nhindirect.gateway.smtp.provider.WSSmtpAgentConfigProvider) XMLSmtpAgentConfigProvider(org.nhindirect.gateway.smtp.provider.XMLSmtpAgentConfigProvider) MailetAwareProvider(org.nhindirect.gateway.smtp.provider.MailetAwareProvider) KeyStoreProtectionConfigProvider(org.nhindirect.gateway.smtp.provider.KeyStoreProtectionConfigProvider) Provider(com.google.inject.Provider)

Aggregations

Provider (com.google.inject.Provider)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 MalformedURLException (java.net.MalformedURLException)1 MessagingException (javax.mail.MessagingException)1 ServiceSecurityManager (org.nhindirect.common.rest.ServiceSecurityManager)1 ServiceException (org.nhindirect.common.rest.exceptions.ServiceException)1 OpenServiceSecurityManagerProvider (org.nhindirect.common.rest.provider.OpenServiceSecurityManagerProvider)1 SmtpAgentException (org.nhindirect.gateway.smtp.SmtpAgentException)1 RejectedRecipientDSNCreatorProvider (org.nhindirect.gateway.smtp.dsn.provider.RejectedRecipientDSNCreatorProvider)1 KeyStoreProtectionConfigProvider (org.nhindirect.gateway.smtp.provider.KeyStoreProtectionConfigProvider)1 MailetAwareProvider (org.nhindirect.gateway.smtp.provider.MailetAwareProvider)1 SecureURLAccessedConfigProvider (org.nhindirect.gateway.smtp.provider.SecureURLAccessedConfigProvider)1 URLAccessedConfigProvider (org.nhindirect.gateway.smtp.provider.URLAccessedConfigProvider)1 WSSmtpAgentConfigProvider (org.nhindirect.gateway.smtp.provider.WSSmtpAgentConfigProvider)1 XMLSmtpAgentConfigProvider (org.nhindirect.gateway.smtp.provider.XMLSmtpAgentConfigProvider)1