/**
         * load a template instance fresh from the original FormDef, retrieved from RMS
         * @param formID
         * @return
         */
        public static FormInstance loadTemplateInstance(int formID)
        {
            IStorageUtility forms = StorageManager.getStorage(FormDef.STORAGE_KEY);
            FormDef         f     = (FormDef)forms.read(formID);

            return(f != null ? f.Instance : null);
        }
Exemple #2
0
 public ProvisioningHelper(
     IProvisioningClient provisioningClient,
     LunaClient lunaClient,
     IStorageUtility storageUtility,
     ISqlDbContext context
     )
 {
     _provisioningClient = provisioningClient ?? throw new ArgumentNullException(nameof(provisioningClient));
     _lunaClient         = lunaClient ?? throw new ArgumentNullException(nameof(lunaClient));
     _storage            = storageUtility ?? throw new ArgumentNullException(nameof(storageUtility));
     _context            = context ?? throw new ArgumentNullException(nameof(context));
 }
        /// <summary>
        /// Run-time constructor
        /// </summary>
        /// <param name="storageUtility">Utility for storing information</param>
        /// <param name="context">Context for the application</param>
        /// <param name="dialog">Dialog to show errors</param>
        /// <param name="syndicationHelper">Syndication to help parse blog entries</param>
        public BlogDataSource(
            IStorageUtility storageUtility,
            IApplicationContext context,
            IDialog dialog,
            ISyndicationHelper syndicationHelper)
        {
            _context           = context;
            _dialog            = dialog;
            _syndicationHelper = syndicationHelper;
            _storage           = storageUtility;

            GroupList = new ObservableCollection <BlogGroup>();
        }
 public TrackSaveService(
     ILibraryService libraryService,
     IConverter <WebSong, Track> webSongConverter,
     ILibraryMatchingService matchingService,
     IInsightsService insightsService,
     IStorageUtility storageUtility,
     IDownloadService downloadService)
 {
     _libraryService   = libraryService;
     _webSongConverter = webSongConverter;
     _matchingService  = matchingService;
     _insightsService  = insightsService;
     _storageUtility   = storageUtility;
     _downloadService  = downloadService;
 }
 public TrackSaveService(
     ILibraryService libraryService,
     IConverter<WebSong, Track> webSongConverter,
     ILibraryMatchingService matchingService,
     IInsightsService insightsService,
     IStorageUtility storageUtility,
     IDownloadService downloadService)
 {
     _libraryService = libraryService;
     _webSongConverter = webSongConverter;
     _matchingService = matchingService;
     _insightsService = insightsService;
     _storageUtility = storageUtility;
     _downloadService = downloadService;
 }
