Search in sources :

Example 1 with DSFSClientStoreProvider

use of edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider in project OA4MP by ncsa.

the class OA2ConfigurationLoader method getCSP.

@Override
protected MultiDSClientStoreProvider getCSP() {
    if (csp == null) {
        OA2ClientConverter converter = new OA2ClientConverter(getClientProvider());
        csp = new OA2MultiDSClientStoreProvider(cn, isDefaultStoreDisabled(), loggerProvider.get(), null, null, getClientProvider());
        csp.addListener(new DSFSClientStoreProvider(cn, converter, getClientProvider()));
        csp.addListener(new OA2ClientSQLStoreProvider(getMySQLConnectionPoolProvider(), OA4MPConfigTags.MYSQL_STORE, converter, getClientProvider()));
        csp.addListener(new OA2ClientSQLStoreProvider(getMariaDBConnectionPoolProvider(), OA4MPConfigTags.MARIADB_STORE, converter, getClientProvider()));
        csp.addListener(new OA2ClientSQLStoreProvider(getPgConnectionPoolProvider(), OA4MPConfigTags.POSTGRESQL_STORE, converter, getClientProvider()));
        csp.addListener(new TypedProvider<ClientStore>(cn, OA4MPConfigTags.MEMORY_STORE, OA4MPConfigTags.CLIENTS_STORE) {

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

            @Override
            public ClientStore get() {
                return new OA2ClientMemoryStore(getClientProvider());
            }
        });
    }
    return csp;
}
Also used : AdminClientStore(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClientStore) ClientStore(edu.uiuc.ncsa.security.delegation.server.storage.ClientStore) DSFSClientStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider) CfgEvent(edu.uiuc.ncsa.security.core.configuration.provider.CfgEvent)

Example 2 with DSFSClientStoreProvider

use of edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider in project OA4MP by ncsa.

the class ServiceConfigTest method testClientStoreProvider.

/**
 * Just reads in the configuration and calls "get" on the provider. This should work if the
 * configuration file is read.
 * @throws Exception
 */
@Test
public void testClientStoreProvider() throws Exception {
    ConfigurationNode cn = getConfig("mixed config");
    ClientProvider clientProvider = new ClientProvider(new OA4MPIdentifierProvider(OA4MPIdentifierProvider.CLIENT_ID));
    MultiDSClientStoreProvider csp = new MultiDSClientStoreProvider(cn, true, new MyLoggingFacade("test"), null, null, clientProvider);
    ClientConverter converter = new ClientConverter(clientProvider);
    csp.addListener(new DSFSClientStoreProvider(cn, converter, clientProvider));
    csp.addListener(new DSClientSQLStoreProvider(cn, new MySQLConnectionPoolProvider("oauth", "oauth"), MYSQL_STORE, converter, clientProvider));
    csp.addListener(new DSClientSQLStoreProvider(cn, new PGConnectionPoolProvider("oauth", "oauth"), POSTGRESQL_STORE, converter, clientProvider));
    ClientStore<Client> cs = (ClientStore<Client>) csp.get();
}
Also used : MultiDSClientStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientStoreProvider) ClientConverter(edu.uiuc.ncsa.security.delegation.storage.impl.ClientConverter) PGConnectionPoolProvider(edu.uiuc.ncsa.security.storage.sql.postgres.PGConnectionPoolProvider) ClientProvider(edu.uiuc.ncsa.security.delegation.storage.ClientProvider) DSFSClientStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider) MyLoggingFacade(edu.uiuc.ncsa.security.core.util.MyLoggingFacade) MySQLConnectionPoolProvider(edu.uiuc.ncsa.security.storage.sql.mysql.MySQLConnectionPoolProvider) ClientStore(edu.uiuc.ncsa.security.delegation.server.storage.ClientStore) DSClientSQLStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.sql.provider.DSClientSQLStoreProvider) OA4MPIdentifierProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider) ConfigurationNode(org.apache.commons.configuration.tree.ConfigurationNode) Client(edu.uiuc.ncsa.security.delegation.storage.Client) ConfigTest(edu.uiuc.ncsa.security.core.configuration.ConfigTest) Test(org.junit.Test)

Aggregations

DSFSClientStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider)2 ClientStore (edu.uiuc.ncsa.security.delegation.server.storage.ClientStore)2 AdminClientStore (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClientStore)1 OA4MPIdentifierProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider)1 MultiDSClientStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientStoreProvider)1 DSClientSQLStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.sql.provider.DSClientSQLStoreProvider)1 ConfigTest (edu.uiuc.ncsa.security.core.configuration.ConfigTest)1 CfgEvent (edu.uiuc.ncsa.security.core.configuration.provider.CfgEvent)1 MyLoggingFacade (edu.uiuc.ncsa.security.core.util.MyLoggingFacade)1 Client (edu.uiuc.ncsa.security.delegation.storage.Client)1 ClientProvider (edu.uiuc.ncsa.security.delegation.storage.ClientProvider)1 ClientConverter (edu.uiuc.ncsa.security.delegation.storage.impl.ClientConverter)1 MySQLConnectionPoolProvider (edu.uiuc.ncsa.security.storage.sql.mysql.MySQLConnectionPoolProvider)1 PGConnectionPoolProvider (edu.uiuc.ncsa.security.storage.sql.postgres.PGConnectionPoolProvider)1 ConfigurationNode (org.apache.commons.configuration.tree.ConfigurationNode)1 Test (org.junit.Test)1