Exemplo n.º 1
0
 /// <summary>
 /// Tells the saga persister that it should allow potential stale queries when loading sagas
 /// </summary>
 /// <param name="cfg">Object to attach to</param>
 /// <returns></returns>
 public static PersistenceExtentions <RavenDBPersistence> AllowStaleSagaReads(this PersistenceExtentions <RavenDBPersistence> cfg)
 {
     cfg.GetSettings().Set(AllowStaleSagaReadsKey, true);
     return(cfg);
 }
 /// <summary>
 /// Should an attempt at startup be made to verify if subscriptions storage table exists or not and if not create it.
 /// <remarks>Operation will fail if connection string does not allow access to create storage tables</remarks>
 /// </summary>
 public static PersistenceExtentions <AzureStoragePersistence, StorageType.Subscriptions> CreateSchema(this PersistenceExtentions <AzureStoragePersistence, StorageType.Subscriptions> config, bool createSchema)
 {
     config.GetSettings().Set("AzureSubscriptionStorage.CreateSchema", createSchema);
     return(config);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Configures the given document store to be used when storing sagas
 /// </summary>
 /// <param name="cfg">Object to attach to</param>
 /// <param name="documentStore">The document store to be used</param>
 /// <returns></returns>
 public static PersistenceExtentions <RavenDBPersistence> UseDocumentStoreForSagas(this PersistenceExtentions <RavenDBPersistence> cfg, IDocumentStore documentStore)
 {
     cfg.GetSettings().Set(DocumentStoreSettingsKey, documentStore);
     return(cfg);
 }
        /// <summary>
        /// Connection string to use for subscriptions storage.
        /// </summary>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Subscriptions> ConnectionString(this PersistenceExtentions <AzureStoragePersistence, StorageType.Subscriptions> config, string connectionString)
        {
            AzureSubscriptionStorageGuard.CheckConnectionString(connectionString);

            config.GetSettings().Set("AzureSubscriptionStorage.ConnectionString", connectionString);
            return(config);
        }
        /// <summary>
        /// Table name to create in Azure storage account to persist subscriptions.
        /// </summary>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Subscriptions> TableName(this PersistenceExtentions <AzureStoragePersistence, StorageType.Subscriptions> config, string tableName)
        {
            AzureSubscriptionStorageGuard.CheckTableName(tableName);

            config.GetSettings().Set("AzureSubscriptionStorage.TableName", tableName);
            return(config);
        }
Exemplo n.º 6
0
 /// <summary>
 /// Specifies the mapping to use for when resolving the database name to use for each message.
 /// </summary>
 /// <param name="cfg">The configuration object.</param>
 /// <param name="convention">The method referenced by a Func delegate for finding the database name for the specified message.</param>
 /// <returns>The configuration object.</returns>
 public static PersistenceExtentions <RavenDBPersistence> SetMessageToDatabaseMappingConvention(this PersistenceExtentions <RavenDBPersistence> cfg, Func <IMessageContext, string> convention)
 {
     OpenSessionBehavior.GetDatabaseName = convention;
     return(cfg);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Tells the persister to not setup user permissions for the database
 /// </summary>
 /// <param name="cfg"></param>
 /// <returns></returns>
 public static PersistenceExtentions <RavenDBPersistence> DoNotSetupDatabasePermissions(this PersistenceExtentions <RavenDBPersistence> cfg)
 {
     cfg.GetSettings().Set("RavenDB.DoNotSetupPermissions", true);
     return(cfg);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Configures the persisters to connection to the server specified
 /// </summary>
 /// <param name="cfg"></param>
 /// <param name="connectionParameters">Connection details</param>
 /// <returns></returns>
 public static PersistenceExtentions <RavenDBPersistence> SetDefaultDocumentStore(this PersistenceExtentions <RavenDBPersistence> cfg, ConnectionParameters connectionParameters)
 {
     cfg.GetSettings().Set(DefaultConnectionParameters, connectionParameters);
     // This will be registered with RavenUserInstaller once we initialize the document store object internally
     return(cfg);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Specifies the session that the shared persisters (saga + outbox) that should be used. The lifecycle is controled by me
 /// </summary>
 /// <param name="cfg"></param>
 /// <param name="getSessionFunc">A func returning the session to be used</param>
 /// <returns></returns>
 public static PersistenceExtentions <RavenDBPersistence> UseSharedSession(this PersistenceExtentions <RavenDBPersistence> cfg, Func <IDocumentSession> getSessionFunc)
 {
     cfg.GetSettings().Set(SharedSessionSettingsKey, getSessionFunc);
     return(cfg);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Configures the storages to use the given document store supplied
 /// </summary>
 /// <param name="cfg"></param>
 /// <param name="documentStore">Document store managed by me as a user</param>
 /// <returns></returns>
 public static PersistenceExtentions <RavenDBPersistence> SetDefaultDocumentStore(this PersistenceExtentions <RavenDBPersistence> cfg, IDocumentStore documentStore)
 {
     cfg.GetSettings().Set(DocumentStoreSettingsKey, documentStore);
     return(cfg);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Configures the given document store to be used when storing gateway deduplication data
 /// </summary>
 /// <param name="cfg"></param>
 /// <param name="documentStore">The document store to use</param>
 /// <returns></returns>
 public static PersistenceExtentions <RavenDBPersistence> UseDocumentStoreForGatewayDeduplication(this PersistenceExtentions <RavenDBPersistence> cfg, IDocumentStore documentStore)
 {
     cfg.GetSettings().Set(SettingsKey, documentStore);
     return(cfg);
 }
        /// <summary>
        ///  Time range used as partition key value for all timeouts.
        /// </summary>
        /// <param name="partitionKeyScope">Partition key DateTime format string.</param>
        /// <param name="config"></param>
        /// <remarks>For optimal performance, this should be in line with the CatchUpInterval.</remarks>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> PartitionKeyScope(this PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> config, string partitionKeyScope)
        {
            AzureTimeoutStorageGuard.CheckPartitionKeyScope(partitionKeyScope);

            config.GetSettings().Set("AzureTimeoutStorage.PartitionKeyScope", partitionKeyScope);
            return(config);
        }
        /// <summary>
        ///  Set the catchup interval in seconds for missed timeouts.
        /// </summary>
        /// <param name="catchUpInterval">Catch up interval in seconds</param>
        /// <param name="config"></param>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> CatchUpInterval(this PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> config, int catchUpInterval)
        {
            AzureTimeoutStorageGuard.CheckCatchUpInterval(catchUpInterval);

            config.GetSettings().Set("AzureTimeoutStorage.CatchUpInterval", catchUpInterval);
            return(config);
        }
        /// <summary>
        /// Set the name of the table where the timeout manager stores it's internal state.
        /// </summary>
        public static PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> TimeoutManagerDataTableName(this PersistenceExtentions <AzureStoragePersistence, StorageType.Timeouts> config, string tableName)
        {
            AzureTimeoutStorageGuard.CheckTableName(tableName);

            config.GetSettings().Set("AzureTimeoutStorage.TimeoutManagerDataTableName", tableName);
            return(config);
        }