[nhin-d] push by gm2...@cerner.com - Adding tag for gateway 4.0.... on 2015-01-20 13:14 GMT

11 views
Skip to first unread message

nhi...@googlecode.com

unread,
Jan 20, 2015, 8:14:53 AM1/20/15
to nhindirec...@googlegroups.com
Revision: 14f6f5bbfc75
Branch: default
Author: gm2552
Date: Mon Jan 19 15:29:14 2015 UTC
Log: Adding tag for gateway 4.0.
Updating version to 4.1-SNAPSHOT.
https://code.google.com/p/nhin-d/source/detail?r=14f6f5bbfc75

Added:
/java/tags/gateway-4.0/KeyStore
/java/tags/gateway-4.0/pom.xml
/java/tags/gateway-4.0/src/books/users-guide.xml
/java/tags/gateway-4.0/src/books/users-guide/depl-intro.confluence

/java/tags/gateway-4.0/src/books/users-guide/depl-james-fine-grain-options.confluence
/java/tags/gateway-4.0/src/books/users-guide/depl-james.confluence
/java/tags/gateway-4.0/src/books/users-guide/depl-smtp.confluence
/java/tags/gateway-4.0/src/books/users-guide/dev-arch.confluence
/java/tags/gateway-4.0/src/books/users-guide/dev-intro.confluence
/java/tags/gateway-4.0/src/books/users-guide/dev-write.confluence
/java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAlone.png

/java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAloneProcessingRelay.png

/java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAloneRelayFlow.png

/java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAloneWithGateway.png
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddAnchor.png
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddBundle.png

/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddCertificate.png
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddDomain.png
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddSetting.png
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddedBundle.png

/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAssociateTrustBundle.png

/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigBundleAnchors.png

/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigDomainSearch.png

/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigDownloadedBundle.png

/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigEmptyBundles.png

/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigSelectBundle.png
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigUIHome.png
/java/tags/gateway-4.0/src/books/users-guide/preface.apt
/java/tags/gateway-4.0/src/books/users-guide/smtp-depl-wsconfig.confluence
/java/tags/gateway-4.0/src/books/users-guide/smtp-depl-xmlconfig.confluence

/java/tags/gateway-4.0/src/books/users-guide/smtp-fine-grain-options.confluence

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/GatewayConfiguration.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/AuditEvents.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/DefaultSmtpAgent.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/DomainPostmaster.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/GatewayState.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/MessageProcessResult.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/MessageProcessingSettings.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/NotificationProducer.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/NotificationSettings.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ProcessBadMessageSettings.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ProcessIncomingSettings.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ProcessOutgoingSettings.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/RawMessageSettings.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ReliableDispatchedNotificationProducer.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgent.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgentError.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgentException.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgentFactory.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgentSettings.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/annotation/SmptAgentConfigFile.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/RESTSmtpAgentConfig.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/SmptAgentConfigFactory.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/SmtpAgentConfig.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/WSSmtpAgentConfig.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/XMLSmtpAgentConfig.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceCertificateStore.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceRESTCertificateStore.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/cert/impl/provider/ConfigServiceCertificateStoreProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/cert/impl/provider/ConfigServiceRESTCertificateStoreProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/config/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/DSNCreator.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/impl/AbstractDSNCreator.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/impl/FailedDeliveryDSNCreator.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/impl/FailedDeliveryDSNCreatorOptions.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/impl/RejectedRecipientDSNCreator.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/impl/RejectedRecipientDSNCreatorOptions.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/module/DSNCreatorProviderModule.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/module/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/provider/FailedDeliveryDSNCreatorProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/provider/RejectedRecipientDSNCreatorProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/dsn/provider/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/AbstractNotificationAwareMailet.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/DirectBounce.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/NotificationSuppressor.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/RefreshSecurityAndTrustStateMailet.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/SecurityAndTrustMailetOptions.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/SuppressAndTrackAggregate.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/TimelyAndReliableLocalDelivery.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/TrackIncomingNotification.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/mailet/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/matcher/IsNotSMIMEEncrypted.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/matcher/IsNotification.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/matcher/RecipAndSenderIsNotLocal.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/james/matcher/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/module/AuditorModule.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/module/SmtpAgentConfigModule.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/module/SmtpAgentModule.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/package-info.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/ConfigBasicAuthServiceSecurityManagerProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/DefaultSmtpAgentProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/MailetAwareProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/NHINDAgentConfigurableProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/RESTSmtpAgentConfigProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/SecureURLAccessedConfigProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/URLAccessedConfigProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/WSSmtpAgentConfigProvider.java

/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/provider/XMLSmtpAgentConfigProvider.java
/java/tags/gateway-4.0/src/report/findbugs-exclude.xml
/java/tags/gateway-4.0/src/site/resources/css/site.css
/java/tags/gateway-4.0/src/site/resources/images/logo.png
/java/tags/gateway-4.0/src/site/site.xml
/java/tags/gateway-4.0/src/site/xdoc/index.xml

/java/tags/gateway-4.0/src/test/java/org/apache/james/transport/mailets/LocalDelivery.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/DefaultSmtpAgent_AuditMessage_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/DefaultSmtpAgent_ProcessMessage_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/DomainPostmasterTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/GatewayState_getSetAttributesTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/GatewayState_startSettingsManagerTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/GatewayState_stopSettingManagerTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/GatewayState_updateAgentSettingsTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/MessageProcessingSettingsTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/NotificationProducerTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/NotificationSettingsTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/ReliableDispatchedNotificationProducer_produceTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/SmtpAgentFactory_CreateAgent_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/SmtpAgentFactory_buildAgentInjectorTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/ConfigServiceRunner.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/MockSmtpAgentConfig.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/RESTSmtpAgentConfigFunctional_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/WSSmtpAgentConfigFunctional_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/WSSmtpAgentConfig_setTimeoutTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/XMLSmtpAgentConfigFunctional_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/XMLSmtpAgentConfig_BuildDomains_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/XMLSmtpAgentConfig_BuildLdapCertificateStoreProvider_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/XMLSmtpAgentConfig_BuildPrivateCertStore_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/XMLSmtpAgentConfig_BuildTrustAnchorResolver_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/XMLSmtpAgentConfig_GetAgentInjector_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceCertificateStore_CRUD_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceCertificateStore_CertBootstrap_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceCertificateStore_Construct_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceCertificateStore_getDefaultCachePolicyTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceRESTCertificateStore_CRUD_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceRESTCertificateStore_CertBootstrap_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceRESTCertificateStore_Construct_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/config/cert/impl/ConfigServiceRESTCertificateStore_getDefaultCachePolicyTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/DirectBounce_sendDSNTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/MockMail.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/MockMailetConfig.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/MockMailetContext.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/MockTxService.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/MockTxServiceProvider.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_autoGeneratorDSNTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_createDSNCreatorTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_createDefaultTxServiceModulesTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_functionalTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_getAuditModuleTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_getConfigProviderTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_getMessageToTrackTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_getMonitoringServiceURLTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_getServiceSecurityManagerProviderTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_initialization_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_isOutgoingTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_monitorMessageTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_monitorServiceInitialization_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_onProcess_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_outboundPolicyForInboundTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_service_Test.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_trackMessageTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NotificationSupressor_isConusmingProcessedMDNTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NotificationSupressor_suppressMessageTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/OnProcessMailet.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/RefreshSecurityAndTrustStateMailet_refreshStateTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/SuppressAndTrackAggregate_initTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/SuppressAndTrackAggregate_serviceTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/TimelyAndReliableLocalDelivery_initTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/TimelyAndReliableLocalDelivery_serviceTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/TrackIncomingNotification_initializationTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/mailet/TrackIncomingNotification_trackMessageTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/matcher/IsNotSMIMEEncryptedTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/matcher/IsNotificationTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/smtp/james/matcher/RecipAndSenderIsNotLocalTest.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/testutils/BaseTestPlan.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/testutils/ElementAdapter.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/gateway/testutils/TestUtils.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/MockNHINDAgent.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/NHINDAgentAccessor.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/module/AuditorModule.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/module/FileAuditorModule.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/module/MockNHINDAgentModule.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/module/MockSmtpConfigModule.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/provider/InstanceAuditorProvider.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/provider/MockNHINDAgentProvider.java

/java/tags/gateway-4.0/src/test/java/org/nhindirect/stagent/provider/MockSmtpAgentConfigProvider.java
/java/tags/gateway-4.0/src/test/resources/applicationContext.xml
/java/tags/gateway-4.0/src/test/resources/bundles/testBundle.p7b
/java/tags/gateway-4.0/src/test/resources/certs/KeyUsageCA.der
/java/tags/gateway-4.0/src/test/resources/certs/KeyUsageCAKey.der
/java/tags/gateway-4.0/src/test/resources/certs/bob.der
/java/tags/gateway-4.0/src/test/resources/certs/cacert.der
/java/tags/gateway-4.0/src/test/resources/certs/cernerdemos.der
/java/tags/gateway-4.0/src/test/resources/certs/digSigOnly.der
/java/tags/gateway-4.0/src/test/resources/certs/digSigOnly.p12
/java/tags/gateway-4.0/src/test/resources/certs/digSigOnlyKey.der
/java/tags/gateway-4.0/src/test/resources/certs/digSinOnlyKey.der
/java/tags/gateway-4.0/src/test/resources/certs/dualUse.der
/java/tags/gateway-4.0/src/test/resources/certs/dualUse.p12
/java/tags/gateway-4.0/src/test/resources/certs/dualUseKey.der
/java/tags/gateway-4.0/src/test/resources/certs/gm2552New.pkcs12
/java/tags/gateway-4.0/src/test/resources/certs/gm2552encrypted.p12
/java/tags/gateway-4.0/src/test/resources/certs/highlandclinic.pkcs12
/java/tags/gateway-4.0/src/test/resources/certs/keyEncOnly.der
/java/tags/gateway-4.0/src/test/resources/certs/keyEncOnly.p12
/java/tags/gateway-4.0/src/test/resources/certs/keyEncOnlyKey.der
/java/tags/gateway-4.0/src/test/resources/certs/securehealthemail.com.der
/java/tags/gateway-4.0/src/test/resources/configFiles/EmptyDomainNames.xml
/java/tags/gateway-4.0/src/test/resources/configFiles/EmptyDomains.xml
/java/tags/gateway-4.0/src/test/resources/configFiles/EmptyPostmaster.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/InvalidXMLInstance.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/MissingDomainNames.xml
/java/tags/gateway-4.0/src/test/resources/configFiles/MissingDomains.xml
/java/tags/gateway-4.0/src/test/resources/configFiles/MissingPostmaster.xml
/java/tags/gateway-4.0/src/test/resources/configFiles/ValidAnchors.xml
/java/tags/gateway-4.0/src/test/resources/configFiles/ValidConfig.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidConfigNoMDNAutoResponse.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidConfigStateLine.txt

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidMultiDomainLdapConfig.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidMultiDomainLdapConfigPKCS12.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidMultiPublicCertConfig.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidUniformLdapConfig.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidUniformLdapConfigPKCS12.xml

/java/tags/gateway-4.0/src/test/resources/configFiles/ValidUniformLdapMultiPublicResConfig.xml
/java/tags/gateway-4.0/src/test/resources/keystores/internalKeystore
/java/tags/gateway-4.0/src/test/resources/messages/DSNMessage.txt
/java/tags/gateway-4.0/src/test/resources/messages/EncryptedMessage.txt
/java/tags/gateway-4.0/src/test/resources/messages/MDNDispatchedMessage.txt
/java/tags/gateway-4.0/src/test/resources/messages/MDNMessage.txt

/java/tags/gateway-4.0/src/test/resources/messages/MultipleRecipientsIncomingMessage.txt
/java/tags/gateway-4.0/src/test/resources/messages/PlainIncomingMessage.txt
/java/tags/gateway-4.0/src/test/resources/messages/PlainOutgoingMessage.txt

/java/tags/gateway-4.0/src/test/resources/messages/PlainOutgoingMessageInterDomain.txt

/java/tags/gateway-4.0/src/test/resources/messages/PlainOutgoingMessageWithRejectedRecips.txt

/java/tags/gateway-4.0/src/test/resources/messages/PlainUntrustedOutgoingMessage.txt

/java/tags/gateway-4.0/src/test/resources/messages/PlainUntrustedReliableOutgoingMessage.txt

/java/tags/gateway-4.0/src/test/resources/policies/dataEnciphermentOnlyRequired.xml
/java/tags/gateway-4.0/src/test/resources/policies/digiSigOnly.txt
/java/tags/gateway-4.0/src/test/resources/policies/dualUseCertRequired.txt
/java/tags/gateway-4.0/src/test/resources/policies/keyEncOnly.txt
/java/tags/gateway-4.0/src/test/resources/properties/auditStore.properties
/java/tags/gateway-4.0/src/test/resources/webapp/WEB-INF/web.xml
/java/tags/gateway-4.0/src/test/resources/x509Certificate.txt
Modified:
/java/gateway/pom.xml

/java/gateway/src/test/java/org/nhindirect/gateway/smtp/james/mailet/NHINDSecurityAndTrustMailet_getAuditModuleTest.java

