Search in sources :

Example 1 with ConnectorConnectionPoolConfig

use of com.sun.appserv.management.config.ConnectorConnectionPoolConfig in project Payara by payara.

the class ConnectorConnectionPoolConfigTest method createProgeny.

protected final AMXConfig createProgeny(final String name, final Map<String, String> options) {
    final Map<String, String> allOptions = MapUtil.newMap(OPTIONS, options);
    final ConnectorConnectionPoolConfig config = getDomainConfig().getResourcesConfig().createConnectorConnectionPoolConfig(name, RESOURCE_ADAPTOR_NAME, CONNECTOR_DEF_NAME, allOptions);
    return (config);
}
Also used : ConnectorConnectionPoolConfig(com.sun.appserv.management.config.ConnectorConnectionPoolConfig)

Example 2 with ConnectorConnectionPoolConfig

use of com.sun.appserv.management.config.ConnectorConnectionPoolConfig in project Payara by payara.

the class SecurityMapConfigTest method ensureDefaultInstance.

public static SecurityMapConfig ensureDefaultInstance(final DomainConfig domainConfig) {
    final ConnectorConnectionPoolConfig ccpc = ConnectorConnectionPoolConfigTest.ensureDefaultInstance(domainConfig);
    SecurityMapConfig result = ccpc.getSecurityMapConfigMap().get(getDefaultInstanceName());
    if (result == null) {
        result = createInstance(ccpc, getDefaultInstanceName(), DEFAULT_BACKEND_PRINCIPAL, DEFAULT_BACKEND_PASSWORD, DEFAULT_PRINCIPALS, DEFAULT_USERGROUPS);
    }
    return result;
}
Also used : ConnectorConnectionPoolConfig(com.sun.appserv.management.config.ConnectorConnectionPoolConfig) SecurityMapConfig(com.sun.appserv.management.config.SecurityMapConfig)

Example 3 with ConnectorConnectionPoolConfig

use of com.sun.appserv.management.config.ConnectorConnectionPoolConfig in project Payara by payara.

the class SecurityMapConfigTest method testCreateRemove.

public void testCreateRemove() {
    if (!checkNotOffline("testDeleteLBConfig")) {
        return;
    }
    final String TEST_NAME = "SecurityMapConfigTest.testCreateRemove";
    final ResourceAdapterConfig rac = ResourceAdapterConfigTest.createInstance(getDomainConfig(), TEST_NAME);
    try {
        final ConnectorConnectionPoolConfig ccpc = ConnectorConnectionPoolConfigTest.createInstance(getDomainConfig(), TEST_NAME, CONNECTOR_DEF_NAME, rac.getName(), null);
        try {
            final String smcName = "SecurityMapConfigTest.testCreateRemove";
            final String[] principals = new String[] { "SecurityMapConfigTest.testCreateRemove" };
            final String[] userGroups = new String[0];
            final SecurityMapConfig smc = createInstance(ccpc, smcName, DEFAULT_BACKEND_PRINCIPAL, DEFAULT_BACKEND_PASSWORD, principals, null);
            try {
                assert (smcName.equals(smc.getName()));
                assert (smc == ccpc.getSecurityMapConfigMap().get(smc.getName()));
                testGetters(smc);
                final Set<String> principalsBefore = GSetUtil.newSet(smc.getPrincipalNames());
                final String PRINCIPAL1 = "testCreateRemove.test1";
                smc.createPrincipal(PRINCIPAL1);
                final Set<String> principalsAfter = GSetUtil.newSet(smc.getPrincipalNames());
                assert (principalsAfter.contains(PRINCIPAL1));
                smc.removePrincipal(PRINCIPAL1);
                assert (principalsBefore.equals(GSetUtil.newSet(smc.getPrincipalNames())));
            } finally {
                ccpc.removeSecurityMapConfig(smc.getName());
            }
        } finally {
            getDomainConfig().getResourcesConfig().removeConnectorConnectionPoolConfig(ccpc.getName());
        }
    } finally {
        getDomainConfig().getResourcesConfig().removeResourceAdapterConfig(rac.getName());
    }
}
Also used : ConnectorConnectionPoolConfig(com.sun.appserv.management.config.ConnectorConnectionPoolConfig) SecurityMapConfig(com.sun.appserv.management.config.SecurityMapConfig) ResourceAdapterConfig(com.sun.appserv.management.config.ResourceAdapterConfig)