Exemple #6
0
 /// <summary>
 /// Constructor that uses dependency injection.
 /// </summary>
 /// <param name="sqlDbContext">The context to inject.</param>
 /// <param name="offerService">The service to inject.</param>
 /// <param name="logger">The logger.</param>
 public ArmTemplateService(
     ISqlDbContext sqlDbContext,
     IStorageUtility storageUtility,
     IOfferService offerService,
     IArmTemplateParameterService armTemplateParameterService,
     IArmTemplateArmTemplateParameterService armTemplateArmTemplateParameterService,
     ILogger <ArmTemplateService> logger)
 {
     _context        = sqlDbContext ?? throw new ArgumentNullException(nameof(sqlDbContext));
     _offerService   = offerService ?? throw new ArgumentNullException(nameof(offerService));
     _storageUtility = storageUtility ?? throw new ArgumentNullException(nameof(storageUtility));
     _armTemplateParameterService            = armTemplateParameterService ?? throw new ArgumentNullException(nameof(armTemplateParameterService));
     _armTemplateArmTemplateParameterService = armTemplateArmTemplateParameterService ?? throw new ArgumentNullException(nameof(armTemplateArmTemplateParameterService));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemple #7
0
        public ProvisioningService(ISqlDbContext sqlDbContext, IProvisioningClient provisioningClient,
                                   IFulfillmentClient fulfillmentclient, IIpAddressService ipAddressService,
                                   ISubscriptionParameterService subscriptionParameterService, IArmTemplateParameterService armTemplateParameterService,
                                   IWebhookParameterService webhookParameterService, IStorageUtility storageUtility, ILogger <ProvisioningService> logger)
        {
            _context                      = sqlDbContext ?? throw new ArgumentNullException(nameof(sqlDbContext));
            _provisioningClient           = provisioningClient ?? throw new ArgumentNullException(nameof(provisioningClient));
            _fulfillmentClient            = fulfillmentclient ?? throw new ArgumentNullException(nameof(fulfillmentclient));
            _ipAddressService             = ipAddressService ?? throw new ArgumentNullException(nameof(ipAddressService));
            _subscriptionParameterService = subscriptionParameterService ?? throw new ArgumentNullException(nameof(subscriptionParameterService));
            _armTemplateParameterService  = armTemplateParameterService ?? throw new ArgumentNullException(nameof(armTemplateParameterService));
            _webhookParameterService      = webhookParameterService ?? throw new ArgumentNullException(nameof(webhookParameterService));
            _storageUtility               = storageUtility ?? throw new ArgumentNullException(nameof(storageUtility));
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));

            //TODO: add the app settings.
            _maxRetry = 3;
        }
 private void memoize()
 {
     if (payload == null)
     {
         IStorageUtility instances = StorageManager.getStorage(FormInstance.STORAGE_KEY);
         try
         {
             FormInstance tree = (FormInstance)instances.read(recordId);
             payload = serializer.createSerializedPayload(tree);
         }
         catch (IOException e)
         {
             //Assertion, do not catch!
             Console.WriteLine(e.StackTrace);
             throw new SystemException("ModelReferencePayload failed to retrieve its model from rms [" + e.Message + "]");
         }
     }
 }
Exemple #9
0
 public CustomMeterEventService(
     IOptionsMonitor <SecuredProvisioningClientConfiguration> optionsMonitor,
     ILogger <CustomMeterEventService> logger,
     ICustomMeterService customMeterService,
     IKeyVaultHelper keyVaultHelper,
     ICustomMeteringClient customMeteringClient,
     ISubscriptionService subscriptionService,
     ISubscriptionCustomMeterUsageService subscriptionCustomMeterUsageService,
     ICustomMeterDimensionService customMeterDimensionService,
     ITelemetryDataConnectorService telemetryDataConnectorService,
     IOfferService offerService,
     IStorageUtility storageUtility)
 {
     _logger               = logger;
     _customMeterService   = customMeterService;
     _customMeteringClient = customMeteringClient;
     _subscriptionService  = subscriptionService;
     _subscriptionCustomMeterUsageService = subscriptionCustomMeterUsageService;
     _customMeterDimensionService         = customMeterDimensionService;
     _offerService = offerService;
     _telemetryDataConnectorService = telemetryDataConnectorService;
     _storageUtility             = storageUtility;
     _telemetryConnectionManager = new TelemetryDataConnectorManager(new HttpClient(), logger, keyVaultHelper);
 }
Exemple #10
0
 /**
  * Create a new wrapping StorageUtility
  *
  * @param name unique name for underlying StorageUtility
  * @param wrapper serialization wrapper
  * @param storageFactory factory to create underlying StorageUtility
  */
 public WrappingStorageUtility(String name, SerializationWrapper wrapper, IStorageFactory storageFactory)
 {
     this.storage = storageFactory.newStorage(name, wrapper.GetType());
     this.wrapper = wrapper;
 }
Exemple #11
0
 /// <summary> It is strongly, strongly advised that you do not register storage in this way.
 ///
 /// </summary>
 /// <param name="key">
 /// </param>
 /// <param name="storage">
 /// </param>
 public static void registerStorage(System.String key, IStorageUtility storage)
 {
     storageRegistry.Add(key, storage);
 }
 /// <summary> Create a new wrapping StorageUtility</summary>
 /// <param name="name">unique name for underlying StorageUtility
 /// </param>
 /// <param name="wrapper">serialization wrapper
 /// </param>
 /// <param name="storageFactory">factory to create underlying StorageUtility
 /// </param>
 public WrappingStorageUtility(System.String name, WrappingStorageUtility.SerializationWrapper wrapper, IStorageFactory storageFactory)
 {
     InitBlock();
     this.storage = storageFactory.newStorage(name, wrapper.GetType());
     this.wrapper = wrapper;
 }