Search in sources :

Example 16 with RestApiConfig

use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.

the class RESTClientPhoneHomeTest method createConfigWithRestEnabled.

protected Config createConfigWithRestEnabled() {
    Config config = createConfig();
    RestApiConfig restApiConfig = new RestApiConfig().setEnabled(true).enableAllGroups();
    config.getNetworkConfig().setRestApiConfig(restApiConfig);
    return config;
}
Also used : RestApiConfig(com.hazelcast.config.RestApiConfig) RestApiConfig(com.hazelcast.config.RestApiConfig) HazelcastTestSupport.smallInstanceConfig(com.hazelcast.test.HazelcastTestSupport.smallInstanceConfig) Config(com.hazelcast.config.Config)

Example 17 with RestApiConfig

use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.

the class MemberDomConfigProcessor method handleEndpointGroup.

void handleEndpointGroup(Node node, String name) {
    boolean enabled = getBooleanValue(getAttribute(node, "enabled"));
    RestEndpointGroup endpointGroup = lookupEndpointGroup(name);
    RestApiConfig restApiConfig = config.getNetworkConfig().getRestApiConfig();
    if (enabled) {
        restApiConfig.enableGroups(endpointGroup);
    } else {
        restApiConfig.disableGroups(endpointGroup);
    }
}
Also used : RestApiConfig(com.hazelcast.config.RestApiConfig) RestEndpointGroup(com.hazelcast.config.RestEndpointGroup)

Example 18 with RestApiConfig

use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.

the class RestClusterBadRequestTest method getConfig.

@Override
protected Config getConfig() {
    Config config = smallInstanceConfig();
    RestApiConfig restApiConfig = config.getNetworkConfig().getRestApiConfig();
    restApiConfig.setEnabled(true);
    restApiConfig.enableAllGroups();
    JoinConfig joinConfig = config.getNetworkConfig().getJoin();
    joinConfig.getMulticastConfig().setEnabled(false);
    joinConfig.getTcpIpConfig().setEnabled(true).addMember("127.0.0.1");
    return config;
}
Also used : RestApiConfig(com.hazelcast.config.RestApiConfig) RestApiConfig(com.hazelcast.config.RestApiConfig) JoinConfig(com.hazelcast.config.JoinConfig) Config(com.hazelcast.config.Config) JoinConfig(com.hazelcast.config.JoinConfig)

Example 19 with RestApiConfig

use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.

the class RestInstanceTest method createConfigWithRestEnabledAndClusterReadDisabled.

protected Config createConfigWithRestEnabledAndClusterReadDisabled() {
    Config config = createConfig();
    RestApiConfig restApiConfig = new RestApiConfig().setEnabled(true).disableGroups(RestEndpointGroup.CLUSTER_READ).enableGroups(RestEndpointGroup.CLUSTER_WRITE);
    config.getNetworkConfig().setRestApiConfig(restApiConfig);
    return config;
}
Also used : RestApiConfig(com.hazelcast.config.RestApiConfig) Config(com.hazelcast.config.Config) RestApiConfig(com.hazelcast.config.RestApiConfig)

Example 20 with RestApiConfig

use of com.hazelcast.config.RestApiConfig in project hazelcast by hazelcast.

the class RestInstanceTest method createConfigWithRestEnabled.

protected Config createConfigWithRestEnabled() {
    Config config = createConfig();
    RestApiConfig restApiConfig = new RestApiConfig().setEnabled(true).enableGroups(RestEndpointGroup.CLUSTER_READ);
    config.getNetworkConfig().setRestApiConfig(restApiConfig);
    return config;
}
Also used : RestApiConfig(com.hazelcast.config.RestApiConfig) Config(com.hazelcast.config.Config) RestApiConfig(com.hazelcast.config.RestApiConfig)

Aggregations

RestApiConfig (com.hazelcast.config.RestApiConfig)29 Config (com.hazelcast.config.Config)22 QuickTest (com.hazelcast.test.annotation.QuickTest)11 Test (org.junit.Test)11 HazelcastInstance (com.hazelcast.core.HazelcastInstance)8 MemcacheProtocolConfig (com.hazelcast.config.MemcacheProtocolConfig)6 JoinConfig (com.hazelcast.config.JoinConfig)4 RestEndpointGroup (com.hazelcast.config.RestEndpointGroup)3 HazelcastTestSupport.smallInstanceConfig (com.hazelcast.test.HazelcastTestSupport.smallInstanceConfig)3 RestServerEndpointConfig (com.hazelcast.config.RestServerEndpointConfig)2 AdvancedNetworkConfig (com.hazelcast.config.AdvancedNetworkConfig)1 DiscoveryStrategyConfig (com.hazelcast.config.DiscoveryStrategyConfig)1 NetworkConfig (com.hazelcast.config.NetworkConfig)1 WanReplicationConfig (com.hazelcast.config.WanReplicationConfig)1 StringUtil.bytesToString (com.hazelcast.internal.util.StringUtil.bytesToString)1 DiscoveryStrategyFactory (com.hazelcast.spi.discovery.DiscoveryStrategyFactory)1 Before (org.junit.Before)1