Search in sources :

Example 1 with TransactionMemoryStore

use of edu.uiuc.ncsa.security.delegation.storage.impl.TransactionMemoryStore in project OA4MP by ncsa.

the class AbstractConfigurationLoader method getTSP.

protected Provider<TransactionStore> getTSP() {
    if (tsp == null) {
        final DSTransactionProvider tp = new DSTransactionProvider<OA4MPServiceTransaction>();
        TransactionConverter<OA4MPServiceTransaction> tc = new TransactionConverter(tp, getTokenForgeProvider().get(), (ClientStore<? extends Client>) getCSP().get());
        MultiDSTransactionStoreProvider storeProvider = new MultiDSTransactionStoreProvider(cn, isDefaultStoreDisabled(), loggerProvider.get(), tp);
        storeProvider.addListener(new DSSQLTransactionStoreProvider(cn, getMySQLConnectionPoolProvider(), OA4MPConfigTags.MYSQL_STORE, getCSP(), tp, getTokenForgeProvider(), tc));
        storeProvider.addListener(new DSSQLTransactionStoreProvider(cn, getMariaDBConnectionPoolProvider(), OA4MPConfigTags.MARIADB_STORE, getCSP(), tp, getTokenForgeProvider(), tc));
        storeProvider.addListener(new DSSQLTransactionStoreProvider(cn, getPgConnectionPoolProvider(), OA4MPConfigTags.POSTGRESQL_STORE, getCSP(), tp, getTokenForgeProvider(), tc));
        storeProvider.addListener(new DSFSTransactionStoreProvider(cn, tp, getTokenForgeProvider(), tc));
        storeProvider.addListener(new TypedProvider<TransactionStore>(cn, OA4MPConfigTags.MEMORY_STORE, OA4MPConfigTags.TRANSACTIONS_STORE) {

            @Override
            public Object componentFound(CfgEvent configurationEvent) {
                if (checkEvent(configurationEvent)) {
                    return get();
                }
                return null;
            }

            @Override
            public TransactionStore get() {
                return new TransactionMemoryStore(tp);
            }
        });
        tsp = storeProvider;
    }
    return tsp;
}
Also used : OA4MPServiceTransaction(edu.uiuc.ncsa.myproxy.oa4mp.server.OA4MPServiceTransaction) CfgEvent(edu.uiuc.ncsa.security.core.configuration.provider.CfgEvent) TransactionMemoryStore(edu.uiuc.ncsa.security.delegation.storage.impl.TransactionMemoryStore) TransactionStore(edu.uiuc.ncsa.security.delegation.storage.TransactionStore)

Aggregations

OA4MPServiceTransaction (edu.uiuc.ncsa.myproxy.oa4mp.server.OA4MPServiceTransaction)1 CfgEvent (edu.uiuc.ncsa.security.core.configuration.provider.CfgEvent)1 TransactionStore (edu.uiuc.ncsa.security.delegation.storage.TransactionStore)1 TransactionMemoryStore (edu.uiuc.ncsa.security.delegation.storage.impl.TransactionMemoryStore)1