Example 4 with ConnectorConnectionPoolConfig

use of com.sun.appserv.management.config.ConnectorConnectionPoolConfig in project Payara by payara.

the class SecurityServiceConfigTest method testCreateRemove.

public void testCreateRemove() {
    if (!checkNotOffline("testDeleteLBConfig")) {
        return;
    }
    final String TEST_NAME = "SecurityMapConfigTest.testCreateRemove";
    final ResourceAdapterConfig rac = ResourceAdapterConfigTest.createInstance(getDomainConfig(), TEST_NAME);
    try {
        final ConnectorConnectionPoolConfig ccpc = ConnectorConnectionPoolConfigTest.createInstance(getDomainConfig(), TEST_NAME, CONNECTOR_DEF_NAME, rac.getName(), null);
        try {
            final String smcName = TEST_NAME;
            final String[] principals = new String[] { TEST_NAME };
            final String[] userGroups = new String[0];
            final SecurityMapConfig smc = createInstance(ccpc, smcName, DEFAULT_BACKEND_PRINCIPAL, DEFAULT_BACKEND_PASSWORD, principals, null);
            try {
                assert (smcName.equals(smc.getName()));
                assert (smc == ccpc.getSecurityMapConfigMap().get(smc.getName()));
                testGetters(smc);
                final Set<String> principalsBefore = GSetUtil.newSet(smc.getPrincipalNames());
                final String PRINCIPAL1 = "testCreateRemove.test1";
                smc.createPrincipal(PRINCIPAL1);
                final Set<String> principalsAfter = GSetUtil.newSet(smc.getPrincipalNames());
                assert (principalsAfter.contains(PRINCIPAL1));
                smc.removePrincipal(PRINCIPAL1);
                assert (principalsBefore.equals(GSetUtil.newSet(smc.getPrincipalNames())));
            } finally {
                ccpc.removeSecurityMapConfig(smc.getName());
            }
        } finally {
            getDomainConfig().getResourcesConfig().removeConnectorConnectionPoolConfig(ccpc.getName());
        }
    } finally {
        getDomainConfig().getResourcesConfig().removeResourceAdapterConfig(rac.getName());
    }
}
Also used : ConnectorConnectionPoolConfig(com.sun.appserv.management.config.ConnectorConnectionPoolConfig) SecurityMapConfig(com.sun.appserv.management.config.SecurityMapConfig) ResourceAdapterConfig(com.sun.appserv.management.config.ResourceAdapterConfig)

Example 5 with ConnectorConnectionPoolConfig

use of com.sun.appserv.management.config.ConnectorConnectionPoolConfig in project Payara by payara.

the class SecurityServiceConfigTest method ensureDefaultInstance.

public static SecurityMapConfig ensureDefaultInstance(final DomainConfig domainConfig) {
    final ConnectorConnectionPoolConfig ccpc = ConnectorConnectionPoolConfigTest.ensureDefaultInstance(domainConfig);
    SecurityMapConfig result = ccpc.getSecurityMapConfigMap().get(getDefaultInstanceName());
    if (result == null) {
        result = createInstance(ccpc, getDefaultInstanceName(), DEFAULT_BACKEND_PRINCIPAL, DEFAULT_BACKEND_PASSWORD, DEFAULT_PRINCIPALS, DEFAULT_USERGROUPS);
    }
    return result;
}
Also used : ConnectorConnectionPoolConfig(com.sun.appserv.management.config.ConnectorConnectionPoolConfig) SecurityMapConfig(com.sun.appserv.management.config.SecurityMapConfig)

Aggregations

ConnectorConnectionPoolConfig (com.sun.appserv.management.config.ConnectorConnectionPoolConfig)6 SecurityMapConfig (com.sun.appserv.management.config.SecurityMapConfig)4 ResourceAdapterConfig (com.sun.appserv.management.config.ResourceAdapterConfig)2 ConnectorResourceConfig (com.sun.appserv.management.config.ConnectorResourceConfig)1