=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/KeyStore Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/pom.xml Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,702 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd ">
+ <groupId>org.nhind</groupId>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>gateway</artifactId>
+ <name>Direct Project Agent Gateways.</name>
+ <version>4.0</version>
+ <description>Direct Project security agent gateways and
bridges.</description>
+ <inceptionYear>2010</inceptionYear>
+
<url>http://api.nhindirect.org/x/www/api.nhindirect.org/java/site/gateway/${project.version}</url>
+ <developers>
+ <developer>
+ <name>Greg Meyer</name>
+ <id>GM2552</id>
+ <email>gm2...@cerner.com</email>
+ <roles>
+ <role>owner</role>
+ </roles>
+ </developer>
+ </developers>
+ <organization>
+ <name>NHIN Direct</name>
+ <url>http://nhindirect.org</url>
+ </organization>
+ <prerequisites>
+ <maven>2.0.4</maven>
+ </prerequisites>
+ <scm>
+ <url>https://nhin-d.googlecode.com/hg/java/gateway/</url>
+
<connection>scm:hg:https://nhin-d.googlecode.com/hg/nhin-d/java/gateway</connection>
+ </scm>
+ <issueManagement>
+ <system>Google Code</system>
+ <url>http://code.google.com/p/nhin-d/issues/list</url>
+ </issueManagement>
+ <licenses>
+ <license>
+ <name>New BSD License</name>
+ <url>http://nhindirect.org/BSDLicense</url>
+ </license>
+ </licenses>
+ <repositories>
+ <repository>
+ <id>REPO2</id>
+ <name>Maven2 Central Repo2</name>
+ <url>http://repo2.maven.org/maven2/</url>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>org.nhind</groupId>
+ <artifactId>agent</artifactId>
+ <version>2.0.11</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.nhind</groupId>
+ <artifactId>direct-common</artifactId>
+ <version>1.4.2</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.nhind</groupId>
+ <artifactId>direct-common-audit</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.nhind</groupId>
+ <artifactId>config-service-client</artifactId>
+ <version>2.0</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.nhind</groupId>
+ <artifactId>agent</artifactId>
+ <version>2.0.11</version>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.google.inject</groupId>
+ <artifactId>guice</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>1.8.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.4</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.1.1</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>1.6.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.17</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4.3</version>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>apache-mailet</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.james</groupId>
+ <artifactId>apache-mailet-base</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.nhind</groupId>
+ <artifactId>config-service-jar</artifactId>
+ <version>2.0</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-asm</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-core</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.shared</groupId>
+ <artifactId>shared-ldap</artifactId>
+ <version>0.9.5.5</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-jndi</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-protocol-ldap</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-jdk14</artifactId>
+ <version>1.5.6</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-server-unit</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-servlet-tester</artifactId>
+ <version>6.1.14</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-beans</artifactId>
+ <version>3.2.3.RELEASE</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>com.springsource.org.apache.commons.logging
+ </artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>3.2.3.RELEASE</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>com.springsource.org.apache.commons.logging
+ </artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-context</artifactId>
+ <version>3.2.3.RELEASE</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>com.springsource.org.apache.commons.logging
+ </artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+<!--
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ <version>1.1</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-core</artifactId>
+ <version>3.3.2.GA</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-jpa_2.0_spec</artifactId>
+ <version>1.0</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-entitymanager</artifactId>
+ <version>3.3.2.GA</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>geronimo-spec</groupId>
+ <artifactId>geronimo-spec-jta</artifactId>
+ <version>1.0.1B-rc4</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-annotations</artifactId>
+ <version>3.3.1.GA</version>
+ <type>jar</type>
+ <exclusions>
+ <exclusion>
+ <groupId>org.hibernate</groupId>
+ <artifactId>ejb3-persistence</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ </exclusion>
+ </exclusions>
+ <scope>test</scope>
+ </dependency>
+-->
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-transports-http</artifactId>
+ <version>2.2.9</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxws</artifactId>
+ <version>2.2.9</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.geronimo.specs</groupId>
+ <artifactId>geronimo-activation_1.1_spec</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.4.1.3</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>backport-util-concurrent</groupId>
+ <artifactId>backport-util-concurrent</artifactId>
+ <version>2.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.mina</groupId>
+ <artifactId>mina-core</artifactId>
+ <version>1.0.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>RELEASE</version>
+ </extension>
+ </extensions>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ <resource>
+ <targetPath>lib</targetPath>
+ <directory>${project.basedir}/lib</directory>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ </testResource>
+ <testResource>
+ <targetPath>lib</targetPath>
+ <directory>${project.basedir}/lib</directory>
+ </testResource>
+ </testResources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <argLine>-Xmx1024m -XX:MaxPermSize=512m</argLine>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ <phase>compile</phase>
+ </execution>
+ </executions>
+ <configuration>
+ <fork>true</fork>
+ <optimize>true</optimize>
+ <showDeprecation>false</showDeprecation>
+ <encoding>UTF-8</encoding>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.0.3</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <index>true</index>
+
<!--<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
-->
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover2-plugin</artifactId>
+ <version>3.0.2</version>
+ <configuration>
+ <jdk>1.6</jdk>
+ <licenseLocation>
+ ${project.basedir}/../licenses/clover.license
+ </licenseLocation>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>instrument</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- DOXIA does not yet copy resources to the generated-site or
site location. Bug
+ DOXIA-355 was submitted in July of 09 and is listed to be resolved
in DOXIA 1.2.
+ This plugin a is work around for copying the resources from the
book source to
+ the generate site. -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>book</id>
+ <phase>pre-site</phase>
+ <configuration>
+ <tasks>
+ <copy
todir="${project.build.directory}/generated-site/xdoc/users-guide/images/">
+ <fileset
dir="${basedir}/src/books/users-guide/images/" />
+ </copy>
+ <copy
todir="${project.build.directory}/site/users-guide/images/">
+ <fileset
dir="${basedir}/src/books/users-guide/images/" />
+ </copy>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-maven-plugin</artifactId>
+ <version>1.2</version>
+ <executions>
+ <execution>
+ <phase>pre-site</phase>
+ <goals>
+ <goal>render-books</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <books>
+ <book>
+ <directory>src/books/users-guide</directory>
+ <descriptor>src/books/users-guide.xml</descriptor>
+ <formats>
+ <format>
+ <id>xdoc</id>
+ </format>
+ </formats>
+ </book>
+ </books>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>1.5.12</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-decoration-model</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-confluence</artifactId>
+ <version>1.2</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <!-- for release only
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.6.1</version>
+ <configuration>
+ <charset>UTF-8</charset>
+ <docencoding>UTF-8</docencoding>
+ <docfilessubdirs>true</docfilessubdirs>
+ <detectJavaApiLink>true</detectJavaApiLink>
+ <detectLinks>true</detectLinks>
+ <source>1.6</source>
+ <show>public</show>
+ <excludePackageNames>
+
org.nhindirect.gateway.smtp.annotation:org.nhindirect.gateway.smtp.module:org.nhindirect.gateway.smtp.provider:org.nhindirect.gateway.smtp.config.cert.impl
+ </excludePackageNames>
+ </configuration>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ -->
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+
<tagBase>scm:hg:https://nhin-d.googlecode.com/hg/nhin-d/java/tags</tagBase>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.1.1</version>
+ <dependencies>
+ <dependency>
+ <groupId>commons-httpclient</groupId>
+ <artifactId>commons-httpclient</artifactId>
+ <version>3.1</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.1.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.6.1</version>
+ <configuration>
+ <charset>UTF-8</charset>
+ <docencoding>UTF-8</docencoding>
+ <docfilessubdirs>true</docfilessubdirs>
+ <detectJavaApiLink>true</detectJavaApiLink>
+ <detectLinks>true</detectLinks>
+ <source>1.6</source>
+ <show>public</show>
+ <excludePackageNames>
+
org.nhindirect.gateway.smtp.annotation:org.nhindirect.gateway.smtp.module:org.nhindirect.gateway.smtp.provider:org.nhindirect.gateway.smtp.config.cert.impl:org.nhindirect.gateway.smtp.dsn.impl
+ </excludePackageNames>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <configuration>
+ <targetJdk>1.6</targetJdk>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-changelog-plugin</artifactId>
+ <configuration>
+ <dates>
+ <!-- Insert the date of the most recent release -->
+ <date>2010-11-10</date>
+ </dates>
+ <outputEncoding>UTF-8</outputEncoding>
+ <type>date</type>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>1.2</version>
+ <configuration>
+ <effort>Max</effort>
+
<excludeFilterFile>${project.basedir}/src/report/findbugs-exclude.xml</excludeFilterFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <configuration>
+ <tags>
+ <tag>FIXME</tag>
+ <tag>TODO</tag>
+ <tag>WARN</tag>
+ <tag>@deprecated</tag>
+ </tags>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.atlassian.maven.plugins</groupId>
+ <artifactId>maven-clover2-plugin</artifactId>
+ <version>3.0.2</version>
+ <configuration>
+ <licenseLocation>
+ ${project.basedir}/../licenses/clover.license
+ </licenseLocation>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+ <distributionManagement>
+ <site>
+ <id>nhind-site</id>
+ <name>NHIN Direct API publication site</name>
+
<url>sftp://api.nhindirect.org/x/www/api.nhindirect.org/java/site/gateway/${project.version}</url>
+ </site>
+ <snapshotRepository>
+ <id>sonatype-snapshot</id>
+ <name>Sonatype OSS Maven SNAPSHOT Repository</name>
+ <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+ <uniqueVersion>false</uniqueVersion>
+ </snapshotRepository>
+ <repository>
+ <id>sonatype-release</id>
+ <name>Sonatype OSS Maven Release Repositor</name>
+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+ <uniqueVersion>false</uniqueVersion>
+ </repository>
+ </distributionManagement>
+</project>
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide.xml Mon Jan 19 15:29:14
2015 UTC
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<book xmlns="http://maven.apache.org/BOOK/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/BOOK/1.0.0 ../../../doxia/doxia-book/target/generated-site/xsd/book-1.0.0.xsd">
+ <id>users-guide</id>
+ <title>Gateway Module Users Guide</title>
+ <chapters>
+ <chapter>
+ <id>preface</id>
+ <title>Preface</title>
+ <sections>
+ <section>
+ <id>preface</id>
+ </section>
+ </sections>
+ </chapter>
+ <chapter>
+ <id>dev</id>
+ <title>Developers Guide</title>
+ <sections>
+ <section>
+ <id>dev-intro</id>
+ </section>
+ <section>
+ <id>dev-arch</id>
+ </section>
+ <section>
+ <id>dev-write</id>
+ </section>
+ <section>
+ <id>dev-write</id>
+ </section>
+ </sections>
+ </chapter>
+ <chapter>
+ <id>deployment</id>
+ <title>Deployment Guide</title>
+ <sections>
+ <section>
+ <id>depl-intro</id>
+ </section>
+ <section>
+ <id>smtp-depl-xmlconfig</id>
+ </section>
+ <section>
+ <id>smtp-depl-wsconfig</id>
+ </section>
+ <section>
+ <id>smtp-fine-grain-options</id>
+ </section>
+ <section>
+ <id>depl-smtp</id>
+ </section>
+ <section>
+ <id>depl-james</id>
+ </section>
+ <section>
+ <id>depl-james-fine-grain-options</id>
+ </section>
+ </sections>
+ </chapter>
+ </chapters>
+</book>
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/depl-intro.confluence Mon
Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,20 @@
+h1. About this Chapter
+
+This chapters describes the different configuration and deployment
methodologies for the gateway components.
+
+h2. Agent Configuration
+
+Agent configuration consists of setting the runtime parameters for both
the protocol and security and trust agents. The agent configuration is for
the most part decoupled from the protocol implementation and bridge, and
the configuration settings can be stored in any addressable protocol
supported by the protocol agent subsystem.
+
+* [SMTP XML configuration|./smtp-depl-xmlconfig.html]
+
+* [SMTP WebService configuration|./smtp-depl-wsconfig.html]
+
+* [Fine Grain Tuning|./smtp-fine-grain-options.html]
+
+h2. Protocol Implementation Deployment
+
+Protocol implementation deployments are dependent are the specific
implementation. A specific implementation deployment may even have several
deployment options. In almost all cases, the deployment consists of
installing and configuring a protocol bridge specific to the implementation.
+
+* [SMTP Deployments|./depl-smtp.html]
+
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/depl-james-fine-grain-options.confluence
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,38 @@
+h1. Apache James Fine Grain Tuning
+
+Fine grained tuning of the following James implementation specific
components can be achieved using the [OptionsManager|
http://api.nhindirect.org/java/site/agent/1.5.4/apidocs/org/nhindirect/stagent/options/OptionsManager.html].
+
+h2. Message Monitoring Service URL
+
+Instead of supplying the message monitoring service URL as a parameter for
each mailet, the URL can be set at the JVM level to apply to all mailets.
+
+||JVM Param/Properties Setting|Description||
+|org.nhindirect.gateway.smtp.james.mailet.TxServiceURL|The URL of the
message monitorin service.|
+
+h2. Failed Delivery DSN Bounce Message Generation
+
+The following parameters can be used to fine to the specific sections of
the bounce messages created by the bounce message generator when message
delivery fails.
+
+||JVM Param/Properties Setting|Description||
+|org.nhindirect.gateway.smtp.dsn.impl.DSNFailedPrefix| The prefix to add
to the DSN subject|
+|org.nhindirect.gateway.smtp.dsn.impl.DNSPostmaster|The postmaster account
name used as the from attribute for DSN messages. The postmaster name will
be pre-appended to the domain name of the original sender. Default value
is 'postmaster'.|
+|org.nhindirect.gateway.smtp.dsn.imp.DeliveryFailureDSNMTAName|The name of
the agent creating the DSN message|
+|org.nhindirect.gateway.smtp.dsn.impl.DeliveryFailureDSNFaileRecipTitle|
Title that goes above the list of failed recipients in the human readable
section of the DSN message.|
+|org.nhindirect.gateway.smtp.dsn.impl.DeliveryFailureDSNFaileRecipTitle|
Title that goes at the top of the human readable section of the DSN
message.|
+|org.nhindirect.gateway.smtp.dsn.impl.DeliveryFailureDSNFailedErrorMessage|
A human readable description of why the message failed to be delivered.|
+|org.nhindirect.gateway.smtp.dsn.impl.DeliveryFailureDSNFailedHeader|A
message header that appears at the top of the human readable section of the
DSN message. This generally used as the message introduction.|
+|org.nhindirect.gateway.smtp.dsn.impl.DeliveryFailureDSNFailedFooter|A
footer at the bottom of the human readable section of the DSN message.
This is generally used to provide troubleshooting information.|
+
+h2. Failed Security And Trust DSN Bounce Message Generation
+
+The following parameters can be used to fine to the specific sections of
the bounce messages created by the bounce message generator when security
and trust fails.
+
+||JVM Param/Properties Setting|Description||
+|org.nhindirect.gateway.smtp.dsn.impl.DSNFailedPrefix| The prefix to add
to the DSN subject|
+|org.nhindirect.gateway.smtp.dsn.impl.DNSPostmaster|The postmaster account
name used as the from attribute for DSN messages. The postmaster name will
be pre-appended to the domain name of the original sender. Default value
is 'postmaster'.|
+|org.nhindirect.gateway.smtp.dsn.impl.DSNMTAName|The name of the agent
creating the DSN message|
+|org.nhindirect.gateway.smtp.dsn.impl.DSNFaileRecipTitle|Title that goes
above the list of failed recipients in the human readable section of the
DSN message.|
+|org.nhindirect.gateway.smtp.dsn.impl.DSNFaileRecipTitle|Title that goes
at the top of the human readable section of the DSN message.|
+|org.nhindirect.gateway.smtp.dsn.impl.DSNFailedErrorMessage|A human
readable description of why the message failed to be delivered.|
+|org.nhindirect.gateway.smtp.dsn.impl.DSNFailedHeader|A message header
that appears at the top of the human readable section of the DSN message.
This generally used as the message introduction.|
+|org.nhindirect.gateway.smtp.dsn.impl.DSNFailedFooter|A footer at the
bottom of the human readable section of the DSN message. This is generally
used to provide troubleshooting information.|
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/depl-james.confluence Mon
Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,362 @@
+h1. Apache James Deployment
+
+[James|http://james.apache.org/] is an open source Java based mail and
news server supported by the [Apache|http://www.apache.org/index.html]
software foundation. It is implemented using a modular pattern and can
extended by adding new modules and components. It can run either as a
completely stand alone email system, or can be integrated into a more
complex mail deployment acting as either the final mail destination or a
smart relay.
+
+This section is not intended to be a full fledged James configuration and
deployment guide, but to explain how the Direct Project gateway module
integrates with the James platform.
+
+*NOTE* All James instructions in the following sections are specific to
James 2.3.2. James 3 at the time of writing is still under development in
beata relase and radically changes the structure of the James deployment.
+
+h2. NHINDSecurityAndTrustMailet
+
+As stated earlier, James is modular platform that facilitates easy
integration of custom processing modules into the SMTP stack. The modular
constructs of James are the Mailet and Matcher interfaces. In fact the
default James configuration consists mainly of pre-configured Mailets and
Matchers. The Direct Project gateway module provides the
NHINDSecurityAndTrustMailet as protocol bridge for James. This custom
mailet intercepts messages as they pass through the James *transport*
processor, extracts the sender and recipients from the SMTP envelope, and
calls the SMTPAgent to process the messages according the security and
trust policy. After processing, the bridge either allows the message to
continue through the James stack or calls appropriate error handling
routines if the message cannot be processed correctly.
+
+h3. Mailet installation
+
+All custom modules are deployed in jar files and placed in the James lib
directory:
+
+_%jamesInstallRoot%/apps/james/SAR-INF/lib_
+
+All jars and transient dependencies must be placed in this directory.
+
+*NOTE* The reference implementation contains a pre-built James
configuration in the [direct-project-stock|
http://repo2.maven.org/maven2/org/nhind/direct-project-stock/] project that
contains all of the necessary jars in the lib folder as well as a
pre-configured mailet.
+
+
+h3. Mailet Configuration
+
+The NHINDSecurityAndTrustMailet is added to the James processing stack by
adding specific lines into the James configuration file:
+
+_%jamesInstallRoot%/apps/james/SAR-INF/config.xml_
+
+All configuration examples in this section are located in the config.xml
file.
+
+All custom Matchers and Mailet packages must be registered with James in
the <mailetpackages> and <matcherpackages> elements.
+
+{code}
+ <mailetpackages>
+ <mailetpackage>org.apache.james.transport.mailets</mailetpackage>
+
<mailetpackage>org.apache.james.transport.mailets.smime</mailetpackage>
+
<mailetpackage>org.nhindirect.gateway.smtp.james.mailet</mailetpackage>
+ </mailetpackages>
+ <matcherpackages>
+ <matcherpackage>org.apache.james.transport.matchers</matcherpackage>
+
<matcherpackage>org.apache.james.transport.matchers.smime</matcherpackage>
+
<matcherpackage>org.nhindirect.gateway.smtp.james.matcher</matcherpackage>
+ </matcherpackages>
+{code}
+
+To install the security and trust mailet into the James stack, you need to
a mailet element under the transport processor. *NOTE* James executes
mailets in the order that they are listed in the configuration file, so
place your mailet appropriately if you have other custom processing that
needs to be executed before or after the security and trust mailet.
+
+Example:
+
+{code}
+ <mailet match="All" class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>http://localhost:8081/config-service/ConfigurationService</ConfigURL>
+
<MessageMonitoringServiceURL>http://localhost:8081/msg-monitor</MessageMonitoringServiceURL>
+
<AutoDSNFailueCreation>General,ReliableAndTimely</AutoDSNFailueCreation>
+ </mailet>
+{code}
+
+
+*Mailet*
+
+Attributes:
+
+||Attribute||Description||
+|match|The matcher used to decide if the message should be processed by
the mailet.|
+|class|The class name of the mailet. James searches through all the
mailet packages to find a fully qualified class name.|
+
+Elements:
+
+||Element||Type||Description||
+|ConfigURL|URL|A URL to the location of the SMTPAgent configuration
information. This information is forwarded to the SmtpAgentFactory to
locate and parse the configuration|
+|MessageMonitoringServiceURL|URL|A URL to the location of the message
monitoring service for quality of service purposes. If this parameter is
present, the mailet creates default NoOp [TxService|
http://api.nhindirect.org/java/site/direct-common/1.1.2/apidocs/org/nhindirect/common/tx/TxService.html]
implementation.|
+|AutoDSNFailueCreation|Comma Delimited String|Determines if DSN bounce
messages should be automatically created for failed security and trust
recipients. Defaults to ReliableAndTimely if this parameter is not
present.|
+|UseOutgoingPolicyForIncomingNotifications|Indicates if the outbound trust
policy should be applied to incoming notification messages. Defaults to
false if this parameter is not present.|
+
+The above example tell James to send all messages to the agent using the
*All* matcher. More on matchers later.
+
+The ConfigURL must be a valid and well formed URL that is addressable by
the James application. The other settings are optional.
+
+*Matchers*
+
+Every mailet is required to provide a matcher. A matcher is a thin piece
of logic that determines if the message should be processed by the mailet.
The result of matcher is a list of recipients that should be processed by
the mailet. James provides a stock set of out of the box matchers, so may
use any of them for the security and trust mailet if they suit your needs.
+
+Depending on your SMTP deployment, you may want to use simple local
delivery for outgoing messages when the recipients are in the same domain
as your HISP. In this case you will not want the messages to be processed
by the security and trust agent unless your HISP configuration allows users
to not trust other users inside the same domain (i.e. us...@sample.com does
not trust us...@sample.com). The gateway module provides a custom matcher
called RecipAndSenderIsNotLocal which takes one parameter: a list of
domains managed by your HISP. *NOTE* Multiple domains are comma delimited.
+
+Example:
+
+{code}
+ <mailet
match="RecipAndSenderIsNotLocal=securehealthemail.com,cerner.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>http://localhost:8081/config/ConfigurationService</ConfigURL>
+ </mailet>
+{code}
+
+When James reaches this mailet, the matcher determines if the message is
incoming from an external domain or an outgoing message. If the message is
incoming, all recipients are sent to the mailet. If the message is
outgoing, all external recipients are processed by the agent while all
local recipients are not processed and remain unencrypted for local
delivery. *NOTE* When deploying James in multi domain environment, unless
all domains within a HISP mutually trust each other, all messages and
recipients should be processed by the agent.
+
+h4. Configuration URL
+
+The configuration URL can either reference an XML file that contains
configuration that adheres the XML SMTP Agent configuration [specification|
smtp-depl-xmlconfig.html] or and http(s) address that reference the
configuration [service|smtp-depl-wsconfig.html].
+
+Examples:
+* File:
file:///home/ubuntu/james-agent-v2/james-2.3.2/apps/james/SAR-INF/STConfig.xml
+* HTTP: http://configServer/config/ConfigurationService
+
+When using the HTTP based configuration service, it is assumed the service
has been deployed and settings such as domains, anchors, and certificates
have been configured.
+
+When running in an development environment, you can launch the
configuration service and configuration UI directly from the command line
using maven. From the nhin-d build directory, open two command or terminal
windows and run the _mvn jetty:run_ command from the config-service
directory first, then the config-ui service. The services use an embedded
database called _Derby_ to persist all settings. The configuration ui can
be accessed from a browser at http://localhost:8080/config-ui using nhind
as the username as password. The configuration service URL for the mailet
configuration will be at http://localhost:8081/config/ConfigurationService.
+
+h2. Message Monitoring and Delivery Notification
+
+Version 2.0 of the gateway introduced not only support for the delivery
notification implementation [guide|
http://wiki.directproject.org/file/detail/Implementation+Guide+for+Delivery+Notification+in+Direct+v1.0.pdf],
but better support for delivery quality of service in general. Increased
support has been added in three sections:
+
+* Generation of DSN bounce messages for rejected outgoing message for
security and trust reasons
+* Generation of DSN bounce messages for messages that do not receive MDNs.
+* Generation of DSN bounce messages for messages that cannot be delivered
to James mailboxes.
+
+The default behavior of the gateway has been designed and configured to be
as passive as possible to older releases.
+
+h3. Rejected Security and Trust Messages
+
+Previously the NHINDSecurityAndTrustMailet did not take any action for
outgoing messages that were rejected for security and trust reasons. The
AutoDSNFailueCreation settings configures the mailet to automatically
generate DSN bounce messages for rejected recipients. The setting accepts
a comma delimited list of out bound message scenarios that should auto
generate bounce messages.
+
+* ReliableAndTimely - Messages that have been indicated they wish to
enable the timely and reliable delivery notification option.
+* General - All other message.
+
+NOTE: The settings are only applicable for out bound message and do not
apply to encrypted, DNS, or MDN messages.
+
+h3. Message Monitoring
+
+Messages that are not trusted by a receiving HISP do not receive any type
of positive notification. To provide feedback to the sender, the
NHINDSecurityAndTrustMailet can send outbound message information to a
monitoring service that keeps track of all out bound messages and received
notifications. The monitoring service is responsible for generating DSN
bounce messages for messages that have not received notification messages
within a given time period. The time period is configured in the
monitoring [service|
http://api.nhindirect.org/java/site/direct-msg-monitor/1.1.3/users-guide/overview.html].
+
+h3. Delivery Failure
+
+The gateway overrides the default James LocalDelivery mailet with the
TimelyAndReliableLocalDelivery mailet to generate DSN bounce messages if
the message cannot be delivered to the local users mailbox. It also adds
the DirectBounce mailet to the 'local-address-error' processor to generate
a DSN bounce if the local mail account does not exist.
+
+h2. Incoming Notification Policy
+
+Trust can be configured to be directional meaning trust can be configured
to allow either outbound only or inbound only messages to be trusted. If
directional trust is set for outbound only, issues can occur with message
monitoring because the incoming MDN and DSN notification messages will be
marked as not trusted. To allow message monitoring and QoS in general to
operate properly, notification (and only notifications messages) must be
allowed to flow through the system as trusted messages. However the agent
needs to ensure that only notification messages that are generated from
trusted outbound destinations are allowed to marked as trusted.
+
+The security and trust mailet supports the setting
UseOutgoingPolicyForIncomingNotifications to allow incoming notification
messages to be marked as trusted. The following is sample configuration:
+
+{code}
+ <mailet
match="RecipAndSenderIsNotLocal=securehealthemail.com,cerner.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>http://localhost:8081/config/ConfigurationService</ConfigURL>
+
<UseOutgoingPolicyForIncomingNotifications>true</UseOutgoingPolicyForIncomingNotifications>
+ </mailet>
+{code}
+
+For backward behavioural passivity, the mailet defaults this parameter to
false if it does not exist in the mailet configuration. If you system will
be configured with outbound only directional trust, it is recommended that
this parameter be present and set to true.
+
+h2. SuppressAndTrackAggregate Mailet
+
+There are two scenarios where MDN notification messages should be
suppressed from being delivered to the sender's edge client:
+
+* MDN processed messages. These are intended to be only STA to STA
messages.
+* Duplicate notifications for messages requesting timely and reliable
message.
+
+The SuppressAndTrackAggregate mailet is responsible for sending inbound
notification messages to the monitoring service and determining if the
notification message should be suppressed. The following is an example
configuration:
+
+{code}
+ <mailet match="IsNotification" class="SuppressAndTrackAggregate">
+
<MessageMonitoringServiceURL>http://localhost:8081/msg-monitor</MessageMonitoringServiceURL>
+ <ConsumeMDNProcessed>true</ConsumeMDNProcessed>
+ </mailet>
+{code}
+
+The following mailet elements are used:
+
+||Element||Type||Description||
+|MessageMonitoringServiceURL|URL|A URL to the location of the message
monitoring service for quality of service purposes. If this parameter is
present, the mailet creates default NoOp [TxService|
http://api.nhindirect.org/java/site/direct-common/1.1.2/apidocs/org/nhindirect/common/tx/TxService.html]
implementation.|
+|ConsumeMDNProcessed|Boolean |Indicates if all MDN processed messages
should be suppressed. It is recommended that this be set to true. Setting
to false will allow all MDN processed message to be sent to the sender's
edge client. This setting is mainly here to enable passivity from older
versions of the agent (setting to false enables the passive behavior).|
+
+h2. Prebuilt Assembly Configuration
+
+A full [stock|
http://repo2.maven.org/maven2/org/nhind/direct-project-stock/] assembly and
configuration is available that contains the minimum set of components to
run the Direct Project in a single domain stand alone James deployment.
See the stock project [site|
http://api.nhindirect.org/java/site/assembly/stock/2.0.1/] for installation
and configuration details.
+
+h2. Deployment Configuration Scenarios
+
+The following scenarios are not at all an exhaustive list of deployment
configurations, but some identified use cases and suggested best practice
deployments.
+
+*Development Testing Configuration*
+
+This use case describes a scenario where the HISP is only used for
development testing. See the Bare Metal Project Java source [wiki|
http://wiki.directproject.org/Bare+Metal+Project+-+Java+%28source%29] for
details.
+
+*Single Domain Standalone*
+
+This use case describes a scenario where the HISP consists of only one
domain, and a deployed instance of James comprises the entire SMTP server
stack.
+
+!images/JamesStandAlone.png!
+
+Mailet configuration in this use case is fairly simple.
+
+Example:
+
+{code}
+ <mailet match="RecipAndSenderIsNotLocal=mydomain.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-agent-v2/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+{code}
+
+Because all messages sent from within the domain are delivered locally,
the matcher is necessary to ensure local outgoing messages are not
processed by the agent.
+
+*Single Domain Standalone With EMAIL Gateway*
+
+This use case describes a scenario where the HSIP consists of only one
domain, mail is stored and retrieve using James, but all incoming and
outgoing messages going to and coming from the backbone are handled by an
email gateway.
+
+!images/JamesStandAloneWithGateway.png!
+
+This model assumes that the gateway is configured to send all incoming
messages to James' configured incoming port (default 25). The mailet
configuration is still fairly simple.
+
+Example:
+
+{code}
+ <mailet match="RecipAndSenderIsNotLocal=mydomain.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-agent-v2/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+{code}
+
+As with the previous configuration, all local mail is delivered locally.
However all outgoing mail needs to be forwarded to the email gateway. The
RemoteDelivery mailet handles forwarding out bound messages to a configured
location. In this scenario we want local messages to stay local and all
externally bound messages to be forwarded to the gateway. The mailet can
be configured immediately following the security and trust mailet if no
other processing is necessary in the transport processor.
+
+Example:
+
+{code}
+ <mailet match="RecipientIsRegex=(?!mydomain.com)"
class="RemoteDelivery">
+ <gateway>mygatewayhostname:25</gateway>
+ </mailet>
+{code}
+
+Note the use of negative look arounds in the regex. James does not
provide a matcher for remote recipients, but a negative look around regular
expression can be used to mimic the desired affect. The
RecipAndSenderIsNotLocal should not be used because it would send all
incoming messages to the gateway.
+
+*Single Domain James as Processing Relay*
+
+This use case describes a scenario where the HISP has an existing stand
alone email solution such as Postfix. The email server may not have the
ability to inject custom processing modules into the server, but can relay
messages to other servers for custom processing. After the custom email
server finishes processing the message, the custom server must send the
message back to the original email server (typically on port separate from
the main incoming email port). In this scenario, James is the custom email
server. The standalone email server may or may not be configured to handle
local delivery before the custom processor is executed, but an identical
mailet configuration can be used for both cases.
+
+!images/JamesStandAloneProcessingRelay.png!
+
+Example:
+
+{code}
+ <mailet match="RecipAndSenderIsNotLocal=mydomain.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-agent-v2/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+{code}
+
+The mailet will still want to ensure that local outbound messages remain
unprocessed because the standalone email server will still deliver these
messages locally. Howerver, the relay matcher will need to match all
messages so all messages are sent back to the standalone email server.
+
+{code}
+ <mailet match="All" class="RemoteDelivery">
+ <gateway>mystandaloneemailserver:10026</gateway>
+ </mailet>
+{code}
+
+Note the custom port on the remote delivery email server. This is because
the email server will more than likely accept processed messages on a
separte port than incoming messages.
+
+If the standalone email server and James are deployed on the same OS
instance, you will probably need to change James' incoming port.
+
+Example:
+
+{code}
+ <smtpserver enabled="true">
+ <port>10025</port>
+
+ .
+ .
+ .
+ <smtpserver>
+{code}
+
+This assumes that the standalone email server is configured to forward
messages to James on port 10025 for message processing.
+
+*Single Domain James as Injected Into Relay/Gateway Flow*
+
+This use case describes a scenario where the HISP already uses a relay or
email gateway for incoming and outgoing messages. James is injected
between the email server and gateway. The email server is configured to
send all outgoing messages to James incoming port, and James RemoteDelivery
mailet is configured to send all messages to the relay/gateway.
+
+!images/JamesStandAloneRelayFlow.png!
+
+Example:
+
+{code}
+ <mailet match="RecipAndSenderIsNotLocal=mydomain.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-outgoing/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+
+ <mailet match="All" class="RemoteDelivery">
+ <gateway>mygateway:25</gateway>
+ </mailet>
+{code}
+
+As with the previous use case, James' incoming SMTP port may need to be
changed if the email server and James are deployed on the same OS instance.
+
+What about incoming messages from the email gateway that need to go the
server? How do you configue the RemoteDelivery mailet to deliver outgoing
messages to the gateway and incoming messages to the email server. The
answer is you can't. That's not entirely true. The problem is that there
is not matcher that can determine if the messages are outbound or inbound.
If they did exist (and someone is entirely free to write them), the
configuration could look like this.
+
+{code}
+ <mailet match="RecipAndSenderIsNotLocal=mydomain.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-handle-it-all/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+
+ <mailet match="MesssageIsOutbound" class="RemoteDelivery">
+ <gateway>mygateway:25</gateway>
+ </mailet>
+
+ <mailet match="MesssageIsInbound" class="RemoteDelivery">
+ <gateway>mygateway:25</gateway>
+ </mailet>
+{code}
+
+Something missing in this configuration is that the RemoteDelivery mailet
requires a different mail repository URL for each mailet instance.
+
+Another option is to deploy to sepearte James instances. One to handle
incoming messages and the other to handle outgoing messages. The outgoing
instance would be configured similar to the first example in this use
case. The incoming instance would be configured similar to the following:
+
+Example:
+
+{code}
+ <mailet match="All" class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-incoming/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+
+ <mailet match="All" class="RemoteDelivery">
+ <gateway>myemailserver:25</gateway>
+ </mailet>
+{code}
+
+The gateway would forward all incoming email to the inbound instance's
SMTP port (needs to be different than the outgoing instance's port) and
James forwards all messages on to the email server.
+
+*Multi Domain James as Injected Into Relay/Gateway Flow*
+
+This use case describes a scenario where the HISP already uses a relay or
email gateway for incoming and outgoing messages and supports multiple
domains on the its email server. James is injected between the email
server and gateway. The email server is configured to send all outgoing
messages to James incoming port, and James RemoteDelivery mailet is
configured to send all messages to the relay/gateway.
+
+In this scenario, it is suggested that the email server not use local
delivery for messages coming from email clients. The reason is that each
domain may have a sepearate trust policy and local delivered messages would
never be sent to the agent for trust policy processing. If all domains in
the HISP mutually trust each other, then local is an acceptable
configuration option.
+
+The James and mailet configurations are exactly the same as the previous
scenario with one exception. The outgoing James instance should list all
domains managed by the HISP in its matcher.
+
+Example:
+
+{code}
+ <mailet match="RecipAndSenderIsNotLocal=mydomain.com,myotherdomain.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-outgoing/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+
+ <mailet match="All" class="RemoteDelivery">
+ <gateway>mygateway:25</gateway>
+ </mailet>
+{code}
+
+h2. Logging
+
+James uses the Avalon logging system and Direct Project components use
[apache-commons-logging|http://commons.apache.org/logging/index.html]
(JCL). Generally JCL will try to discover an application's configured
logging mechanism, so you may be OK with the James logging configuration
found in _%jamesInstallRoot%/apps/james/SAR-INF/environment.xml_. However
you are free to change this and set custom log levels and formats. You can
also override JCL to use a different logging sub system such as log4j or
JDK 1.4. Details for configuring JCL can be found on the JCL [guide|
http://commons.apache.org/logging/commons-logging-1.1/guide.html].
+
+A quick way to turn on TRACE logging for debugging purposes is to add the
following lines to the phoenix.sh shell script and run James interactively
with run.sh.
+
+Search the phoenix.sh file for the following text:
+
+{code}
+JVM_OPTS="-Djava.ext.dirs=$JVM_EXT_DIRS"
+{code}
+
+and change it to:
+
+{code}
+JVM_OPTS="-Djava.ext.dirs=$JVM_EXT_DIRS
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.defaultlog=trace"
+{code}
+
+This will configure JCL to output all logging to the console and sets the
threshold to trace.
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/depl-smtp.confluence Mon
Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,8 @@
+h1. SMTP Protocol Implementation Deployment
+
+There are different options of SMTP server implementations that can
integrate with the SMTP agent. The Direct Project gateway module provides
some out of the box SMTP protocol bridges for a few Java based SMTP
servers. Each server has specific configuration and deployment
methodologies and can support multiple deployment options.
+
+* [Apache James|depl-james.html]
+
+* [Apache James Fine Grain Tuning|depl-james-fine-grain-options.html]
+
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/dev-arch.confluence Mon
Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,14 @@
+h1. Protocol Bridge Architecture
+
+The bridge architecture can conceptually be split into four parts and is
logically stacked in the following order:
+
+* *Protocol Implementation*: The specific implementation component of a
particular backbone protocol such as SMTP. Examples are SMTP servers such
as Apache James.
+
+* *Protocol Bridge*: A component that integrates with the protocol
implementation. The bridge is responsible for intercepting messages as
they pass through the implementation stack, translating the
implementation's message structure to a common agent structure, and handing
the message off to the protocol agent. Bridges are generally written using
APIs and/or configurations specific to the protocol implementation.
Example: The Apache James server provides the [Mailet|
http://james.apache.org/mailet/index.html] API for integrating custom
processing logic into the SMTP stack.
+
+* *Protocol Agent* A component that provides processing logic specific to
a backbone protocol and delegates messages to the security and trust
module. The Direct Proejct gateway module provides protocol agents for
core backbone protocol such as SMTP.
+
+* *Security And Trust Agent* A component that implements the NHIN Direct
security and trust [agent specification|
http://wiki.directproject.org/Applicability+Statement+for+Secure+Health+Transport].
+
+Typically a message flows through a Direct Project gateway starting at the
protocol implementation and eventually makes it way to the security and
trust agent. After processing is complete through the protocol and
security agents, the processed message is handed back to the protocol
bridge which must decide how the processed message will continue through
the protocol implementation.
+
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/dev-intro.confluence Mon
Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,7 @@
+h1. About this Chapter
+
+This chapters describes the protocol bridge architecture and how to write
a protocol bridge.
+
+* [Bridge Architecture|./dev-arch.html]
+* [Writing A Bridge|./dev-write.html]
+
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/dev-write.confluence Mon
Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,141 @@
+h1. Writing A Protocol Bridge
+
+h2. Overview
+
+Protocol bridges are specific to two variables:
+
+* *Backbone Protocol* Example: SMTP
+
+* *Protocol Implementation* Example: Apache James
+
+Protocols bridges intercept messages as they flow through the protocol
implementation's stack and hand the messages off to lower layers of the
architecture for security and trust processing. Each protocol
implementation will more than likely provide its own architecture, API set,
and configuration for adding custom processing logic into its stack. For
example: the Apache James SMTP server provides the [Mailet|
http://james.apache.org/mailet/index.html] API to write custom mail
processing logic and deploys the Mailet using an XML based configuration
file.
+
+Generally messages intercepted by a protocol bridge are in a format or
structure specific to the protocol implementation. For example the Apache
James hands off a message to a mailet using the [Mail|
http://james.apache.org/mailet/api/apidocs/org/apache/mailet/Mail.html]
interface. In most cases, the bridge will need to convert the message into
a common structure supported by the protocol agent. For example, the
[SMTPAgent|
http://api.nhindirect.org/java/site/gateway/1.5/apidocs/org/nhindirect/gateway/smtp/SmtpAgent.html]
requires that all messages are passed to it using a [MimeMessage|
http://java.sun.com/products/javamail/javadocs/javax/mail/internet/MimeMessage.html]
structure. After the message is processed by the protocol and subsequently
the security and trust agent, the bridge must inject the processed message
back into the protocol implementation's stack according the implemntation's
specification.
+
+The Direct Project gateway module provides protocol agent for the
following backbone protocols:
+
+* SMTP
+
+h2. Writing an SMTP Protocol Bridge
+
+SMTP bridges interact with the system through the [SMTPAgent|
http://api.nhindirect.org/java/site/gateway/1.5/apidocs/org/nhindirect/gateway/smtp/SmtpAgent.html]
interface. Although concrete implementations of the SMTPAgent interface
can be instantiated directly, the agent architecture implements a
dependency injection (DI) paradigm. Specifically it uses the google [Guice|
http://code.google.com/p/google-guice/] DI framework. Guice provides a
high level of custom configuration using Java classes (as opposed to XML or
other declarative configurations files used in other DI frameworks such as
Spring) to inject dependencies into other components. To facilitate the
instantiation of an agent, the gateway module provides the
[SmtpAgentFactory|
http://api.nhindirect.org/java/site/gateway/1.5/apidocs/org/nhindirect/gateway/smtp/SmtpAgentFactory.html]
to configure and create instances of the SMTPAgent. The factory has two
static methods for creating instances:
+
+{code}
+ static SmtpAgent createAgent(URL configLocation)
+ static SmtpAgent createAgent(URL configLocation,
Provider<SmtpAgentConfig> configProvider, Provider<NHINDAgent>
agentProvider)
+{code}
+
+The first and simplest method only required that configuration URL is
passed. It determines how to fetch the configuration based on the
information in the configLocation parameter. The second allows a bridge
developer to override how configuration information is retrieved and parsed
and to provide custom instantiations of the security and trust agent.
Unless your bridge has very specific needs, you should use the first method.
+
+As you can see, the only piece of information the factory needs is the
location of agent configuration information. *NOTE* This is different that
the protocol implementations configuration. The agent configuration takes
the same config format regardless of the protocol implementation. How the
configuration location is passed to your bridge is completely dependent on
how your bridge is deployed and configured relative to the protocol
implementation it is intercepting message from. For example, the
NHINDirect mailet used with Apache James is passed the configuration URL in
mailets init() method. The agent configuration location is set in the
Mailets configuration section of James's configuration file.
+
+James Configuration Example:
+
+{code}
+ <mailet match="RecipAndSenderIsNotLocal=securehealthemail.com"
class="NHINDSecurityAndTrustMailet">
+
<ConfigURL>file:///home/ubuntu/james-agent-v2/james-2.3.2/apps/james/SAR-INF/STConfig.xml</ConfigURL>
+ </mailet>
+{code}
+
+h3. Getting an SMTPAgent Instance
+
+To get an instance of the SMTPAgent, simply call
SmtpAgentFactory.createAgent.
+
+
+Pseudo Example:
+
+{code}
+ // probably declared as a class instance variable.. depends on the
protocol implementation API
+ SmtpAgent agent = null;
+ .
+ .
+ // get the config location... specific to the protocol implementation...
+ // assuming the location is passed as a string as is well formed
+ URL configLocation = new URL(getConfigLocation());
+
+ // get an instance of the agent
+ agent = SmtpAgentFactory.createAgent(configLocation);
+{code}
+
+h3. Processing Messages
+
+When your bridge received messages from the protocol implementation, it
calls the processMessage() method on the SmtpAgent instance. The method
takes 3 parameters: the actual message, a collection of recipients, and the
sender. processMessage requires that message be passed as a MimeMessage.
If your implementation does not provide the message as a MimeMessage, you
can use the static utility method
org.nhindirect.stagent.parser.EntitySerializer.deserialize() if the message
is provided as a raw string or an input stream.
+
+For the recipient list and sender, you should use the SMTP envelope's MAIL
FROM and RCTP TO headers. If these headers are not provided or not
available through the protocol implementation API, then you should fall
back to the routing headers in the message. *NOTE* You should only use
the messages routing headers as a last resort.
+
+
+Pseudo Example:
+
+{code}
+ public void handleSMTPMessage(String rawMessage)
+ {
+ String theRawMessage = getRawMessageFromHandler();
+ NHINDAddressCollection recips = getRecipsFromMessage(theRawMessage);
+ NHINDAddress sender = getSenderFromMessage( theRawMessage);
+
+ MimeMessage msg = EntitySerialize.deserialize(theRawMessage);
+
+ MessageProcessResult result = agent.processMessage(msg, recips,
sender);
+
+ if (result.getProcessedMessage() != null)
+ {
+
moveProcessedMessageBackIntoSMTPStack(result.getProcessedMessage());
+ }
+ }
+{code}
+
+
+h4. MDN Messages
+
+By default the SMTP agent automatically produces a collection of MDN
messages with a _Disposition_ of _Processed_ for processed messages. The
purpose is to indicate to the sender that the security and trust sub system
of the Direct Project network received and successfully processed the
sender's message. MDN is described in [RFC3798|
http://tools.ietf.org/html/rfc3798].
+
+The SMTP agent returns generate MDN messages in the MessageProcessResult
object's notificationMessages attribute. Because the SMTP agent is unaware
of the SMTP protocol implementation, the protocol bridge is responsible for
sending the messages using the appropriate process as specified by the
protocol implementation. MDN messages produced by the SMTP bridge are not
encrypted and signed per the security and trust agent specification and
should placed on the protocol implementation's outgoing queue or whatever
process will result in the MDN messages being encrypted and signed before
being sent.
+
+Pseduo James Example:
+
+{code}
+ public void service(Mail mail) throws MessagingException
+ {
+ MimeMessage msg = mail.getMessage();
+ // get recipients and sender
+ .
+ .
+ .
+ .
+ MessageProcessResult result = agent.processMessage(msg, recipients,
sender);
+ // check result and processed message for errors and move the
processed message
+ // through the James stack
+ .
+ .
+ .
+ .
+
+ // send the MDN messages
+ Collection<NotificationMessage> notifications =
result.getNotificationMessages();
+ if (notifications != null && notifications.size() > 0)
+ {
+ // create a message for each notification and put it on
James "stack"
+ for (NotificationMessage message : notifications)
+ {
+ try
+ {
+ this.getMailetContext().sendMail(message);
+ }
+ catch (Throwable t)
+ {
+ // don't kill the process if this fails
+ // but handle the exception
+ }
+ }
+ }
+ }
+{code}
+
+h3. Dependencies
+
+The following jars are direct dependencies for writing protocol bridges.
+
+* agent-1.x.jar
+* gateway-1.x.jar
+
+Transitive dependencies of these libraries may be required for
development, testing, and deployment. These libraries are available in the
public mavne repository under the group [org.nhind|
http://repo1.maven.org/maven2/org/nhind/].
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAlone.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAloneProcessingRelay.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAloneRelayFlow.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/JamesStandAloneWithGateway.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddAnchor.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddBundle.png
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,347 @@
+‰PNG
+
+
+IHDR A $ ±7ƒØ sRGB ®Î
+é gAMA ±
+üa
cHRM z& €„ ú €è u0 ê` :˜ pœºQ< % IDATx^í K‹%ÉuÇË_@Kï{ðÇð 0 / ? À #0x)
+^x 6Œ1x%ä• ž•4cdä
+FÈ i
+
+=, 1#ÍH#Õ¨_S¯îêWUwúž[uzNŸŽWÞ›™‘™ñ» ]}3^'þqâw#ò ñ{ßüæ7»/|á
+ |P P % ÎÎÎ ~ò“Ÿ
+
+|÷»ßínÞ¼Ùݾ}»»¼¼ìø 
+ ÀZ Æ ë„yÂ>
+È—§OŸ®µÎÔ
+ P ^Q@˜§ < *òA @ Ö ¸uëÖv4xpqqÑZÝ©/

+lgÀ[ ¢

+´ª lµå©7
+ ÀV ˆ# 
+4­ lºù©<
+  Ä P šV 6ÝüT
+ P â (€ M+ ›n~* ( ñ @ ¦ ‚M7?•G ñ 8xã
+¾49_û k· å£ÀŠ ð Ë}¯! ¬¡:e¢@
+ÄFyö| Š©Qã.a9© `N!ÂQ vR dª› ¢ œ Aî;º ‚;5/‰P r
+Œ A[6 ̵ á(€ U ‚R Ø
+ {>6]N ÀH°Š{P(
+¬_ ¾× ûŒèRÓè¾Ê Á¾Š P X
+ظ&X,% Q –ª@Ÿç sq¹;¼T/Àn @ Ù*Àtx¶Mƒa(°\ B7+¦>Wª
+ ,UŠx(€ «T ®²Y©
+ @© @°T)â¡
+¬R ¸Êf¥R(€ ¥
+ ÁR¥ˆ‡ (°J €à*›•J¡
+”* K•"
+
+ À* ‚«lV*
+ (Pª ,UŠx(€ «T`' ž u¯½öÚ‹C¾ç> ? / GÃß ÿýW²É¥ÍÙ×7ÜÖ?ôÿ¾ù ?fã ¿øÅîÛßþö E óôm3u[MVQ
+Z¤ ;AP d;Ø | ­|‰ãçâh¸tbÿÉ¥Í Ø3Bm
+
+
+v_ûÚ×’VçlÌ¥ï)I4:
+JIò C
øÖ[om!( HþÊ÷ܧ R¹8¶Sû2sisöí ^£ì’2cq  %é÷ÑĦ ‚C)I>c(° Õ©í´Ø '£E ±É!#ÅP§+‰ êL
+_éÌú å/å~ùË_Þ–- ?úè£ ñõü½{÷¶çttûà þpû]ë&ñrŸ Pô¼Ö_ó
+Å÷çÄ®7ß|ó
+nRgµµtú ƒ 
+ –ؤqDGÕOlT»T§\»öm«œþ„£À>
+ô† t ;úÓQ¡ [èù «Æ–Äñ Ó¼¤Ó)Øb T;}ù
+Îwß}w›‡^_Ôzè S¡(ñrŸ
+ 5\ó. ŽBÆÚ/À‘O_ †â
+ íµÜ ›BùÈ9µKl+iW_V®­rú Ž û(Ð ‚rAÝÂC Þ^h× Œ D #éôS ' A9¯yêÈÍw,Í_¡§S@ ‘‚TGC
+
+½Þ¨Pô£œ Ø9 ª6
+ >À‰ÝtŠ•ií‹AKÏ«v ¬¡ôþ‡FëcáÕ§]û¶Õ> NZ È)Ð ‚ ‰Pç²7+4\;phÚ\ ' A Sp¥ò÷¶Z;}z f÷™
+Ç bÏ{ •@Ðþp Ð-°Re¦ ¦a’—Ø j³ –Ä)i{ ×T[å
+™p ØU ^ ÔÑSl„¡×Ü|'OAJ
+O]_ô E¿ëHDáeGš©Q ¦×Q­þÕÑ¢=_"ln$˜ƒy
+j +©›Â:w
+¯¤œ˜–%`Þ%NIÛ—´UI; vQ  u áŸÓÓëg:MÒ©¨~W¨„¦Ã©8% Ú 0”¿½yâó³Ó9
+ ÙkqöFJJÜ]!¨ù‡ôÉÕ½ÏtØç¥í ¦l* `IÛç¦Ã»82iP`W zAÐ_gÓBu ¥w?c º-¤Jâä@
á2Ò°St?Jô£
+ÿlœ¦Õk
+z-0ô,bLä¾ ´w}½}ZF(޵ÝÖ9öˆRîš ½éSbS KÚÕç K3ÕsŒ»v
+Ò­C b Úi ¿Y
+“ &¹GdJâX™c°Ñ ª
+¬¤“ ½á zKB¡§×Üt”Tòìclj™;o ûB ‰¦j›ÔË>"#ù«v rÇ ¥L ±Ä¦ ZÛb G
+ò)i«ut9j17 Š!87ñ P †P ¡"y 
+,V ¸Ø¦Ãp @ ! ‚C¨H
+(€ ‹U .¶é0
+ P` €à *’
+ Àb ‚‹m:
+G B 8„Šä (°X €àb› ÃQ †P ¡"y 
+,V ¸Ø¦Ãp @ ! ‚C¨H
+(€ ‹U .¶é0
+ P` €à *’
+ Àb ‚‹m:
+G B 8„Šä (°X €àb› ÃQ †P : ýjÐZ©Øù!*M
+(€ ( 
+Ì ‚!à Aœ P`
+ f A©¨‡^è{l
+MoÓä6?Ê•7
+ø” (P_ E@0 , »Ð÷Ø ›Ñf} Ä ¨­À, øüùóN Rèÿz®$žÍ#—§ ëËáûU»p Á >P ~U¯ ZAcÐ
+ ·[HÆ`™ƒ ß†rŒÆ%O  ôó š@œ|$ Õ={ö¬ÓC %ÿ׿þÿ}Ârqm¹üÿó6@
+´˜Â <
+j pR ÚJ[è]^^vö Þ¸q£»¸¸Ø
+þÿ±0 7”Vó
+ŵaüÿJ{ 4Ø× |ÿ–ï ²–
+5@8 C 1 xVä§OŸvr èôÿú]ÏÙ°P<Ÿ.”O. MÃÿ¯Ú„
+öñ ÛÏ Œ
+Ú œ ‚
+€*€Š"Â>yòd{<~ü˜
+ð ú€öqéïÚ÷-
+k pR
+õ- ~
+¾G
+ur<|ø
+ð ù€ömíë D
+a „SN‹G‡ Ò]‡½Raù ° Tð ŸŸw
+<xé¸ ÿ~Ç øÀò|À÷eéß2À‘þ.0ô
ôSã©@8) = ; 4À Úõ uà´j êµ?q~¦¾Lýñ 6}@ú¿Ž ev¨w W A; ¶£@©¸
+‰E„££# 4À ô éÿ:5¶× eZ<% G ‡ ¨£@ùõ Ž 9Ð hÐ t&X{4X ‚B ¹H
+ ù àG°] þ/
+
+Èà¨Ö”xR ê
+a©´Ü9 NNN8Ð hÐ ¤ÿ
+ ‚‡ × '‡ 
+}e*¬ <==í8Ð hÏ ‚Â á †ü à Mù@s Ô ¤ýHðìì¬ãxU y§:¥K.
+Mñ«¹û@ ‚‰ÕÞ
+ö ”7 D„’7 ¤Ã‡âùµ }œ>á);|>1{Jê2Tœ1l ÕSÏ
+a÷ 6 a yÔy Eû¿ ÁÈ+r) Z öñrß%mIÇ
+Å)I7fç »ü1ò #Ï15&ïqá ¯G‚þýBÿ]:ŽœÓ¿6ÜŸëû=–ŏXÙÖFkƒ Y¥l÷¶„ê’Ëφ‡ÊÒðœæ)]R6hº
+¹t%6 çå÷ê—® ¼† <'”:¤óH¸þµqý¹¾ßcùz{rek OÙæË*ÉSóë 7”&d_©îûÖ)—>g áéþ±d}€à5 Sï Jçµá¡ï~„áã§Â%®Ï3dO(Ž=—
+×<Sõé æíΕ_RG_ï\ž¡:åÊÉ
+ó q[ï Á ˜ê¼%
+¹¤cz æà
+ƒk Ðõ lȾ\ú
+pbÚ•h¡qJÀš³ƒðõ‚ ^CP [

+u8 OÂ}:{. .iCqRyÆì,IãËJÙÚ§
+¹:äÂ÷©S®ýrí•JOØÕ"Ãk=€à5 cËéKÇ
+
+Ùó¡8}Â%ÿX9¶ì\œœ
+šW,^.½ × ‡\¾©ðÜ6 9›Jò Ù +—ðv¶—h
+‚úÚܾ ô£E ¯ÒðTçÛ ‚
+X[~
+ê%ÀñùÄÀè Y
+zo[êG(V§”Ö š9= a lîaiy1ZÞ
+ôoŒèæ+ü½ÚhŠ
+Zñ æ^›‹ApŸ-üHË øÀr} Y ʯœ]Jkß IÏæàøÀ2} É¥´ÄY ‚º¨* ¼L ¦Ýh·}} ÉEU ‚z]PDÐ=Gù{‰ ›ëÆøA; 4»¼¾Þ
+Ñ –t¯Qþ>Û.!Ä ­ø@ -ɾ¡©Í–D„V œz 7|àe hbËÍ u¯
+ð v} ¹Í×å—Ðî?¬ÛoÊÔXÞ •›%~y Öt wM7ôEß±|À÷eéßÒÏu¯á §^UZ j£n´$ „Fƒ! ê†ì
+D^œ_ï‹ó´m{m«ï?ëÛ@
+€5v™S>M
+A¹>¨£A ¡.»¯OÉóÊT ¯LÑÎíµ³öq¹
+¦ ×èÓ v (œ˜ò3 íhPA ‚¡ ‘· –û mGÛÅ|À>WháW €“M‡ý´Ø‚ÐÂÐ>#¶ïƒ˜¤ça^|`
+> zöÓÞ)×'H¦
+ N:
+¶C[[a C
+!à1 | 
+ ð,˜r
+lËšl:œ ¡ ƒïÏ_<_‰ hÑ‚ Ô àäÓáPE[h`ê Èð W} &øª Õ ¿ §ý>¤@’oè * Èrm=Cÿ/-+e NK[F,ŸR;ˆ‡ kT Êt8 ¤± . È> ÊÙmËß D%öï 'g?á(°f f
+AíØþo
+X¡‘djt G
+X¡0Íß;‰=ŸË3–G Ì%p-‰#åì ç5w
+êÖŽ ³‡` ) ö HÉÔÕÛ ³m—x) í3Ê+
+`;.OMQàe ªCP/ Kgõ ý¹Ô÷PúTÞ º&hóéSÞ.érõ+±ßÆ ÕÇjšÒˆ
+÷ܼ™Ú æ ã*
+‰½/ =ÔJ: ®Ì) èÁUª Ö7 Ê\ݦvxÊ ²) ¨ ÄÉ! {XZ:­ PÖŸË}·émÜPÞ 7Wfª¼!ÂbvåtÐð\
+ûèÅCÊí<¤<—¶nòai[iÛ òZ tXÿÚÜ 7^¼h-¯@¥¾÷ Óש| _FŸ<mÜÒt¹úÙ×¾rqsu
éÇkeóx­lííÀks×ãÜ U
+ÛAíË×Ò±ýËØrÎ
+>¾†
+ÎçòêSž ú
+²3 /·ø@¬Þ’.d»?ïµ³ZÅÒçl"œ J} é < -üXJ«½%•XF«Í6oz)-
+ _>K—Ù×N¡
+/²èf{‹nÒæënó¦ Uµ dy}–r k)wò Ÿo±¼¾» ì´»Á mOÛ‹ 4·Ñ’.©¯ ,éæËL
+Ö= ¢}iß 4±å¦¿ ¨7AtS% áèèˆ
+ð } ‰Í×C ÔQ ü2ˆ ÇÇÇ
+h€ 4è : ”A‘pA I5v õ ‘ åN‘ìA
+ ù àG°] þ/
+
+4 A}$F*-wŽD„““ 4À ô éÿÂ
+ ðaõ#A©¤
+}e*¬ <==í8Ð hÏ ‚Â á †ü à Mù@s ´w†íHðìì¬ãhK Y,£Õ6o¹î¾ÍC NØÍاXbk² #
+‚ò„¿ˆàŸô '‰=ýŸ
+“4¡ðØÂ©¥o øô¥éBñröï“w¬<kÿ ºælMé6„ »¶K‰?ìš·j²oÝC6îâO%:Çâ¤ü&W¿RûµÿÛé0 Ü€, ³\GÎ
+÷ ­ ƒj ) í’v—4%¶çtË
+÷ ªµ§¤s¦ê\R·>šålëcoζ’¼rqrí’
+÷°îÓ?rõë k x= ôï Êw ºÏy Kgó*‰ *;V†ÿÕKÙ
+*»$}ÌžTÚXYcéšÓØÚ£ÿ·ö{»úê²k»út%ºíc[iÝS>Xêï)M¬
+¹¶Ë
+—” ª ¼† <'ä µÏy Kgó*‰ *»´
+Ÿ¿ý^RvI
+±% /—vL]s {
+úê´kÝRm Ò1§k.<ç·
+Д^¹ºîê‹¡t¡vð ïÓ¶¥}YŸ –‘cóÓáÐ;
+Ò }ÎkÜXºT¸oðP
+6Nî=X›Þ畳Oòöé½}¹ºÄìK• ³+§‰ÚhËŽÙíë ªOÎ
+›¦¤ì¾þ´ í%¶ù6
+ùI‰Ïåtе›o§Ô÷ Oæì/í Œ ¯G‚}`·K£ç 8 µ\ƒ§
+ó ¶ Â1 JÒ† ‘«Sßð’ø© ‡’Ž–k§œo”úY
+±6MÙ×§î¥vÆ~LrþžóÉ’ú—´w‰}@𠂺آý+
+Ñç¼Æ ¥“ðTX¨¬Ø9›O(Ï>6ôM_¢Qß8%ÚôÕ.W¯]Âsm4„ 1-rmÞǶ\Ýûø}®Î¹ðP}söåÂKú¢Æ ‚×
+-µ.B÷9¯qcé$< [î=”ÆžË
+û|}ü¾ém~¹´}ꛋ›
+ÏÕÓë¿‹íûèÞǗƶmßüs>Ð'<Ô/†²¯Ägš‡ ¾6WÚ DT{øÆN

+AM +7 Þ ÄÞî ç±Ðï£I Âûêšú éc[È úèÞwß’\;íSö¾š–øò¾e¤ }Ëïó#cã6÷°´¼
+zwX7_áï“íJ
+hЊ 4÷Ú\
+‚¥Ûõ ­
+ñ uù@³ ”_9»”ÖÚ7ž¦~lpŽ „} É¥´Ä ‚ú°$ $ð 6} ÉEU ‚º¦ ˆ  ±ó÷ -6× ñƒv4hvy}½9"Sb A–Íá@ | = hb£%Y
+,µÙ lÏñ
+m®>ÐÄ–›1 ê^#" à íú@s›¯Ë/€nÀ® Ô=ˆå]C¹Yâ—Üé³.
+q¯Öcä@ƒ9ø€ïËÒ¿¥ŸË¥0ÝfS8`·ÚœzUi ¨ º²´. í§Ä! *
+E ÜËò„?D£Mg –£ ¾/¬oŒø ` ]æ”O“BP`¨£A ¡.»¯OÉ÷}ý‰ø ƒïY£
+ºÌÍ ´ ëèOG€
+€Â‰)?“@Ð^ T †`¨@äÍ€u½ @{Òž |
+~v
+<5 '› ûi± ¡
+¡}FŒ hÛ|€–v__»‡žý´O èå² œ
+‚~DèaÈã <> ´ã ~µ X ‚! z1øþüÅó•h -øÀ”× }Y“] ŒU²
+ ¦Ž€
+ xÕ j‚Ï–]
+‚bŒ_ÄÑ (aû~†È#dƒµ{ ­}ÞÖ1ÊØÇVÒ¢ÀÚ ¨ Á  Æ‚Ö ‚Õ®ùÇê;¤ Cæµk=I‡ sT`ö Œ Œt ©¢j<
+9ÅF“©xvTêó/ –Žâ¼
+ÖæPXÈ–P=ý¨ÚjããÇF˜ÀrŽÝ ›ÆT`– Ì ÌÃ*öÝ rŸx% LÅñSÞØ x¨ó± ‰ PÇt2òF 9+P
+‚rÁØ_ ´ ‘%L¿Ûÿkº¾a»æ ³)vÁ{×rbõMéPbC©Ž\Àç&ξ>0gà
+l« ÁœÈ% X cp/ d©
+жÜÐ „·ËÛ“k  e© , ˆ“CЋ'
+Ð? kÏÅþ/iv ó啿am
+Ùœ³'•¾¤¾);5ïÒºÅìçAåv
+T
+³­çò t)€'
+  Çv\ÿZ tR}}êÆ ÑÿÇÂ$m* }5«4 ÿ:—MçËË}O¥-±»4NI¼ ­¼º¶¾WׯhÓ¹¿ 7; † ¨"Jgµ‡}á^ÎûïzΆ
+âiºÒx _íÐÿ§^þ Ùl˵ù
+ìI•™³Û×9——ϯÄ6 ?`ñƒœ XÀjŸÖAŽí÷¥Pš:Þ$#A @ JÅÓ Ve© >ËÿH'î ¿oܱóïk ñY
+kŽ>0×%²Ja:) ýòYvué’EUýˆqèE5ÇÎ h{Éo9‹Š®µ­æ¼Xêl ¨£@
+
+³¼>K¿ÏaéwlØÝ —²lþ,!è Xj$ñP ¥ÀååEw~ÿ´;;¹×
+ß Åq÷Ö']­Ãj šÜ?=Úê#:Mõ™Ã J¥u
+}:lG‚
+A½ö÷úë¯w
+h° ¼ûî»W <¾Õ}å«ßêþàÏþ¶;øÃ¿æ¸Öà÷ÿäõî/þþ ݃³»ÝÓ' J¹°w<ÝHÉn¢¤,Ø;ó 3 ‚! ÚÍ×÷q~Ò O  \“’‘Ž ðO¿òõî?~ôË »È²³ûÙÇ·¶º|
å«oO: Ô
+åünrs áä ÔQ \(V -ÛͰ¾– zQ^ (#Àï¿ÿ
+ £Ý¼†úòÃÊÏ6º|¸ÕgÊ ô樓 «@PœWö ‚SºåúÊR Êu/™ ?{v¹=®
+ÁºàØhpqñ´{øàl«Ï” éßÒ>2è™û”xR ê#1"ŽÜa ‚Sºåúʲ#AéäW õ>áx¡Áãî|
À“£;“CPú·BPÚ¥æ¾Â9ÏŸ
+‚2D–¡2 Ì5
+á9 < ?~´™‚É4ŒC4xôè|
{½ô³;ŸV  N‰  Ùp]oŠ Á\÷&¼D Á‡ l~`帟= ºÐQ’v)qÎÏϺӓ»ÛGu¦ž Ë n¼ØÞ
+Ö Õ –toâ”(ð* ~g› ˜> €¡8±ó¹üæ ~~~º à
+ ]
+‚Òÿí&ë%í;UœÉ¦Ã
+‚òÄ>× §jæu–ó* Ï67Üä8Í
+ »P¼Øù’<ç çÁƒ“îäøvwçw¿š
+‚Ò¿íH nÖþ ‚ë QÍZy *„¤óç ](Ž=¯ÿ÷çì4Zóðù¥¾‡ÒÛ|Rá¹zÙðû÷ »ã£[ÝíO `ÊO ÖìÅ”½—
+‚
+ éü¹#vMЦÓ8zN¾û|õœ ‹}OÅK埫O(üìì¨;úìwÝ­Ã &<
+ îÕ
+I\S }! ‡ Q l’> ߃1•§‡n
+²@p<O ‚ãiKÎ#+ð* 7S\
+e +0½ Ïž÷qBiBñõœÿ«åÙQ¨µ!>:Í×'T—³³Ï6#ÁO7#Á 2
+¹7’} < Òùs‡ ' Çž÷qBiBñõœÿÛ·¼\
+rá§§÷ºÏî
+v¿ûí/ à
+!ÈÃÒU¸±ªB= å ˜
+§§Ÿe T(ž=ïã„Òäâô /É¿¤n çdó:á½»‡Ý§¿™
+‚þ9Aî oî Ëk3<,½* U¯Ì« ¼ Ê (wĦž6Ý ”^Î˧
+
+÷É£Oþj ÿ «ëÉæAé{w » à/& ò°ôu÷ðKi ÁêÜX•
+‚
+ éü
+w»ãÍ3‚wïü¦;üäC 8‡é°Ž eU PX ‹ªUÆCð
+|w8®5 g ïlÞ ùí'ÿW ‚, °é ±U¥YJ« 7VU°‡à½»Ÿvw7×Àä kaò½ÕC4¸}
+À_ýò &‡ KiE¦Ãrq”EUWÅ¡ª•Q >8;îd ùïÿç uŸ|
üA÷« ~Öýú£ ¶ÿoõ ú ü‹Ÿv þï wßùÞ÷¶úLùaQÕ ýòú ~øávzÌ ;ûÀùýîÏÿî Ý ÿÕ?u_ÿÖ¿u üøfóÇÏ ü^÷ó ý û× ÿN÷G_úÇî/ßü—) ¸íϲXJóËë‹ê© –
àÛ |æ‡SVO~òø~÷7ÿü -¹M¦d ø¥ xk £óI!¸”¥õE”Qß ‰APW˜ž´U(
+ P`2 ØrÓHÍæë»orÍ áh7G `óõ
+~Kü”ØoÂ.Cg9tj$ U9Ð ˜¿ hŸÕ>ìG€sÞ[DQ6útØN‰ †²ºìÕn`—Û5 u A Oï
+« ü½úqà@ƒ9û€ö]½ ¢»Ëy JÿŸãg †@ ‚¡ ñj×0 4À –à :˜ñð³ËéÏ €“Ü ±ä·›B‹@zèÈÐþµÂòÿ« 3 ÌÉ BýÖökÛßç8 œt:
+ ¡N ­püÿó ´@‹%ú€
+ßœG€Õ è§Æ^0¾? ñl%Z ÅÒ}`Î#Àª L
+—ÞèØ ¸Z÷ %€ÏÚ8Ù ‘˜0¯½öZ :ú ©éû¤IÅ•üJ>CÇ+)s »ÕÞR»÷µ'”¾fÙcÔ‡<—¯À,
¸Og £S•æ9t¼}Ý)e
++µ{_{R?|cåM¾(ÐW Å@ÐŽ µ’þ\h¤ J KoÏËÿs#Ì X|š »KÊõe
+lë
+ÁXýbšùücõ/Õ××»¯ó †P` ,é|!h•¦Ó´¾óæ:i L¡4©QX, ˜í}ê ³? êTÜÒ°Òzz½‡pdò@ ] ˜ íÈCÿo/.˹Øw –Š'éSqKË+±#UV®.¶!C#[ßÐ)ð”À+ô ²! ®>ÐKÙ½«ó’ †P 
+ û ' É
+ }Z_v_è Á˜M!@Æà š²Æ¦Ã©ÑãX ´#ó ]1[‡pjò@ >
+L Aÿø€t ÿ@¨? Š£ilXŸt©2Kó)-; ÏÚQ Á Ðæ Á؈’épŸ.Jܱ ˜ ‚¡×æ¤ãú×oäœ}=èÆ Ñï6, Oò+ ›ËGmÛ%?M£u¶õ·°T­rÐ[Êt87
+ÛÑÉ b
+L Á
+xú¸À¾<.ßõðçciä|,]*,TvèEv /•ÆÛmm²°W êèÐ^[ô£*
+J ûLyK¦±¥SñP¼ÜµEº*
+L­À$ ô d)­Ï—†šj ¢9]ƒ›“-Sw8Ê›Ÿ “BÐ/Ÿ¥Ëì·º¨êÔ
+RÎ >s°a~Ý ‹j*0: Y^ÿå%â×¶4yMç¥l B I!è—Õ?<<ì8^Õ`I›Ô
+á„ä 5 ¨ A]F_ È> /ï#!š,i»ÂšÎKÙ(0„ £BÐo°¤Ëçë¦JÒá ŽŽ8Œ ¢É’6®
+Â É j*09 u (#@éðÇÇÇ
+F
+
+3 ¬Ù-(»% ª@PF:ççç@0ð mD#ùÁÐÍkì¦5-9(uE ± ˜ ‚úHŒtp¹K*
+þää„Ãh šˆ6
+AÑl {·Ží¨ä c)09 eš'Sa
+àééiÇñ¹
+AÑH´ ‚c¹>ù¢À• @pf ‚tM ˜V É hï
+Û‘àÙÙYÇñ¹ ! Šv\ œ¶cPZ;
+Tƒàýû÷·× åoè°/ßÛÿÛ¸>N,¯% WMìt ¶Ó!©éô
+Ì ‚10êy   :·$ Ú 8}g Ä6 ¨ Aÿ.mì» Î†ùï :Wšÿ\â1 l³#Rëz
+T‡ < Wr àrñJâäò¨
+ ëu JnS ê ,ywXà–‹W '—Ç
+Â `›
+‘Z×S`ñ Ô›#s Ø 6 Áz ’ÛT : uaÑØ_ Ü.a¹|ç ÛìˆÔºž Õ!¨«JÇþ
+ Ca±ó¹üæ
+ ëu JnS j Ô׿rPJA0ô,a.¿¹‡ó°t›
+‘Z×S`2 Ê" ò
+¬ wX7 âï“íª1¼6W¯3Pr›
+T‡`h+Ë–Ï Á6;"µ®§Àä ”ÑŽ]JËî»Ëÿ/^Œ YJ«^§ ä¶ ˜ ‚ 9
+ .ª
+ø.¶
+§êÁ¢ªmu@j[_ * Ôë‚Òáu#vþ^nµ`yýú
+ÚR`r êÍ ™îI‡—%¢8>×€ –Úê€Ô¶¾ £BPª ÚqÎn¹ _þ `ËÍú
+ÚR 
+ u¯ 6^ o>ÏæëmuBj[W I!(£>¹î¥«LëˆP¦ÆòÞ­Ü,ñKZ-m=Àœ½¾~Rg©»î5
+ «J×í$”¾n F‡`hJ
+ ¡nÈ®@
+b1‚¹ç¡ï/ë[,
+€ì2·îÎGíæ¡À¤ ”ëƒ: T ÚQ¡Ž
+çþjÛ öé›2r‰@ “Ñ;åv (ÚñA ^ I hGƒ

+ ˆ-½1bŸ ´ð €Ã;;9¢@H É ¡
+¡}Vpí Q‡ž‹´wÊõ®:#@:.
+Œ«À¤ ô ´£B
+•¹zTÆÂ ŽëüäŽ ¢Àä
+ Ðw|¾?ßÂ
+ Àø
+T  ­ À» ž
+ã79% 
+X ªC æ@ @ š
+ ÁšêS6
+ @u ªBðà t
+ËÓ º×b
+
+¨ Ľ ˆ ô?²B ê
+ A «wC
+¨© ‚@°f ¤ìê
+ A «wC
+¨© ‚@°f ¤ìê
+ A «wC
+¨© ‚@°f ¤ìê
+, ‚¢Tî™ÂTœPXJý\Y}Âcv
+Êï“oi\[~‰Ž¹|«{-  À€
+, ‚Úqs
+¸/ mgÏå C*< AŸn
+;€à€=†¬V§Àâ!¨-"0ñ I
+•ÀÇÃ7”¿ ©-Smòç4Mlt
+ Á,•wèÇ#¦Q ø®® P¡¦ X4 = b#ž (r#Á ÐbiR€Üu$˜Ë3U_
+Ò’x¡ ‘Øè¶é
+CåW§Àì!˜ Á.P
+uîܨ,6ÒL êra1oê3
+Å-Õ,7² ‚«ëïT( À" èíÞ c@05õ
+k$¸Ë @hôlõ-¹öIOB 5)° îÛÙK¦zûŽ S× ç
+Á è
+궦N@]ÚV`Ö ÌÁ£tÚ7 ûØ2ä ¦Ãmw`j¿¿ ‹† Ÿ‚†@T:Õ+ ö)/t׸dD•‹Sr)
egJ£ÒQáþnG (0 f
+ÁÒNI¼i f ûb
+ì¯ äµ¹ì›8¹ÑéþnH (PO `½þGÉ3P A 8ƒŽˆ õ ‚@ Öë ”< € ‚3舘PO
`½þGÉ3P A 8ƒŽˆ õ ¨
+ÁzÕ¦d @ ¸R â (€ M+ ›n~* ( ñ @ ¦ ‚M7?•G ‚ø
+ @Ó
+ Á¦›ŸÊ£
+ A| P i €`ÓÍOåQ € >€ (д @°éæ§ò(€ @ @ hZ ØtóSy @ ˆ  
+4­ lºù©<
+  Ä P šV`
+Á‹‹‹¦E ò(€ m*ðôéÓ«õ o߾ݦ Ô P i nݺu Á›7ovBD>(€ (Њ Â<aß ‚òÏ{ï½×
///[Ñ€z¢
+4¨€0NX'Ì ö½óÎ;ÝÁÛo¿½ý ø >Ð’ ûÞxã îÿ ¥ý
+NÆ‹hÒ IEND®B`‚
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddCertificate.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddDomain.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddSetting.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAddedBundle.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigAssociateTrustBundle.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigBundleAnchors.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigDomainSearch.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigDownloadedBundle.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigEmptyBundles.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/images/WSConfigSelectBundle.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/images/WSConfigUIHome.png
Mon Jan 19 15:29:14 2015 UTC
Binary file, no diff available.
=======================================
--- /dev/null
+++ /java/tags/gateway-4.0/src/books/users-guide/preface.apt Mon Jan 19
15:29:14 2015 UTC
@@ -0,0 +1,13 @@
+ -----
+ Introduction
+ -----
+ Greg Meyer
+ -----
+
+About this Document
+
+ This document describes how to implement a Direct Project protocol
bridge and how to configure protocol bridges provided by the gateway module.
+
+ * {{{./dev-intro.html}Development Guide}} - This section describes how
to develop a protocol bridge specific to a protocol and protocol
implementation.
+
+ * {{{./deploy-intro.html}Deployment Guide}} - This section describes how
deploy and configure a protocol bridges provided by the gateway module.
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/smtp-depl-wsconfig.confluence
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,217 @@
+h1. SMTP Agent WebService Configuration
+
+WebService configuration for the SMTP protocol consists of an retrieving
configuration parameters for both the SMTP agent and the security and trust
agent from the configuration service. The configuration service exposes a
web interface using the WSI basic profile (i.e. SOAP over HTTP) and can be
accessed using a simple URL. Example:
+
+{code}
+ http://myserver/config-service/ConfigurationService
+{code}
+
+Many configuration settings is persisted in the config-store
implementation of the web service, typically in a database. Unlike the XML
configuration where settings are managed by editing raw XML, the settings
in the web service are configuration via tooling through a web application.
+
+!images/WSConfigUIHome.png!
+
+Several aspects of the SMTP agent from domains to certificate storage
locations can be configured through configuration web UI. Certificates,
trust anchors, and trust bundles themselves can be stored in the
configuration service and accessed through the web service interface.
+
+Configuration or the SMTP agent is separated into five components, however
they are related to each other:
+* Domains - The list of domains managed by the agent.
+* Certificates - Private and optionally public certificate storage.
+* Trust Anchors - Trust anchor certificate storage for course grain anchor
configuration.
+* Trust Bundles - Collections of anchors published by trust communities.
+* Settings - Configuration settings for numerous components of a HISP.
These are generally higher level configuration settings. Fine grained
tuning is available via the [OptionsManager|
http://api.nhindirect.org/java/site/agent/1.5.4/apidocs/org/nhindirect/stagent/options/OptionsManager.html].
+
+Domains, certificates, trust anchors, and trust bundles have specific
configuration elements stored in the settings component.
+
+h2. Trust Bundles
+
+Trust bundles are a collection of trust anchors that are intended to
represent a trust community and generally meet a common set of criteria to
be included in the bundle. Trust bundles are packaged into a single file
using the PKCS7 standard and distributed via a known URL (the location is
discovered out of band). Trust bundles are configured in the _Trust
Bundles_ tab of the configuration UI tool.
+
+The Java reference implementation treats bundles as wholistic objects and
does not support exclusion of anchors within the bundle. This is partly
because the definition of a bundle indicates that each anchor within the
bundle meets the same minimal requirements. The decision to include a
bundle becomes a simple binary decision, you either trust the bundle or you
don't.
+
+Bundles are configured separately from domains as opposed to the importing
of anchors per domain (as you will see in the next section). Each bundle
is identified by a name and its URL.
+
+To add a trust bundle, click the *_Add New Bundle_* link from the
configuration UI TrustBundles tab.
+
+!images/WSConfigEmptyBundles.png!
+
+The Add New Trust Bundle dialog will display waiting for you enter in the
following information:
+
+* Name (Required): A unique name of the bundle that describes the trust
community of the bundle.
+* Trust Bundle URL (Required): The fully qualified URL where the trust
bundle can be retrieved.
+* Signing Certificate (Optional): If the bundle has been signed, this is
the certificate that signed the bundle to validate the integrity of the
bundle. *NOTE:* It is completely optional to validate the bundle
integrity against a signing certificate. If the bundle has not been
signed, the signing certificate is ignored.
+* Refresh Interval (Required): Indicates the frequency that the system
will look for updates to the bundle. If this value is 0, then the system
will never automatically look for updates, however you can always check for
updates manually by clicking the refresh button.
+
+!images/WSConfigAddBundle.png!
+
+Once the bundle has been added, it will appear in the table of bundles;
however, some of the fields will be empty. This is because the bundle is
downloaded from the provided URL in the background and information is
updated in the table at a later time.
+
+!images/WSConfigAddedBundle.png!
+
+If the bundle is successfully downloaded and optionally validated, the
table will be updated (you may need to click on another tab and come back
to the trust bundle tab to see the updates).
+
+!images/WSConfigDownloadedBundle.png!
+
+The table contains the following information:
+
+||Column||Description||
+|Bundle Name|The bundle name|
+|URL|The URL where the bundle is downloaded from|
+|Checksum|A SHA1 hash of the bundle|
+|Created|Date and time when the bundle was configured in the system}
+|Current As Of|The date when the bundle was last updated in the system|
+|Last Refresh|The date and time when the system last checked for an
update. If a newer/different bundle was found, the Current As Of date is
also updated. If not updates were found, then the Current As Of date does
not change.|
+|Refresh Interval|How often (in hours) updates are automatically check|
+
+If you would like to see the anchor within a bundle, simply click the
_View Anchors_ link under the bundle name. This will display a list with
the _Distinguished Name_ of each anchor.
+
+!images/WSConfigBundleAnchors.png!
+
+
+To remove a bundle from the system, check the box next to the name of each
bundles that you want to remove and click the _Delete_ button. If you
delete a bundle that has been associated to a domain, the association is
automatically removed.
+
+During the operation of your HISP, it may be necessary to updated bundles
in between their configure refresh cycle. To manually refresh/update a
bundle, check the box next to the name of the bundles you want to update.
The update operation is a background procedure, so the information in the
table will not be updated immediately. You may need to click on another
tab and come back to the trust bundle tab to see updates.
+
+h2. Domains
+
+The domains component describes the list of domains that will be managed
by the agent. Domains are created and maintained in the configuration UI
tool.
+
+To create a new domain, click the new *_Create New Domain_* link from the
configuration UI Manage Domains tab (the first page after logging in).
+
+!images/WSConfigDomainSearch.png!
+
+Each domain requires the domain name and an option postmaster address.
Enter the domain name, postmaster address, set the status to enabled, and
click add. Optionally, trust bundle can be added at this time by clicking
_Select Trust Bundles_. If you choose not to add bundles at this time, you
may do so later. *NOTE* If the postmaster address is not specified, the
SMPT Agent will default it to postmaster@<domain name>.
+
+
+!images/WSConfigAddDomain.png!
+
+h3. Anchors
+
+Anchors define the certificates that create trust between domains.
+
+Each domain must have at least one outgoing or incoming trust anchors.
Anchors can be retrieved from different source mediums including the
configuration service. The anchor storage medium is configured in the
settings page of the configuration UI. All settings are configured as
simple name/value pairs.
+
+!images/WSConfigAddSetting.png!
+
+*Anchor Store Settings*
+
+||Setting||Description||
+|AnchorStoreType|The storage type of the anchor store. Valid types: \\
\\WS (default): Anchors are stored in the configuration service.\\LDAP:
Anchors are stored in an LDAP server.\\KEYSTORE: Anchors are stored in a
local keystore file.|
+|AnchorResolverType|The type of the anchor resolver. Valid
types:\\Uniform: All domains use the same anchors for all
addresses.\\Multidomain: Each domain defines its own discrete set of trust
anchors.|
+|AnchorKeyStoreFile|For keystore store types, the name of the file that
contains the certificates. This can be just a file name, a fully qualified
path, or a relative path.|
+|AnchorKeyStoreFilePass|For keystore store types, an optional password
used to encrypt the file.|
+|AnchorKeyStorePrivKeyPass|For keystore store types, an optional password
used to encrypt private keys.|
+|TrustAnchorLDAPUrl|For LDAP store types, the url to the LDAP server.
Consists of the protocol, host, and port. Multiple URLs can be define and
are comma delimeted. Example: ldap://somehost:389|
+|TrustAnchorLDAPUser|For LDAP store types, the user name credential for
connecting to the LDAP store. May be empty if the LDAP server allows
anonymous binding.|
+|TrustAnchorLDAPPassword|For LDAP store types, The password credential for
connecting to the LDAP store.|
+|TrustAnchorLDAPConnTimeout|For LDAP store types, an optional timeout in
seconds before the connection is failed.|
+|TrustAnchorLDAPSearchBase|For LDAP store types, the distinguished name
used as the base of LDAP searches.|
+|TrustAnchorLDAPSearchAttr|For LDAP store types, the attribute in the LDAP
store that is used to match a search query.|
+|TrustAnchorLDAPCertAttr|For LDAP store types, the attribute in the search
query result that holds the certificate file.|
+|TrustAnchorLDAPCertFormat|For LDAP store types, the format of the
certificate in the LDAP store. Valid formats: pkcs12, X.509|
+|TrustAnchorLDAPCertPassphrase|For LDAP store types and pkcs12 files, the
pass phrase used to encrypt the certificate.|
+
+*Web Service Anchor Storage*
+
+Anchors stored in the configuration service are added and maintained in
the *_Anchors_* tab of the configuration service *_Manage Domains_* page.
+
+!images/WSConfigAddAnchor.png!
+
+The certificate field is the location of the DER encoded certificate file
that represents the trust anchor. Incoming and outgoing indicates if the
trust anchor should be used for incoming or outgoing anchors. Clicking
*_Add Anchor_* will add the anchor to the domain indicated by the *_Domain
Name*_ field and upload the anchor to the configuration service.
+
+*Non Web Service Anchor Storage*
+
+Anchors stored in now web service mediums such as LDAP or a keystore
require a list of aliases or search criteria to locate the certificates in
the anchor store. Each domain requires on of two entries in the settings
component: one for a list of outgoing anchors and/or one for a list of
incoming anchors. The settings use the following format:
+
+* <domainName>IncomingAnchorAliases
+* <domainName>OutgoingAnchorAliases
+
+The value for each setting is a comma delimited list of the aliases or
search criteria that identify the anchor in the anchor store. The
following example would be used for an LDAP anchor store:
+
+* cerner.com,securehealthemail.com,microsoft.com
+
+Example settings for the domain cerner.com using an LDAP store:
+
+||Setting Name||Value||
+|cerner.comIncomingAnchorAliases|
cerner.com,securehealthemail.com,microsoft.com|
+|cerner.comOutgoingAnchorAliases|
cerner.com,securehealthemail.com,microsoft.com|
+
+*NOTE* Regardless of the storage mechanism, a domain should always add its
own trust anchor to its list or trusted anchors. This is a security
precaution to ensure only users with valid certificates signed by the trust
anchor can send from the agent's managed domain(s).
+
+h3. Trust Bundles
+
+Configured trust bundles can be added to a domain from the *_Trust
Bundles_* tab of the configuration service *_Manage Domains_* page. Each
anchor in the bundle is used to create trust between the domain and the
system represented by the anchor. Similar to configuring anchors, each
bundle can be set to incoming or outgoing to control the direction of trust.
+
+!images/WSConfigAssociateTrustBundle.png!
+
+To associate one or more bundles to a domain, click the *Assign Additional
Trust Bundles* link. Select each bundle and select if the bundle should be
incoming, outgoing, or both.
+
+!images/WSConfigSelectBundle.png!
+
+h2. PublicCertStore
+
+Similar to anchors, public certificates can be retrieved from different
source mediums. The public certificate storage medium is configured in the
settings page of the configuration UI.
+
+*Public Certificate Store Settings*
+
+||Setting||Description||
+|PublicStoreType|The storage type of the public certificate store. Valid
types: \\ \\DNS: Certificates are resolved using DNS.\\KEYSTORE:
Certificates are stored in a local keystore file. \\WS: Public
certificates are stored in the configuration service. \\PublicLDAP:
Certificates are resolved from publicly accessible LDAP servers. LDAP
servers are resolved dynamically using DNS SRV. \\ \\In some cases,
multiple store types may be necessary to resolve a public certificate. For
example some HISPs use DNS to distributed public CERT while others may use
out of band processes and require a HISP to manually import the CERT(s)
into the storage medium. Multiple store types are separated by a comma
(,). \\ \\Default Value: DNS,PublicLDAP|
+|PublicStoreFile|For keystore store types, the name of the file that
contains the certificates. This can be just a file name, a fully qualified
path, or a relative path.|
+|PublicStoreFilePass|For keystore store types, an optional password used
to encrypt the file.|
+|PublicStorePrivKeyPass|For keystore store types, an optional password
used to encrypt private keys.|
+
+h2. PrivateCertStore
+
+The private certificate storage medium is configured in the settings page
of the configuration UI.
+
+*Private Certificate Store Settings*
+
+||Setting||Description||
+|PrivateStoreType|The storage type of the private certificate store.
Valid types: \\ \\WS (default): Certificates are stored in the
configuration service.\\LDAP: Certificates are stored in an LDAP
server.\\KEYSTORE: Certificates are stored in a local keystore file.|
+|PrivateStoreFile|For keystore store types, the name of the file that
contains the certificates. This can be just a file name, a fully qualified
path, or a relative path.|
+|PrivateStoreFilePass|For keystore store types, an optional password used
to encrypt the file.|
+|PrivateStorePrivKeyPass|For keystore store types, an optional password
used to encrypt private keys.|
+|PrivateStoreLDAPUrl|For LDAP store types, the url to the LDAP server.
Consists of the protocol, host, and port. Multiple URLs can be define and
are comma delimeted. Example: ldap://somehost:389|
+|PrivateStoreLDAPUser|For LDAP store types, the user name credential for
connecting to the LDAP store. May be empty if the LDAP server allows
anonymous binding.|
+|PrivateStoreLDAPPassword|For LDAP store types, The password credential
for connecting to the LDAP store.|
+|PrivateStoreLDAPConnTimeout|For LDAP store types, an optional timeout in
seconds before the connection is failed.|
+|PrivateStoreLDAPSearchBase|For LDAP store types, the distinguished name
used as the base of LDAP searches.|
+|PrivateStoreLDAPSearchAttr|For LDAP store types, the attribute in the
LDAP store that is used to match a search query.|
+|PrivateStoreLDAPCertAttr|For LDAP store types, the attribute in the
search query result that holds the certificate file.|
+|PrivateStoreLDAPCertFormat|For LDAP store types, the format of the
certificate in the LDAP store. Valid formats: pkcs12, X.509|
+|PrivateStoreLDAPCertPassphrase|For LDAP store types and pkcs12 files, the
pass phrase used to encrypt the certificate.|
+
+
+*Web Service Private/Public Certificate Storage*
+
+Private and public certificates stored in the configuration service are
added and maintained in the *_Manage Certificates_* page of the
configuration service application.
+
+!images/WSConfigAddCertificate.png!
+
+The certificate field is the location of the DER encoded certificate file
that represents the private or public certificate. Clicking *_Add
Certificate_* will add the certificate to the configuration service.
*NOTE* The owner is automatically populated by the service when the
certificate is added.
+
+*NOTE:* Private certificate files should be pkcs12 encoded files with no
encryption on both the file and private key stored in the file. Although
pkcs12 files can be created from open source tools such as openssl, the
Java Reference implementation agent module contains a tool for creating
pkcs12 files in the expected format from DER encoded X509 certificates and
pkcs8 DER encoded private key files. It also contains a tool for stripping
encryption from existing pkcs12 files.
+
+h2. XXMessageSettings
+
+The following settings describes the location where processed messages
should be stored. This is intended for debug purposes only and should not
be set in a production environment.
+
+MessageTypes:
+* Raw: The raw message that entered the SMTP agent.
+* Outgoing: If the message is determined to be an outgoing message, the
security and trust processed outgoing message.
+* Incoming: If the message is determined to be an incoming message, the
security and trust processed incoming message.
+* Bad: Messages that failed to be processed or caused other errors to be
the thrown.
+
+||Setting||Description||
+|RawMessageSaveFolder|The folder where raw messages will be stored. If
the folder does not exist, the system will automatically created it as long
as the agent's process has permission to do so.|
+|OutgoingMessageSaveFolder|The folder where outgoing messages will be
stored. If the folder does not exist, the system will automatically
created it as long as the agent's process has permission to do so.|
+|IncomingMessageSaveFolder|The folder where incoming messages will be
stored. If the folder does not exist, the system will automatically
created it as long as the agent's process has permission to do so.|
+|BadMessageSaveFolder|The folder where bad messages will be stored. If
the folder does not exist, the system will automatically created it as long
as the agent's process has permission to do so.|
+
+h2. MDN Settings
+
+The agent automatically produce MDN message for all successfully processed
messages with a disposition of _Processed_. MDN is described in [RFC3798|
http://tools.ietf.org/html/rfc3798] and is intended (for the SMTP Agent
purposes) to indicate the successful reception and processing of message by
the security and trust agent.
+
+||Setting||Description||
+|MDNAutoResponse|Indicates if the SMTP agent should produce MDN messages
for MDN requests. The default setting is true if this attribute is not
present.|
+|MDNProdName|The product name used in the user agent header of the MDN
message. Defaults to _Security Agent_ if this attribute is not present.|
+|MDNText|Human readable response text sent back to the sender indicating a
successful reception of the senders message.|
+
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/smtp-depl-xmlconfig.confluence
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,151 @@
+h1. SMTP Agent XML Configuration
+
+WARNING: XML Configuration has been deprecated
+
+XML configuration for the SMTP protocol consists of an XML file that sets
parameters for both the SMTP agent and the security and trust agent. Below
is a sample configuration file.
+
+{code}
+<SmtpAgentConfig>
+ <Domains>
+ <AnchorStore type="multidomain" storeType="LDAP"
ldapURL="ldap://localhost:1024/" ldapUser="" ldapPassword=""
ldapConnTimeout="10000" ldapSearchBase="cn=lookupTest"
ldapSearchAttr="email" ldapCertAttr="privKeyStore"
ldapCertPassphrase="1kingpuff" ldapCertFormat="PKCS12"/>
+ <Domain name="cerner.com" postmaster="postm...@cerner.com">
+ <IncomingTrustAnchors>
+ <Anchor name="microsoft.com"/>
+ <Anchor name="securehealthemail.com"/>
+ </IncomingTrustAnchors>
+ <OutgoingTrustAnchors>
+ <Anchor name="microsoft.com"/>
+ <Anchor name="securehealthemail.com"/>
+ </OutgoingTrustAnchors>
+ </Domain>
+ <Domain name="securehealthemail.com"
postmaster="postm...@securehealthemail.com">
+ <IncomingTrustAnchors>
+ <Anchor name="cerner.com"/>
+ </IncomingTrustAnchors>
+ <OutgoingTrustAnchors>
+ <Anchor name="cerner.com"/>
+ </OutgoingTrustAnchors>
+ </Domain>
+ </Domains>
+ <PublicCertStore type="DNS"/>
+ <PrivateCertStore type="LDAP" ldapURL="ldap://localhost:1024/"
ldapUser="" ldapPassword="" ldapConnTimeout="10000"
ldapSearchBase="cn=lookupTest" ldapSearchAttr="email"
ldapCertAttr="privKeyStore" ldapCertPassphrase="1kingpuff"
ldapCertFormat="PKCS12"/>
+ <RawMessageSettings saveFolder="RawMsgFolder"/>
+ <OutgoingMessagesSettings saveFolder="OutgoingMsgFolder"/>
+ <IncomingMessagesSettings saveFolder="IncomingMsgFolder"/>
+ <BadMessagesSettings saveFolder="BadMsgFolder"/>
+ <MDNSettings autoResponse="true" productName="NHIN Direct Security
Agent">
+ <Text><![CDATA[Your message was processed successfully.]]></Text>
+ </MDNSettings>
+</SmtpAgentConfig>
+{code}
+
+h2. Domains
+
+The domains element describes the list of domains that will be managed by
the agent. Each domain is configured as a child domain element.
+
+h3. AnchorStore
+
+Describes the storage mechanism for trust anchors.
+
+Attributes:
+
+||Attribute||Description||
+|type|The type of the anchor store. Uniform: All domains use the same
anchors for all addresses. Multidomain: Each domain defines its own
discrete set of trust anchors.|
+|storeType|The storage media of the trust anchors. Valid types: LDAP,
Keystore|
+|ldapURL|The url to the LDAP server. Consists of the protocol, host, and
port. Multiple URLs can be define and are comma delimeted. Example:
ldap://somehost:389|
+|ldapUser|The user name credential for connecting to the LDAP store. May
be empty if the LDAP server allows anonymous binding.|
+|ldapPassword|The password credential for connecting to the LDAP store.|
+|ldapConnTimeout|Optional timeout in seconds before the connection is
failed.|
+|ldapSearchBase|The distinguished name used as the base of LDAP searches.|
+|ldapSearchAttribute|The attribute in the LDAP store that is used to match
a search query.|
+|ldapCertAttr|The attribute in the search query result that holds the
certificate file.|
+|ldapCertPassPhrase|For pkcs12 files, the pass phrase used to encrypt the
certificate.|
+|ldapCertFormat|The format of the certificate in the LDAP store. Valid
formats: pkcs12, X.509|
+|file|For keystore store types, the name of the file that contains the
certificates. This can be just a file name, a fully qualified path, or a
relative path.|
+|filePass|For keystore store types, an optional password used to encrypt
the file.|
+|privKeyPass|For keystore store types, an optional password used to
encrypt private keys.|
+
+h3. Domain
+
+Attributes:
+
+||Attribute||Description||
+|name|The name of the domain|
+|postmaster|The postmaster email address for the domain|
+
+Elements:
+
+||Element||Type||Description||
+|IncomingTrustAnchors|List<Anchor>|The trust anchors used for outgoing
messages|
+|OutgoingTrustAnchors|List<Anchor>|The trust anchors used for incoming
messages|
+
+h4. Anchor
+
+Anchors define the certificates that determine trust between domains.
+
+Attributes:
+
+||Attribute||Description||
+|name|The name has different semantics depending on the AnchorStore type.
LDAP: The domain name of the trusted domain. Keystore: The alias name of
the trust anchor in the keystore.|
+
+h2. PublicCertStore
+
+The PublicCertStore element describes the medium used to store public
certificates.
+
+Attributes:
+
+||Attribute||Description||
+|type|The storage media of the public certs. Valid types: DNS, Keystore|
+|file|For keystore store types, the name of the file that contains the
certificates|
+|filePass|For keystore store types, an optional password used to encrypt
the file.|
+|privKeyPass|For keystore store types, an optional password used to
encrypt private keys.|
+
+h2. PrivateCertStore
+
+The PrivateCertStore element describes the medium used to store private
certificates.
+
+Attributes:
+
+||Attribute||Description||
+|type|The storage media of the private certs. Valid types: LDAP, Keystore|
+|ldapUser|The user name credential for connecting to the LDAP store. May
be empty if the LDAP server allows anonymous binding.|
+|ldapPassword|The password credential for connecting to the LDAP store.|
+|ldapConnTimeout|Optional timeout in seconds before the connection is
failed.|
+|ldapSearchBase|The distinguished name used as the base of LDAP searches.|
+|ldapSearchAttribute|The attribute in the LDAP store that is used to match
a search query.|
+|ldapCertAttr|The attribute in the search query result that holds the
certificate file.|
+|ldapCertPassPhrase|For pkcs12 files, the pass phrase used to encrypt the
certificate.|
+|ldapCertFormat|The format of the certificate in the LDAP store. Valid
formats: pkcs12, X.509|
+|file|For keystore store types, the name of the file that contains the
certificates. This can be just a file name, a fully qualified path, or a
relative path.|
+|filePass|For keystore store types, an optional password used to encrypt
the file.|
+|privKeyPass|For keystore store types, an optional password used to
encrypt private keys.|
+
+h2. XXMessageSettings
+
+Describes the location where processed messages should be stored. This is
intended for debug purposes only and should not be set in a production
environment.
+
+Supported message settings elements:
+
+* RawMessageSettings: The raw message that entered the SMTP agent.
+* OutgoingMessagesSettings: If the message is determined to be an outgoing
message, the security and trust processed outgoing message.
+* IncomingMessagesSettings: If the message is determined to be an incoming
message, the security and trust processed incoming message.
+* BadMessagesSettings: Messages that failed to be processed or caused
other errors to be the thrown.
+
+Attributes:
+
+||Attribute||Description||
+|saveFolder|The folder where the messages will be stored. If the folder
does not exist, the system will automatically created it as long as the
agent's process has permission to do so.|
+
+h2. MDN Settings
+
+The agent can automatically produce MDN message in response to MDN
requests with a disposition of _Processed_. MDN is described in [RFC3798|
http://tools.ietf.org/html/rfc3798] and is intended (for the SMTP Agent
purposes) to indicate the successful reception and processing of message by
the security and trust agent.
+
+Attributes:
+
+||Attribute||Description||
+|autoResponse|Indicates if the SMTP agent should produce MDN messages for
MDN requests. The default setting is false if this attribute is not
present.|
+|productName|The product name used in the user agent header of the MDN
message. Defaults to _Security Agent_ if this attribute is not present.|
+
+Elements:
+||Element||Type||Description||
+|Text|String or CDATA|Human readable response text sent back to the sender
indicating a successful reception of the senders message. The text may
either be a simple string or may be contained in a CDATA section for more
sophisticated encoding and formatting.|
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/books/users-guide/smtp-fine-grain-options.confluence
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,12 @@
+h1. Fined Grained Tuning
+
+Fine grained tuning of the following components can be achieved using the
[OptionsManager|
http://api.nhindirect.org/java/site/agent/1.5.4/apidocs/org/nhindirect/stagent/options/OptionsManager.html].
+
+h2. WS Certificate Resolver
+
+The following settings fine tune the web services based certificate
resolver:
+
+||JVM Param/Properties Setting|Description||
+|org.nhindirect.stagent.cert.wsresolver.ConnectionTimeout|Connection
timeout in milliseconds to the configuration service. Defaults to 30
seconds|
+|org.nhindirect.stagent.cert.wsresolver.MaxCacheSize|Maximum number of
certificates that can be cached in the cache manager. Defaults to 1000
certificates|
+|org.nhindirect.stagent.cert.wsresolver.CacheTTL|Maximum amount of time in
seconds a certificate can reside in the cache manager. Defaults to 1 hours
(3600 seconds).|
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/GatewayConfiguration.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,80 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway;
+
+import org.apache.mailet.Mailet;
+import org.nhindirect.stagent.options.OptionsManager;
+import org.nhindirect.stagent.options.OptionsParameter;
+
+/**
+ * Utility class for retrieving parameterized configuration options.
Options for the can be configured in one of two ways:
+ * either by setting appropriate option as an XML element in a mailet's
XML configuration (optional and typically found in the config.xml file
+ * for Apache James deployments), or by setting the option using the
{@link org.nhindirect.stagent.options.OptionsManager} pattern.
+ * <p>
+ * The precedence of the parameters using the following algorithm.
+ * <br>
+ * 1. Use the mailet XML configuration
+ * <br>
+ * 2. Use the OptionsManager configuration
+ * <br>
+ * 3. Use default settings in the mailet.
+ * @author Greg Meyer
+ * @since 2.0
+ */
+public class GatewayConfiguration
+{
+ /**
+ * Gets the configuration parameter requested. The mailet init
parameters are checked first, then the OptionsManager.
+ * @param param The parameter to get the value of.
+ * @param mailet The mailet to search. May be null
+ * @return If found, returns, the value of the configured value.
Otherwise, the default value is returned
+ */
+ public static final String getConfigurationParam(String param, Mailet
mailet, String defaultValue)
+ {
+ // get from the mailet init parameter first
+ String paramValue = (mailet == null) ? null :
mailet.getMailetConfig().getInitParameter(param);
+ if (paramValue == null || paramValue.isEmpty())
+ {
+ // if not in the mailet config, then try the
+ // Options manager
+ OptionsParameter optionsParam =
OptionsManager.getInstance().getParameter(param);
+ if (optionsParam != null)
+ paramValue = optionsParam.getParamValue();
+ }
+
+ return (paramValue == null) ? defaultValue : paramValue;
+ }
+
+ /**
+ * Gets the configuration parameter requested as a boolean value. The
same search rules are followed as in {@link #getConfigurationParam(String,
Mailet, String)}.
+ * @param param The parameter to get the value of.
+ * @param mailet The mailet to search. May be null
+ * @return If found, returns, the value of the configured value.
Otherwise, the default value is returned.
+ */
+ public static final boolean getConfigurationParamAsBoolean(String
param, Mailet mailet, boolean defaultValue)
+ {
+ final String paramValue = getConfigurationParam(param, mailet, "");
+
+ // get from the mailet init parameter first
+ return (paramValue.isEmpty()) ? defaultValue :
Boolean.parseBoolean(paramValue);
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/package-info.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,5 @@
+/**
+ * General utility classes and data structure for a Direct gateway
implementation.
+ */
+
+package org.nhindirect.gateway;
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/AuditEvents.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,90 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import org.nhindirect.stagent.mail.MailStandard;
+import org.nhindirect.stagent.mail.notifications.MDNStandard;
+
+/**
+ * Definitions of audit names, types, and contexts
+ * @author Greg Meyer
+ * @since 1.2.1
+ */
+public class AuditEvents
+{
+ /**
+ * Event type for processing direct messages
+ */
+ public static final String EVENT_TYPE = "SMTP Direct Message Processing";
+
+ /**
+ * Event name for processing incoming messages
+ */
+ public static final String INCOMING_MESSAGE_NAME = "Incoming Direct
Message";
+
+ /**
+ * Event name for processing outgoing messages
+ */
+ public static final String OUTGOING_MESSAGE_NAME = "Outgoing Direct
Message";
+
+ /**
+ * Event name for producing MDN messages
+ */
+ public static final String PRODUCE_MDN_NAME = "Produce Direct MDN
Message";
+
+ /**
+ * Event name for receiving an MDN message
+ */
+ public static final String MDN_RECEIVED_NAME = "Received Direct MDN
Message";
+
+ /**
+ * Event name for rejected message recipients
+ */
+ public static final String REJECTED_RECIP_NAME = "Rejected Direct Message
Recipients";
+
+ /**
+ * Event name for rejected messages
+ */
+ public static final String REJECTED_MESSAGE_NAME = "Rejected Direct
Message";
+
+
+ /**
+ * Default set of headers that are audited
+ */
+ public static final String[] DEFAULT_HEADER_CONTEXT =
{MailStandard.Headers.MessageID, MailStandard.Headers.From,
MailStandard.Headers.To};
+
+ /**
+ * Set of headers audited with outgoing MDN message
+ */
+ public static final String[] MDN_HEADER_CONTEXT =
{MailStandard.Headers.MessageID, MailStandard.Headers.From,
+ MailStandard.Headers.To, MDNStandard.Headers.Disposition,
MDNStandard.Headers.OriginalMessageID, MDNStandard.Headers.FinalRecipient};
+
+ /**
+ * Set of headers audited with incoming MDN messages
+ */
+ public static final String[] MDN_RECEIVED_CONTEXT =
{MailStandard.Headers.MessageID, MailStandard.Headers.From,
+ MailStandard.Headers.To, MDNStandard.Headers.OriginalMessageID,
MDNStandard.Headers.Disposition, MDNStandard.Headers.FinalRecipient,};
+
+ public static final String REJECTED_RECIPIENTS_CONTEXT = "Rejected
Recipients";
+
+ public static final String REJECTED_MESSAGE_REASON_CONTEXT = "Rejected
Message Reason";
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/DefaultSmtpAgent.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,502 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.Arrays;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.UUID;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.InternetHeaders;
+import javax.mail.internet.MimeMessage;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nhindirect.common.audit.AuditContext;
+import org.nhindirect.common.audit.AuditEvent;
+import org.nhindirect.common.audit.Auditor;
+import org.nhindirect.common.audit.AuditorFactory;
+import org.nhindirect.common.audit.DefaultAuditContext;
+import org.nhindirect.stagent.AgentError;
+import org.nhindirect.stagent.AgentException;
+import org.nhindirect.stagent.DefaultMessageEnvelope;
+import org.nhindirect.stagent.IncomingMessage;
+import org.nhindirect.stagent.NHINDAgent;
+import org.nhindirect.stagent.MessageEnvelope;
+import org.nhindirect.stagent.NHINDAddress;
+import org.nhindirect.stagent.NHINDAddressCollection;
+import org.nhindirect.stagent.NHINDException;
+import org.nhindirect.stagent.OutgoingMessage;
+import org.nhindirect.stagent.cryptography.SMIMEStandard;
+import org.nhindirect.stagent.mail.MailStandard;
+import org.nhindirect.stagent.mail.Message;
+import org.nhindirect.stagent.mail.notifications.MDNStandard;
+import org.nhindirect.stagent.mail.notifications.Notification;
+import org.nhindirect.stagent.mail.notifications.NotificationHelper;
+import org.nhindirect.stagent.mail.notifications.NotificationMessage;
+import org.nhindirect.stagent.parser.EntitySerializer;
+
+import com.google.inject.Inject;
+
+
+
+/**
+ * Default implementation of the SmtpAgent interface.
+ * {@inheritDoc}
+ */
+public class DefaultSmtpAgent implements SmtpAgent
+{
+ private static final Log LOGGER =
LogFactory.getFactory().getInstance(DefaultSmtpAgent.class);
+
+ private static final String PRINICPAL;
+
+
+
+ private final NHINDAgent agent;
+ private final SmtpAgentSettings settings;
+ private Auditor auditor;
+
+ static
+ {
+
+ String host = "";
+
+ try
+ {
+ host = InetAddress.getLocalHost().getHostName();
+ host = "@" + host;
+ }
+ catch (UnknownHostException e)
+ {
+ LOGGER.warn("Coulnd not get host name: " + e.getMessage());
+ }
+
+ PRINICPAL = "STAgent" + host;
+ }
+
+ /**
+ * Constructs an Smtp agent with settings and an instance of the security
and trust agent.
+ * @param settings The SMTP agent configuration settings.
+ * @param agent An instance of the security and trust agent.
+ */
+ @Inject
+ public DefaultSmtpAgent(SmtpAgentSettings settings, NHINDAgent agent)
+ {
+ this(settings, agent, null);
+ }
+
+ /**
+ * Constructs an Smtp agent with settings, an instance of the security
and trust agent,
+ * and an event auditor.
+ * @param settings The SMTP agent configuration settings.
+ * @param agent An instance of the security and trust agent.
+ * @param auditor The auditor used to log auditable events.
+ */
+ public DefaultSmtpAgent(SmtpAgentSettings settings, NHINDAgent agent,
Auditor auditor)
+ {
+ if (settings == null || agent == null)
+ throw new IllegalArgumentException("Setting and/or agent cannot be
null.");
+
+ this.settings = settings;
+ this.agent = agent;
+
+ if (auditor == null)
+ this.auditor = AuditorFactory.createAuditor(); // use the default
auditor
+ }
+
+ /**
+ * Gets a references to the security and trust agent used by the
SmtpAgent.
+ * @return A references to the security and trust agent used by the
SmtpAgent
+ */
+ public NHINDAgent getAgent()
+ {
+ return this.agent;
+ }
+
+ /**
+ * Gets the configuration settings of the SmtpAgent.
+ * @return The configuration settings of the SmtpAgent.
+ */
+ public SmtpAgentSettings getSmtpAgentSettings()
+ {
+ return this.settings;
+ }
+
+ /**
+ * Sets the auditor used to log auditable events.
+ * @param auditor The auditor used to log auditable events.
+ */
+ @Inject(optional=true)
+ public void setAuditor(Auditor auditor)
+ {
+ this.auditor = auditor;
+ }
+
+ /**
+ * Gets the auditor used to log auditable events.
+ * @param auditor The auditor used to log auditable events.
+ */
+ public Auditor getAuditor()
+ {
+ return auditor;
+ }
+
+ /**
+ * Processes an message from an SMTP stack. The bridge component between
the SMTP stack and the SMTP agent is responsible for
+ * extracting the message, the recipient list, and the sender. In some
cases, the routing headers may have different information than
+ * what is populated in the SMTP MAIL FROM and RCTP TO headers. In these
cases, the SMTP headers should be favored over the routing
+ * headers in the message and passed as the recipient collection and
sender to this method.
+ * @param message The message in the SMTP envelope.
+ * @param recipients The recipients of the message. The RCTP TO headers
should be used over the message routing headers.
+ * @param sender The send of the message. The MAIL FROM header should be
used over the From: routing header in the message.
+ */
+ public MessageProcessResult processMessage(MimeMessage message,
NHINDAddressCollection recipients, NHINDAddress sender)
+ {
+ GatewayState.getInstance().lockForProcessing();
+ try
+ {
+
+ LOGGER.trace("Entering processMessage(MimeMessage,
NHINDAddressCollection, NHINDAddress");
+
+ MessageProcessResult retVal = null;
+
+ verifyInitialized();
+
+ preProcessMessage(message, sender);
+
+ Collection<NHINDAddress> originalRecipList = new
ArrayList<NHINDAddress>(recipients);
+
+ DefaultMessageEnvelope envelopeToProcess = null;
+ try
+ {
+ envelopeToProcess = new DefaultMessageEnvelope(new Message(message),
recipients, sender);
+ envelopeToProcess.setAgent(agent);
+
+ // should always result in either a non null object or an exception
+ MessageEnvelope processEvn = processEnvelope(envelopeToProcess);
+ retVal = new MessageProcessResult(processEvn, null);
+
+ if (retVal.getProcessedMessage() != null)
+ postProcessMessage(retVal);
+ }
+ catch (SmtpAgentException e)
+ {
+ // rethrow
+ LOGGER.trace("Exiting processMessage(MimeMessage,
NHINDAddressCollection, NHINDAddress", e);
+ throw e;
+ }
+ catch (Exception e)
+ {
+ // audit the message rejection
+ if (envelopeToProcess != null)
+ {
+ Collection<AuditContext> contexts =
createContextCollectionFromMessage(envelopeToProcess,
+ Arrays.asList(AuditEvents.DEFAULT_HEADER_CONTEXT));
+
+ if (e instanceof NHINDException)
+ {
+ NHINDException exception = (NHINDException)e;
+ if (exception.getError() != null)
+ {
+ contexts.add(new
DefaultAuditContext(AuditEvents.REJECTED_MESSAGE_REASON_CONTEXT,
exception.getError().toString()));
+
+ if (exception.getError() != null && exception.getError() instanceof
AgentException
+ && ((AgentException)exception.getError()).getError() ==
AgentError.NoTrustedRecipients)
+ {
+ StringBuilder rejectedRecips = new StringBuilder();
+ int cnt = 0;
+ for (NHINDAddress address : originalRecipList)
+ {
+ rejectedRecips.append(address.getAddress());
+
+ if (++cnt < originalRecipList.size())
+ rejectedRecips.append(", ");
+ }
+ contexts.add(new
DefaultAuditContext(AuditEvents.REJECTED_RECIPIENTS_CONTEXT,
rejectedRecips.toString()));
+ }
+
+ }
+
+ }
+ auditor.audit(PRINICPAL, new
AuditEvent(AuditEvents.REJECTED_MESSAGE_NAME, AuditEvents.EVENT_TYPE),
contexts);
+ }
+
+ LOGGER.trace("Exiting processMessage(MimeMessage,
NHINDAddressCollection, NHINDAddress", e);
+ throw new SmtpAgentException(SmtpAgentError.Unknown, e);
+ }
+
+ LOGGER.trace("Exiting processMessage(MimeMessage,
NHINDAddressCollection, NHINDAddress");
+ return retVal;
+ }
+ finally
+ {
+ GatewayState.getInstance().unlockFromProcessing();
+ }
+ }
+
+ /*
+ * Validate the SmtpAgent is valid.
+ */
+ private void verifyInitialized()
+ {
+ if (agent == null)
+ throw new SmtpAgentException(SmtpAgentError.Uninitialized, "SmtpAgent
not fully initialized: Security and Trust agent is null");
+ }
+
+ private void preProcessMessage(MimeMessage message, NHINDAddress sender)
+ {
+ LOGGER.debug("Message Recieved from: " + sender.getAddress());
+ copyMessage(message, settings.getRawMessageSettings());
+ }
+
+ /*
+ * Determines if the message is outgoing or incoming. Need to take in
account that the sender and recipient may be from the same domain.
+ */
+ public boolean isOutgoing(MessageEnvelope envelope)
+ {
+ // if the sender is not from our domain, then is has to be an incoming
message
+ if (!envelope.getSender().isInDomain(agent.getDomains()))
+ return false;
+ else
+ {
+ // depending on the SMTP stack configuration, a message with a sender
from our domain
+ // may still be an incoming message... check if the message is encrypted
+ if (SMIMEStandard.isEncrypted(envelope.getMessage()))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /*
+ * Processes a message using the securty and trust agent.
+ */
+ protected MessageEnvelope processEnvelope(MessageEnvelope envelope)
+ {
+
+ MessageEnvelope processedMessage = null;
+ boolean isOutgoing = isOutgoing(envelope);
+
+ if (isOutgoing)
+ {
+ if (auditor != null)
+ {
+ Collection<AuditContext> contexts =
createContextCollectionFromMessage(envelope,
+ Arrays.asList(AuditEvents.DEFAULT_HEADER_CONTEXT));
+
+ auditor.audit(PRINICPAL, new
AuditEvent(AuditEvents.OUTGOING_MESSAGE_NAME, AuditEvents.EVENT_TYPE),
contexts);
+ }
+ LOGGER.debug("Sending outgoing message from " +
envelope.getSender().toString() + " to STAgent");
+ }
+ else
+ {
+ if (auditor != null)
+ {
+ Collection<AuditContext> contexts =
createContextCollectionFromMessage(envelope,
+ Arrays.asList(AuditEvents.DEFAULT_HEADER_CONTEXT));
+
+ auditor.audit(PRINICPAL, new
AuditEvent(AuditEvents.INCOMING_MESSAGE_NAME, AuditEvents.EVENT_TYPE),
contexts);
+ }
+ LOGGER.debug("Sending incoming message from " +
envelope.getSender().toString() + " to STAgent");
+ }
+
+
+ processedMessage = (isOutgoing) ? agent.processOutgoing(envelope) :
agent.processIncoming(envelope);
+
+ return processedMessage;
+ }
+
+
+
+
+ private void postProcessMessage(MessageProcessResult result)
+ {
+ boolean isOutgoing = (result.getProcessedMessage() instanceof
OutgoingMessage);
+
+ // check for rejected recipients
+ if (auditor != null &&
result.getProcessedMessage().getRejectedRecipients() != null
+ && result.getProcessedMessage().getRejectedRecipients().size() >
0)
+ {
+ Collection<AuditContext> contexts =
createContextCollectionFromMessage(result.getProcessedMessage(),
+ Arrays.asList(AuditEvents.DEFAULT_HEADER_CONTEXT));
+ StringBuffer rejectedRecips = new StringBuffer();
+
+ int cnt = 0;
+ for (NHINDAddress address :
result.getProcessedMessage().getRejectedRecipients())
+ {
+ rejectedRecips.append(address.getAddress());
+
+ if (++cnt <
result.getProcessedMessage().getRejectedRecipients().size())
+ rejectedRecips.append(", ");
+ }
+
+ contexts.add(new
DefaultAuditContext(AuditEvents.REJECTED_RECIPIENTS_CONTEXT,
rejectedRecips.toString()));
+ auditor.audit(PRINICPAL, new
AuditEvent(AuditEvents.REJECTED_RECIP_NAME, AuditEvents.EVENT_TYPE),
contexts);
+ }
+
+ if (isOutgoing)
+ postProcessOutgoingMessage(result);
+ else
+ postProcessIncomingMessage(result);
+ }
+
+ private void postProcessOutgoingMessage(MessageProcessResult result)
+ {
+ if (result.getProcessedMessage().hasRecipients())
+ copyMessage(result.getProcessedMessage().getMessage(),
settings.getOutgoingMessageSettings());
+ }
+
+ private void postProcessIncomingMessage(MessageProcessResult result)
+ {
+ this.copyMessage(result.getProcessedMessage().getMessage(),
settings.getIncomingMessageSettings());
+
+ // check if we need to create notification messages
+ try
+ {
+ if (settings.getNotificationProducer() != null)
+ {
+
result.setNotificationMessages(settings.getNotificationProducer().
+ produce((IncomingMessage)result.getProcessedMessage()));
+
+ if (result.getNotificationMessages() != null && auditor != null)
+ {
+ for (NotificationMessage noteMsg :
result.getNotificationMessages())
+ {
+ Collection<AuditContext> contexts =
createContextCollectionFromMessage(noteMsg,
Arrays.asList(AuditEvents.MDN_HEADER_CONTEXT));
+ auditor.audit(PRINICPAL, new
AuditEvent(AuditEvents.PRODUCE_MDN_NAME, AuditEvents.EVENT_TYPE), contexts);
+ }
+ }
+
+ }
+ }
+ catch (Exception e)
+ {
+ // don't bail on the whole process if we can't create
notifications messages
+ LOGGER.error("Failed to create notification messages.", e);
+ }
+
+ // check if this is an incoming MDN message... is so, audit it
+ if
(NotificationHelper.isMDN(result.getProcessedMessage().getMessage()))
+ {
+ Collection<AuditContext> contexts =
createContextCollectionFromMessage(result.getProcessedMessage(),
Arrays.asList(AuditEvents.MDN_RECEIVED_CONTEXT));
+ auditor.audit(PRINICPAL, new
AuditEvent(AuditEvents.MDN_RECEIVED_NAME, AuditEvents.EVENT_TYPE),
contexts);
+ }
+ }
+
+ /*
+ * Copy the content of message into a configured folder.
+ */
+ private void copyMessage(MimeMessage message, MessageProcessingSettings
settings)
+ {
+ if (settings != null && settings.hasSaveMessageFolder())
+ {
+ File fl = new
File(settings.getSaveMessageFolder().getAbsolutePath() + File.separator +
generateUniqueFileName());
+
+ try
+ {
+ FileUtils.writeStringToFile(fl,
EntitySerializer.Default.serialize(message));
+ }
+ catch (IOException e)
+ {
+ /*
+ * TODO: Add exception handling
+ */
+ }
+
+ }
+ }
+
+ /*
+ * Generate a unique file name using a UUID.
+ */
+ private String generateUniqueFileName()
+ {
+ return UUID.randomUUID().toString() + ".eml";
+ }
+
+ /*
+ * Create a collection of context from a message
+ */
+ private Collection<AuditContext>
createContextCollectionFromMessage(Message msg, Collection<String> headers)
+ {
+ return createContextCollectionFromMessage(new
DefaultMessageEnvelope(msg), headers);
+ }
+
+ /*
+ * Create a collection of context from a message envelope
+ */
+ private Collection<AuditContext>
createContextCollectionFromMessage(MessageEnvelope env, Collection<String>
headers)
+ {
+ Collection<AuditContext> retVal = new ArrayList<AuditContext>();
+
+ for (String header : headers)
+ {
+ try
+ {
+ String theHeader = null;
+ if (header.equals(MailStandard.Headers.From))
+ theHeader = env.getSender().getAddress();
+ else if (header.equals(MDNStandard.Headers.Disposition) ||
+ header.equals(MDNStandard.Headers.OriginalMessageID) ||
+ header.equals(MDNStandard.Headers.FinalRecipient))
+ {
+ Message msg = env.getMessage();
+ InternetHeaders notHeaders = null;
+ try
+ {
+ notHeaders = Notification.getNotificationFieldsAsHeaders(msg);
+ }
+ catch (Exception e) {/* no-op */}
+
+ if (notHeaders != null)
+ {
+ theHeader = notHeaders.getHeader(header, ",");
+ }
+ else
+ theHeader = msg.getHeader(header, ",");
+ }
+ else
+ theHeader = env.getMessage().getHeader(header, ",");
+
+ if (theHeader != null && !theHeader.isEmpty())
+ {
+ retVal.add(new DefaultAuditContext(header, theHeader));
+ }
+ }
+ catch (MessagingException e)
+ {
+ LOGGER.warn("Error retrieving header " + header + " from the
message.");
+ }
+ }
+
+ return retVal;
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/DomainPostmaster.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,119 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+
+/**
+ * Indicates the postmaster account for a domain.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ */
+public class DomainPostmaster
+{
+ private static final String DEFAULT_POSTMASTER_ACCOUNT = "postmaster";
+
+ private String domain;
+ private InternetAddress postmaster;
+
+ /**
+ * Constructs an empty postmaster.
+ */
+ public DomainPostmaster()
+ {
+ domain = "";
+ postmaster = new InternetAddress();
+ }
+
+ /**
+ * Constructs a postmaster for a domain with a postmaster address.
+ * @param domain The mail domain of the postmaster.
+ * @param postmaster The postmaster's email address.
+ */
+ public DomainPostmaster(String domain, InternetAddress postmaster)
+ {
+ if (domain == null)
+ throw new IllegalArgumentException();
+
+ this.domain = domain;
+ try
+ {
+ this.postmaster = postmaster != null ? postmaster : new
InternetAddress(getDefaultPostmaster(domain));
+ }
+ catch (AddressException e)
+ {
+ throw new SmtpAgentException(SmtpAgentError.MissingPostmaster, "Invalid
postmaster address format", e);
+ }
+ }
+
+ /**
+ * Gets the postmaster domain.
+ * @return The postmaster domain.
+ */
+ public String getDomain()
+ {
+ return domain;
+ }
+
+ /**
+ * Sets the postmaster's domain.
+ * @param domain The postmaster's domain.
+ */
+ public void setDomain(String domain)
+ {
+ this.domain = domain;
+ }
+
+ /**
+ * Get's the postmaster's email address.
+ * @return The postmaster's email address.
+ */
+ public InternetAddress getPostmaster()
+ {
+ return postmaster;
+ }
+
+ /**
+ * Sets the postmaster's email address.
+ * @param postmaster The postmaster's email address.
+ */
+ public void setPostmasters(InternetAddress postmaster)
+ {
+ this.postmaster = postmaster;
+ }
+
+ /**
+ * Gets the default postmaster address for a given domain.
+ * @param domain The domain to retrieve the default postmaster for.
+ * @return The default postmaster email address.
+ */
+ public static String getDefaultPostmaster(String domain)
+ {
+ // basic/trivial implementation for now
+ // just return back the DEFAULT_POSTMASTER_ACCOUNT with the domain
+ StringBuilder builder = new
StringBuilder(DEFAULT_POSTMASTER_ACCOUNT).append("@").append(domain);
+
+ return builder.toString();
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/GatewayState.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,338 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import java.util.concurrent.Executors;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nhindirect.gateway.smtp.config.SmtpAgentConfig;
+import org.nhindirect.stagent.MutableAgent;
+import org.nhindirect.stagent.NHINDAgent;
+
+import com.google.inject.Injector;
+
+/**
+ * Manages the settings state of the gateway provides read/write lock
protectors for concurrent operations.
+ * <br>
+ * This class implements a singleton pattern and is accessed by the static
method {@link #getInstance()}.
+ * @author Greg Meyer
+ * @since 1.4
+ */
+public class GatewayState
+{
+ private static final Log LOGGER =
LogFactory.getFactory().getInstance(GatewayState.class);
+
+ protected static final long DEFAULT_SETTINGS_UPDATE_DELAY = 300000; // 5
mintues
+
+ protected static GatewayState INSTANCE;
+
+ protected final ReentrantReadWriteLock readWriteLock = new
ReentrantReadWriteLock(true);
+
+ protected SmtpAgent smtpAgent;
+
+ protected SmtpAgentConfig smtpAgentConfig;
+
+ protected SettingsManager settingsManager;
+
+ protected long settingsThreadDelay = DEFAULT_SETTINGS_UPDATE_DELAY;
+
+ /**
+ * Gets the singleton instance of the GatewayState class.
+ * @return The singleton instance of the GatewayState class.
+ */
+ public static synchronized GatewayState getInstance()
+ {
+ if (INSTANCE == null)
+ INSTANCE = new GatewayState();
+
+ return INSTANCE;
+ }
+
+ /*
+ * Private constructor
+ */
+ private GatewayState()
+ {
+
+ }
+
+ /**
+ * Locks a services for processing operations. Semantically is the same
as a {@link java.util.concurrent.locks.ReadWriteLock#readLock()}.
Operations using this lock should not attempt to change the state
+ * of the services they are consuming. Multiple threads can
concurrently obtain the processing lock and execute, however
+ * this method will block is another thread holds the update lock.
+ */
+ public void lockForProcessing()
+ {
+ readWriteLock.readLock().lock();
+ }
+
+ /**
+ * Unlocks a service from processing operations. This releases the
thread's access to the lock and allows access to the update lock if no
+ * other threads hold the processing lock.
+ */
+ public void unlockFromProcessing()
+ {
+ readWriteLock.readLock().unlock();
+ }
+
+ /**
+ * Locks a service update operations. Semantically is the same as a
{@link java.util.concurrent.locks.ReadWriteLock#writeLock()}. This lock is
intended for updating
+ * the state of a service ensuring that the update does not have adverse
affects on a processing operations. Only a single thread can have access
to the
+ * update thread at any given time. This method will block if another
thread hold the update lock or the processing lock.
+ */
+ public void lockForUpdating()
+ {
+ readWriteLock.writeLock().lock();
+ }
+
+ /**
+ * Unlocks a service from update operations. This release the thread's
access to the lock.
+ */
+ public void unlockFromUpdating()
+ {
+ readWriteLock.writeLock().unlock();
+ }
+
+ /**
+ * Sets the interval that the settings are updated when the {@link
SettingsManager} is started. If this interval is changed, the settings
manager
+ * must be restarted before the new interval takes effect.
+ * @param intervalInSeconds The interval in seconds that the settings
are updated.
+ */
+ public synchronized void setSettingsUpdateInterval(long
intervalInSeconds)
+ {
+ this.settingsThreadDelay = intervalInSeconds * 1000;
+ }
+
+ /**
+ * Gets the interval that the settings are update when the {@link
SettingsManager} is started.
+ * @return he interval in seconds that the settings are updated.
+ */
+ public synchronized long getSettingsUpdateInterval()
+ {
+ return settingsThreadDelay / 1000;
+ }
+
+ /**
+ * Sets the {@link SmtpAgent agent} whose state is managed.
+ * @param agent The {@link SmtpAgent agent} whose state is managed.
+ */
+ public synchronized void setSmtpAgent(SmtpAgent agent)
+ {
+ this.smtpAgent = agent;
+ }
+
+ /**
+ * Gets the {@link SmtpAgent agent} whose state is being managed.
+ * @return The {@link SmtpAgent agent} whose state is being managed.
+ */
+ public synchronized SmtpAgent getSmtpAgent()
+ {
+ return this.smtpAgent;
+ }
+
+ /**
+ * Sets the {@link SmtpAgentConfig config} object used to obtain agent
settings and configuration.
+ * @param config The {@link SmtpAgentConfig config} object used to
obtain agent settings and configuration.
+ */
+ public synchronized void setSmptAgentConfig(SmtpAgentConfig config)
+ {
+ this.smtpAgentConfig = config;
+ }
+
+ /**
+ * Gets the {@link SmtpAgentConfig config} object that is being used to
obtain agent settings and configuration.
+ * @return The {@link SmtpAgentConfig config} object that is being used
to obtain agent settings and configuration.
+ */
+ public synchronized SmtpAgentConfig getSmtpAgentConfig()
+ {
+ return this.smtpAgentConfig;
+ }
+
+ /**
+ * Starts the agent settings manager. The manager updates the agent's
setting as determined by the update interval (default is every five
minutes).
+ * Changes to the settings manager requires a restart of the manager.
+ */
+ public synchronized void startAgentSettingsManager()
+ {
+ if (smtpAgentConfig == null || smtpAgent == null)
+ throw new IllegalStateException("Agent config and settings must be set
first.");
+
+ if (settingsManager != null)
+ throw new IllegalStateException("Settings manager is already
running.");
+
+ settingsManager = new SettingsManager(smtpAgent, smtpAgentConfig,
settingsThreadDelay);
+
+ // JDK documentation suggests it is a better practice to use a thread
factory instead of
+ // an ExeutorService to create and manage long running daemon threads
+ Thread managerThread =
Executors.defaultThreadFactory().newThread(settingsManager);
+ managerThread.setDaemon(true);
+ managerThread.setName("SMTP Gateway State Update Thread");
+ managerThread.start();
+ }
+
+ /**
+ * Stops the agent settings manager.
+ */
+ public synchronized void stopAgentSettingsManager()
+ {
+ if (settingsManager == null)
+ throw new IllegalStateException("Settings manager is not running.");
+
+ synchronized(settingsManager)
+ {
+ // shutdown the settings manage and notify it to wake up and shutdown
+ settingsManager.setRunning(false);
+ settingsManager.notifyAll();
+ }
+
+ settingsManager = null;
+ }
+
+ /**
+ * Determines if the settings manager is running.
+ * @return True if the settings manage is running. False otherwise.
+ */
+ public synchronized boolean isAgentSettingManagerRunning()
+ {
+ return (settingsManager != null);
+ }
+
+ /**
+ * Manages the settings of the agent.
+ */
+ protected static class SettingsManager implements Runnable
+ {
+ private final SmtpAgent agent;
+ private final SmtpAgentConfig config;
+ private final long waitInterval;
+ private boolean isRunning = true;
+
+ /**
+ * Constructor
+ * @param agent The agent that whose settings will be managed.
+ * @param config The config object used to object the agent's settings
and configuration.
+ * @param waitInterval The interval between each check of the agent's
settings.
+ */
+ public SettingsManager(SmtpAgent agent, SmtpAgentConfig config, long
waitInterval)
+ {
+ this.agent = agent;
+ this.config = config;
+ this.waitInterval = waitInterval;
+ }
+
+ /**
+ * {@inheritDoc}}
+ */
+ public void run()
+ {
+
+ final NHINDAgent theAgent = agent.getAgent();
+
+ // make sure the agent is mutable before trying to update it
+ if (!(theAgent instanceof MutableAgent))
+ {
+ LOGGER.warn("The configured agent is not mutable. Configuration
changes cannot be applied.");
+ return;
+ }
+ final MutableAgent runningAgent = (MutableAgent)theAgent;
+
+ while(isRunning())
+ {
+ NHINDAgent newAgent = null;
+
+ // build a new configuration
+ try
+ {
+ LOGGER.info("Refreshing agent settings from configuration.");
+ final Injector injector = config.getAgentInjector();
+ newAgent = injector.getInstance(NHINDAgent.class);
+ if (!(newAgent instanceof MutableAgent))
+ {
+ LOGGER.warn("The agent configuration does not allow attributes to be
retrieved. Cannot update currently running agent.");
+ return;
+ }
+ }
+ catch (Throwable t)
+ {
+ LOGGER.warn("Could not get new agent settings. Configuration may be
in an invalid state or not reachable.", t);
+ continue;
+ }
+
+ final MutableAgent newMutableAgent = (MutableAgent)newAgent;
+
+ // lock the system to stop new messages from flowing
+ GatewayState.INSTANCE.lockForUpdating();
+ try
+ {
+ // set the attributes of the agent
+ runningAgent.setDomains(newMutableAgent.getDomains());
+
runningAgent.setTrustAnchorResolver(newMutableAgent.getTrustAnchors());
+ runningAgent.setCryptographer(newMutableAgent.getCryptographer());
+
runningAgent.setPrivateCertResolver(newMutableAgent.getPrivateCertResolver());
+
runningAgent.setPublicCertResolvers(newMutableAgent.getPublicCertResolvers());
+ runningAgent.setPolicyFilter(newMutableAgent.getPolicyFilter());
+
runningAgent.setPrivatePolicyResolver(newMutableAgent.getPrivatePolicyResolver());
+
runningAgent.setPublicPolicyResolver(newMutableAgent.getPublicPolicyResolver());
+ runningAgent.setTrustModel(newMutableAgent.getTrustModel());
+
+ }
+ finally
+ {
+ // release the update lock
+ GatewayState.INSTANCE.unlockFromUpdating();
+ }
+
+ synchronized(this)
+ {
+ try
+ {
+ if (isRunning())
+ // wait for the configured interval
+ this.wait(waitInterval);
+ }
+ catch (InterruptedException e) {/*no-op*/}
+ }
+ }
+ }
+
+ /**
+ * Sets the running flag of the manager.
+ * @param running
+ */
+ public synchronized void setRunning(boolean running)
+ {
+ this.isRunning = running;
+ }
+
+ /**
+ * Indicates if the manager is running.
+ * @return True if the manager is running. False otherwise.
+ */
+ public synchronized boolean isRunning()
+ {
+ return isRunning;
+ }
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/MessageProcessResult.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,79 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/package org.nhindirect.gateway.smtp;
+
+import java.util.Collection;
+
+import org.nhindirect.stagent.MessageEnvelope;
+import org.nhindirect.stagent.mail.notifications.NotificationMessage;
+
+import java.util.Collections;
+
+/**
+ * Result structure for messages processed by the SmtpAgent. Contains the
result of processing the message and
+ * an acknowledgment message that should be sent back according the
security and trust policy.
+ * @author Greg Meyer
+ */
+public class MessageProcessResult
+{
+ private final MessageEnvelope processedMessage;
+
+ private Collection<NotificationMessage> notificationMessages;
+
+ /**
+ * Construct a result.
+ * @param processedMessage The resulting message of processing a message
through the SmtpAgent.
+ * @param ackMessage An acknowledgment message that should be sent to the
sender.
+ */
+ public MessageProcessResult(MessageEnvelope processedMessage,
Collection<NotificationMessage> notificationMessages)
+ {
+ this.processedMessage = processedMessage;
+ this.notificationMessages = notificationMessages;
+ }
+
+ /**
+ * Gets the resulting message of processing a message through the
SmtpAgent. A null message indicates that an error occurred while processing
+ * the message.
+ * @return The resulting message of processing a message through the
SmtpAgen
+ */
+ public MessageEnvelope getProcessedMessage()
+ {
+ return processedMessage;
+ }
+
+ /**
+ * Get the notification messages that should be sent back to the sender
according the security and trust policy.
+ * @return The notification messages that should be sent back to the
sender.
+ */
+ public Collection<NotificationMessage> getNotificationMessages()
+ {
+ if (notificationMessages != null)
+ return Collections.unmodifiableCollection(notificationMessages);
+ else
+ return Collections.emptyList();
+ }
+
+ public void setNotificationMessages(Collection<NotificationMessage>
notificationMessages)
+ {
+ this.notificationMessages = notificationMessages;
+ }
+
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/MessageProcessingSettings.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,88 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FileUtils;
+
+/**
+ * Generic settings for processing messages.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public abstract class MessageProcessingSettings
+{
+ private File saveMessagesFolder = null;
+
+ /**
+ * Sets the folder where messages will be written to disk.
+ * @param folder The folder where messages will be written to disk.
+ */
+ public void setSaveMessageFolder(File folder)
+ {
+ saveMessagesFolder = folder;
+
+ try
+ {
+ ensureSaveMessageFolder();
+ }
+ catch (IOException e)
+ {
+ /*
+ * TODO: log exception
+ */
+ throw new IllegalArgumentException(e);
+ }
+ }
+
+ /**
+ * Gets the folder where messages will be written to desk.
+ * @return The folder where messages will be written to desk.
+ */
+ public File getSaveMessageFolder()
+ {
+ return saveMessagesFolder;
+ }
+
+ /**
+ * Indicates if messages should be written to disk. If this setting is
null, then messages will not be written. This is
+ * useful for debugging, but generally should not be set in a production
environment.
+ * @return
+ */
+ public boolean hasSaveMessageFolder()
+ {
+ return getSaveMessageFolder() != null;
+ }
+
+ /*
+ * Ensures that a valid folder exits for messages to be written to.
+ */
+ private void ensureSaveMessageFolder() throws IOException
+ {
+ if (hasSaveMessageFolder() && !getSaveMessageFolder().exists())
+ FileUtils.forceMkdir(getSaveMessageFolder());
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/NotificationProducer.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,149 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import java.util.Collection;
+import java.util.Collections;
+
+import javax.mail.internet.InternetAddress;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nhindirect.stagent.IncomingMessage;
+import org.nhindirect.stagent.NHINDAddress;
+import org.nhindirect.stagent.mail.Message;
+import org.nhindirect.stagent.mail.notifications.Notification;
+import org.nhindirect.stagent.mail.notifications.NotificationCreator;
+import org.nhindirect.stagent.mail.notifications.NotificationHelper;
+import org.nhindirect.stagent.mail.notifications.NotificationMessage;
+import org.nhindirect.stagent.mail.notifications.NotificationType;
+import org.nhindirect.stagent.mail.notifications.ReportingUserAgent;
+
+
+/**
+ * Produces MND ack messages based on configuration settings.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public class NotificationProducer implements NotificationCreator
+{
+ private static final Log LOGGER =
LogFactory.getFactory().getInstance(NotificationProducer.class);
+
+ protected final NotificationSettings settings;
+
+ /**
+ * Constructs a producer with the notification settings.
+ * @param settings The notification configuration settings.
+ */
+ public NotificationProducer(NotificationSettings settings)
+ {
+ if (settings == null)
+ throw new IllegalArgumentException("Settings cannot be null");
+
+ this.settings = settings;
+
+ StringBuilder builder = new StringBuilder("Notification settings:");
+ builder.append("\n\r\tMDN Auto Response: " + settings.isAutoResponse());
+ builder.append("\n\r\tMDN Producer Name: " + settings.getProductName());
+ builder.append("\n\r\tMDN Response Test: " + settings.getText());
+
+ LOGGER.debug(builder.toString());
+ }
+
+ /**
+ * Creates an ack MDN.
+ * {@inheritDoc}
+ */
+ public Notification createNotification(InternetAddress address)
+ {
+ return createAck(address);
+ }
+
+ /**
+ * Produces an ack MDN message for the incoming message.
+ * @param envelope The incoming message that will have an MDN ack message
sent to the senders.
+ * @return A collection of notification messages that will be sent to the
incoming message senders.
+ */
+ public Collection<NotificationMessage> produce(IncomingMessage
envelope)
+ {
+ if (envelope == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+
+ if (!settings.isAutoResponse() || !envelope.hasDomainRecipients() |
| NotificationHelper.isMDN(envelope.getMessage()))
+ {
+ LOGGER.info("No MDN messages to send.");
+ return Collections.emptyList();
+ }
+
+ LOGGER.info("Generating MDN \"processed\" messages");
+
+ Collection<InternetAddress> senders =
envelope.getDomainRecipients().toInternetAddressCollection();
+ Collection<NotificationMessage> notifications =
NotificationHelper.createNotificationMessages(envelope.getMessage(),
senders, this);
+
+ return notifications;
+ }
+
+ public Collection<NotificationMessage> produce(Message msg,
Collection<InternetAddress> recipients)
+ {
+ if (msg == null || recipients == null || recipients.size() == 0)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ Collection<InternetAddress> senders = recipients;
+ Collection<NotificationMessage> notifications =
NotificationHelper.createNotificationMessages(msg, senders, this);
+
+ return notifications;
+ }
+
+ /*
+ * Creates an ack message.
+ */
+ protected Notification createAck(InternetAddress address)
+ {
+ Notification notification = new
Notification(NotificationType.Processed);
+ if (settings.hasText())
+ {
+ notification.setExplanation(settings.getText());
+ }
+
+ notification.setReportingAgent(new
ReportingUserAgent(NHINDAddress.getHost(address),
settings.getProductName()));
+ return notification;
+ }
+
+
+ /**
+ * Gets the notification settings for the producer.
+ * @return The notification settings for the producer.
+ */
+ public NotificationSettings getNotificationSettings()
+ {
+ return settings;
+ }
+
+}
+
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/NotificationSettings.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,84 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+/**
+ * Notification settings for SmtpAgent.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public class NotificationSettings
+{
+ private static final String DEFAULT_TEXT = "Security Agent";
+
+ private final boolean autoResponse;
+ private final String productName;
+ private final String text;
+
+
+ public NotificationSettings()
+ {
+ this(true, DEFAULT_TEXT, "");
+ }
+
+ public NotificationSettings(boolean autoResponse)
+ {
+ this(autoResponse, DEFAULT_TEXT, "");
+ }
+
+ public NotificationSettings(boolean autoResponse, String productName,
String text)
+ {
+ this.autoResponse = autoResponse;
+
+ if (productName == null || productName.isEmpty())
+ this.productName = DEFAULT_TEXT;
+ else
+ this.productName = productName;
+
+ if (text == null)
+ this.text = "";
+ else
+ this.text = text;
+ }
+
+ public boolean isAutoResponse()
+ {
+ return autoResponse;
+ }
+
+ public String getProductName()
+ {
+ return productName;
+ }
+
+ public boolean hasText()
+ {
+ return !text.isEmpty();
+ }
+
+ public String getText()
+ {
+ return text;
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ProcessBadMessageSettings.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,40 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+/**
+ * Settings specific to processing failed messages.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public class ProcessBadMessageSettings extends MessageProcessingSettings
+{
+ /**
+ * Constructor with default settings.
+ */
+ public ProcessBadMessageSettings()
+ {
+ super();
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ProcessIncomingSettings.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,41 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+/**
+ * Settings specific to processing incoming messages.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public class ProcessIncomingSettings extends MessageProcessingSettings
+{
+ /**
+ * Constructor with default settings.
+ */
+ public ProcessIncomingSettings()
+ {
+ super();
+ }
+
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ProcessOutgoingSettings.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,40 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+/**
+ * Settings specific to processing outgoing messages.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public class ProcessOutgoingSettings extends MessageProcessingSettings
+{
+ /**
+ * Constructor with default settings.
+ */
+ public ProcessOutgoingSettings()
+ {
+ super();
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/RawMessageSettings.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,40 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+/**
+ * Settings specific to processing raw messages.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public class RawMessageSettings extends MessageProcessingSettings
+{
+ /**
+ * Constructor with default settings.
+ */
+ public RawMessageSettings()
+ {
+ super();
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/ReliableDispatchedNotificationProducer.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,65 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import java.util.Arrays;
+
+import javax.mail.internet.InternetAddress;
+
+import org.nhindirect.common.mail.MDNStandard;
+import org.nhindirect.stagent.NHINDAddress;
+import org.nhindirect.stagent.mail.notifications.Notification;
+import org.nhindirect.stagent.mail.notifications.NotificationType;
+import org.nhindirect.stagent.mail.notifications.ReportingUserAgent;
+
+/**
+ * Notification producer for creating MDN dispatched messages.
+ * @author Greg Meyer
+ * @since 2.0
+ */
+public class ReliableDispatchedNotificationProducer extends
NotificationProducer
+{
+ /**
+ * Constructor
+ * @param settings Notification specific settings
+ */
+ public ReliableDispatchedNotificationProducer(NotificationSettings
settings)
+ {
+ super(settings);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Notification createAck(InternetAddress address)
+ {
+ Notification notification = new
Notification(NotificationType.Dispatched);
+ if (settings.hasText())
+ {
+ notification.setExplanation(settings.getText());
+ }
+
+ notification.setReportingAgent(new
ReportingUserAgent(NHINDAddress.getHost(address),
settings.getProductName()));
+
notification.setExtensions(Arrays.asList(MDNStandard.DispositionOption_TimelyAndReliable));
+ return notification;
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgent.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,71 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import javax.mail.internet.MimeMessage;
+
+import org.nhindirect.stagent.NHINDAddress;
+import org.nhindirect.stagent.NHINDAddressCollection;
+import org.nhindirect.stagent.NHINDAgent;
+
+import com.google.inject.ImplementedBy;
+
+
+/**
+ * The SmtpAgent is a generic gateway to the security trust agent that
handles message over the SMTP protocol. It is intended to sit between an
SMTP
+ * server implementation coupled with an server specific bridge and the
security trust bridge. Because each SMTP server potentially
+ * handles custom message processing differently and creates server
specific message/SMTP envelope wrappers, bridge implementations are specific
+ * to the servers that they are coupled with. The bridges are responsible
for intercepting messages through the SMTP stack, gathers routing
information
+ * (either from the message routing headers or the SMTP envelope headers),
calling the SmtpAgent, and moving processed messages forward through the
SMTP
+ * stack. Bridges are also responsible for relaying any bounce messages
created by the SmtpAgent. NOTE: Bounce messages are also processed by the
+ * security and trust agent before being returned.
+ *
+ * @author Greg Meyer
+ *
+ */
+@ImplementedBy(DefaultSmtpAgent.class)
+public interface SmtpAgent
+{
+ /**
+ * Processes an message from an SMTP stack. The bridge component between
the SMTP stack and the SMTP agent is responsible for
+ * extracting the message, the recipient list, and the sender. In some
cases, the routing headers may have different information than
+ * what is populated in the SMTP MAIL FROM and RCTP TO headers. In these
cases, the SMTP headers should be favored over the routing
+ * headers in the message and passed as the recipient collection and
sender to this method.
+ * @param message The message in the SMTP envelope.
+ * @param recipients The recipients of the message. The RCTP TO headers
should be used over the message routing headers.
+ * @param sender The send of the message. The MAIL FROM header should be
used over the From: routing header in the message.
+ */
+ public MessageProcessResult processMessage(MimeMessage message,
NHINDAddressCollection recipients, NHINDAddress sender);
+
+ /**
+ * Gets a references to the security and trust agent used by the
SmtpAgent.
+ * @return A references to the security and trust agent used by the
SmtpAgent
+ */
+ public NHINDAgent getAgent();
+
+ /**
+ * Gets the configuration settings of the SmtpAgent.
+ * @return The configuration settings of the SmtpAgent.
+ */
+ public SmtpAgentSettings getSmtpAgentSettings();
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgentError.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,49 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+/**
+ * Error conditions for processing message in the {@link SmtpAgent}.
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public enum SmtpAgentError
+{
+ Unknown,
+ Uninitialized,
+ MissingPostmaster,
+ MissingLogSettings,
+ InvalidEnvelopeFromAgent,
+ EmptyResultFromAgent,
+ MissingMailPickupFolder,
+ MailPickupFolderDoesNotExist,
+ MissingBounceTemplateOutgoing,
+ MissingBounceTemplateIncoming,
+ MissingDomains,
+ MissingDomainName,
+ InvalidBounceMessageTemplate,
+ InvalidTrustAnchorSettings,
+ InvalidPrivateCertStoreSettings,
+ InvalidConfigurationFormat
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgentException.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,76 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import org.nhindirect.stagent.NHINDException;
+
+/**
+ * Exceptions thrown by the {@link SmtpAgent}
+ * @author Greg Meyer
+ * @author Umesh Madan
+ *
+ */
+public class SmtpAgentException extends NHINDException
+{
+ static final long serialVersionUID = 8534058110248864799L;
+
+ /**
+ * Constructs an exception with an SmtpAgentError.
+ * @param error The smtp agent error
+ */
+ public SmtpAgentException(SmtpAgentError error)
+ {
+ super(error);
+ }
+
+ /**
+ * Constructs an exception with a message and the smtp agent error.
+ * @param error The smtp agent error
+ * @param msg The exception message.
+ */
+ public SmtpAgentException(SmtpAgentError error, String message)
+ {
+ super(error, message);
+ }
+
+ /**
+ * Constructs an exception with the smtp agent error and the exception
that caused the error.
+ * @param error The smtp agent error.
+ * @param innerException The exception that caused the error.
+ */
+ public SmtpAgentException(SmtpAgentError error, Exception
innerException)
+ {
+ super(error, innerException);
+ }
+
+ /**
+ * Constructs an exception with the smtp agent error, a message, and the
exception that caused the error.
+ * @param error The smtp agent error.
+ * @param msg The exception message.
+ * @param innerException The exception that caused the error.
+ */
+ public SmtpAgentException(SmtpAgentError error, String message,
Exception innerException)
+ {
+ super(error, message, innerException);
+ }
+}
=======================================
--- /dev/null
+++
/java/tags/gateway-4.0/src/main/java/org/nhindirect/gateway/smtp/SmtpAgentFactory.java
Mon Jan 19 15:29:14 2015 UTC
@@ -0,0 +1,137 @@
+/*
+Copyright (c) 2010, NHIN Direct Project
+All rights reserved.
+
+Authors:
+ Umesh Madan ume...@microsoft.com
+ Greg Meyer gm2...@cerner.com
+
+Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
+Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
distribution. Neither the name of the The NHIN Direct Project
(nhindirect.org).
+nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+package org.nhindirect.gateway.smtp;
+
+import java.net.URL;
+import java.util.Collection;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.nhindirect.gateway.smtp.config.SmptAgentConfigFactory;
+import org.nhindirect.gateway.smtp.config.SmtpAgentConfig;
+import org.nhindirect.stagent.NHINDAgent;
+
+import com.google.inject.Injector;
+import com.google.inject.Module;
+import com.google.inject.Provider;
+
+/**
+ * The SmtpAgentFactory is a bootstrapper for creating instances of the
{@link SmtpAgent) based on configuration information. Configurations
+ * are loaded from a URL that may take the form of any addressable
resource such as a file, HTTP resource, LDAP store, or database. Based on
the
+ * URL protocol, an appropriate configuration loader and parser is
instantiated which creates an injector used to provide instance of the
SmptAgent.
+ * Optionally specific configuration and security and trust agent
providers can be passed for specific object creation. This is generally
useful
+ * for creating mock implementations for testing.
+ * @author Greg Meyer
+ *
+ */
+public class SmtpAgentFactory
+{
+ private static final Log LOGGER =
LogFactory.getFactory().getInstance(SmtpAgentFactory.class);
+
+ /**
+ * Creates an instance of an {@link SmtpAgent} using the configuration
information stored at the configuration location.
+ * @param configLocation The URL of the configuration information. The
URL may refer to any addressable resource.
+ * @return An initialized instance of an SmtpAgent.
+ * @throws SmtpAgentException Thrown if an error occurs while creating
the SmtpAgent.
+ */
+ public synchronized static SmtpAgent createAgent(URL configLocation)
throws SmtpAgentException
+ {
+ return createAgent(configLocation, null, null, null);
+ }
+
+ /**
+ * Creates an instance of an {@link SmtpAgent} using the configuration
information stored at the configuration location. Optional
+ * SmptAgentConfig and security and trust providers can be passed to
create specific types of these components.
+ * @param configLocation The URL of the configuration information. The
URL may refer to any addressable resource.
+ * @param configProvider A provider used to create the SmtpAgentConfig
component that parses and the configuration.
+ * @param agentProvider A provider used to create the security and trust
agent component.
+ * @return An initialized instance of an SmtpAgent.
+ * @throws SmtpAgentException Thrown if an error occurs while creating
the SmtpAgent.
+ */
+ public synchronized static SmtpAgent createAgent(URL configLocation,
Provider<SmtpAgentConfig> configProvider,
+ Provider<NHINDAgent> agentProvider) throws SmtpAgentException
+ {
+ return createAgent(configLocation, configProvider, agentProvider, null);
+ }
+
+ /**
+ * Creates an instance of an {@link SmtpAgent} using the configuration
information stored at the configuration location. Optional
+ * SmptAgentConfig and security and trust providers can be passed to
create specific types of these components. Additional Guice
+ * {@link Modules Modules} can be provided for additional dependency
creation and injection.
+ * @param configLocation The URL of the configuration information. The
URL may refer to any addressable resource.
+ * @param configProvider A provider used to create the SmtpAgentConfig
component that parses and the configuration.
+ * @param agentProvider A provider used to create the security and trust
agent component.
+ * @param modules A collection of modules used for creating additional
Guice bindings.
+ * @return An initialized instance of an SmtpAgent.
+ * @throws SmtpAgentException Thrown if an error occurs while creating
the SmtpAgent.
+ */
+ public synchronized static SmtpAgent createAgent(URL configLocation,
Provider<SmtpAgentConfig> configProvider,
+ Provider<NHINDAgent> agentProvider, Collection<? extends Module>
modules) throws SmtpAgentException
+ {
+ SmtpAgent retVal = null;
+
+ try
+ {
+ Injector agentInjector = buildAgentInjector(configLocation,
configProvider, agentProvider);
+
+ if (modules != null && modules.size() > 0)
+ agentInjector = agentInjector.createChildInjector(modules);
+
+ retVal = agentInjector.getInstance(SmtpAgent.class);
+
+ agentInjector.injectMembers(retVal);
+
+ }
+ catch (SmtpAgentException e)
+ {
+ // rethrow
+ throw e;
+ }
+ catch (Exception t)
+ {
+ // catch all
+ LOGGER.error("SmtpAgent creation failed: " + t.getMessage(), t);
+ throw new SmtpAgentException(SmtpAgentError.Unknown, "SmtpAgent
creation failed: " + t.getMessage(), t);
+ }
+ catch (Throwable t)
+ {
+ // catch all
+ LOGGER.error("SmtpAgent creation failed: " + t.getMessage(), t);
+ throw new SmtpAgentException(SmtpAgentError.Unknown, "SmtpAgent
creation failed: " + t.getMessage());
+ }
+
+ return retVal;
+ }
+
+
+ /*
+ * Creates an injector for getting SmtpAgent instances
+ */
+ protected static Injector buildAgentInjector(URL configLocation,
Provider<SmtpAgentConfig> configProvider, Provider<NHINDAgent>
agentProvider)
+ {
+ SmtpAgentConfig config =
SmptAgentConfigFactory.createSmtpAgentConfig(configLocation,
configProvider, agentProvider);
+
+ return config.getAgentInjector();
+ }
+
+}
=======================================
***Additional files exist in this changeset.***
Reply all
Reply to author
Forward
0 new messages