public OperationController(
            ISmsStoreFactory factory,
            ServiceConfiguration configuration,
            IReportManager reportManager,
            IInboundManager inboundManager,
            ICredentialManager credentialManager,
            MetricManager metricManager)
        {
            this.store             = factory.GetStore();
            this.configuration     = configuration;
            this.reportManager     = reportManager;
            this.inboundManager    = inboundManager;
            this.credentialManager = credentialManager;
            this.metricManager     = metricManager;

            this.random       = new Random();
            this.proxyFactory = new ServiceProxyFactory((c) =>
            {
                return(new FabricTransportServiceRemotingClientFactory(
                           serializationProvider: new ServiceRemotingJsonSerializationProvider()));
            });

            if (this.configuration.SmsOpsInfo.IsValid())
            {
                this.mailHelper = new MailHelper(this.configuration.SmsOpsInfo);
            }
        }
Exemple #2
0
        public static void ConfigureApp(IAppBuilder appBuilder, IInboundManager inboundManager)
        {
            // Configure Web API for self-host.
            var config = new HttpConfiguration();

            config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
            config.Formatters.JsonFormatter.SerializerSettings.Converters.Add(new StringEnumConverter());
            config.Formatters.JsonFormatter.UseDataContractJsonSerializer = false;
            config.MapHttpAttributeRoutes();

            config.Properties[typeof(IInboundManager).Name] = inboundManager;

            // TLS1.2+: Enable Connection Logging
            appBuilder.Use <ConnectionLogMiddleware>("Microsoft.Azure.EngagementFabric.SmsProvider");

            appBuilder.UseWebApi(config);
        }
Exemple #3
0
        public SmsProvider(StatelessServiceContext context)
            : base(context)
        {
            this.configuration = new ServiceConfiguration(FabricRuntime.GetNodeContext(), context.CodePackageActivationContext);
            this.storeFactory  = new SmsStoreFactory(this.configuration.DefaultConnectionString);
            this.billingAgent  = new BillingAgent();
            this.metricManager = new MetricManager(this.configuration);

            // this.timeSeriesManager = this.BuildTimeSeriesManager();

            this.credentialManager = new CredentialManager(this.storeFactory);
            this.reportManager     = new ReportManager(
                this.storeFactory,
                this.configuration,
                this.billingAgent,
                this.metricManager,
                this.credentialManager);
            this.inboundManager = new InboundManager(
                this.storeFactory,
                this.configuration,
                this.reportManager,
                this.credentialManager);
        }