Search in sources :

Example 1 with MySQLConnectionPoolProvider

use of edu.uiuc.ncsa.security.storage.sql.mysql.MySQLConnectionPoolProvider in project OA4MP by ncsa.

the class ServiceConfigTest method testClientApprovalStoreProvider.

public void testClientApprovalStoreProvider() throws Exception {
    ConfigurationNode cn = getConfig("postgresql config");
    MultiDSClientApprovalStoreProvider dap = new MultiDSClientApprovalStoreProvider(cn, true, new MyLoggingFacade("test"), null, null);
    ClientApproverConverter cp = new ClientApproverConverter(new ClientApprovalProvider());
    dap.addListener(new DSFSClientApprovalStoreProvider(cn, cp));
    dap.addListener(new DSSQLClientApprovalStoreProvider(cn, new MySQLConnectionPoolProvider("oauth", "oauth"), MYSQL_STORE, cp));
    dap.addListener(new DSSQLClientApprovalStoreProvider(cn, new PGConnectionPoolProvider("oauth", "oauth"), POSTGRESQL_STORE, cp));
    ClientApprovalStore<ClientApproval> as = (ClientApprovalStore<ClientApproval>) dap.get();
}
Also used : MultiDSClientApprovalStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientApprovalStoreProvider) MyLoggingFacade(edu.uiuc.ncsa.security.core.util.MyLoggingFacade) MySQLConnectionPoolProvider(edu.uiuc.ncsa.security.storage.sql.mysql.MySQLConnectionPoolProvider) PGConnectionPoolProvider(edu.uiuc.ncsa.security.storage.sql.postgres.PGConnectionPoolProvider) ClientApproval(edu.uiuc.ncsa.security.delegation.server.storage.ClientApproval) ConfigurationNode(org.apache.commons.configuration.tree.ConfigurationNode) DSFSClientApprovalStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientApprovalStoreProvider) ClientApproverConverter(edu.uiuc.ncsa.myproxy.oa4mp.server.util.ClientApproverConverter) ClientApprovalStore(edu.uiuc.ncsa.security.delegation.server.storage.ClientApprovalStore) ClientApprovalProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.ClientApprovalProvider) DSSQLClientApprovalStoreProvider(edu.uiuc.ncsa.myproxy.oa4mp.server.storage.sql.provider.DSSQLClientApprovalStoreProvider)

Example 2 with MySQLConnectionPoolProvider

use of edu.uiuc.ncsa.security.storage.sql.mysql.MySQLConnectionPoolProvider 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

MyLoggingFacade (edu.uiuc.ncsa.security.core.util.MyLoggingFacade)2 MySQLConnectionPoolProvider (edu.uiuc.ncsa.security.storage.sql.mysql.MySQLConnectionPoolProvider)2 PGConnectionPoolProvider (edu.uiuc.ncsa.security.storage.sql.postgres.PGConnectionPoolProvider)2 ConfigurationNode (org.apache.commons.configuration.tree.ConfigurationNode)2 ClientApprovalProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.ClientApprovalProvider)1 OA4MPIdentifierProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.transactions.OA4MPIdentifierProvider)1 MultiDSClientApprovalStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientApprovalStoreProvider)1 MultiDSClientStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.MultiDSClientStoreProvider)1 DSFSClientApprovalStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientApprovalStoreProvider)1 DSFSClientStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.filestore.DSFSClientStoreProvider)1 DSClientSQLStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.sql.provider.DSClientSQLStoreProvider)1 DSSQLClientApprovalStoreProvider (edu.uiuc.ncsa.myproxy.oa4mp.server.storage.sql.provider.DSSQLClientApprovalStoreProvider)1 ClientApproverConverter (edu.uiuc.ncsa.myproxy.oa4mp.server.util.ClientApproverConverter)1 ConfigTest (edu.uiuc.ncsa.security.core.configuration.ConfigTest)1 ClientApproval (edu.uiuc.ncsa.security.delegation.server.storage.ClientApproval)1 ClientApprovalStore (edu.uiuc.ncsa.security.delegation.server.storage.ClientApprovalStore)1 ClientStore (edu.uiuc.ncsa.security.delegation.server.storage.ClientStore)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