com.hazelcast.config.SecurityConfig Maven / Gradle / Ivy
/*
* Copyright (c) 2008-2013, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.hazelcast.config;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* Contains configuration for Security
*/
public class SecurityConfig {
private boolean enabled;
private CredentialsFactoryConfig memberCredentialsConfig = new CredentialsFactoryConfig();
private List memberLoginModuleConfigs = new ArrayList();
private List securityInterceptorConfigs = new ArrayList();
private List clientLoginModuleConfigs = new ArrayList();
private PermissionPolicyConfig clientPolicyConfig = new PermissionPolicyConfig();
private Set clientPermissionConfigs = new HashSet();
public SecurityConfig addSecurityInterceptorConfig(SecurityInterceptorConfig interceptorConfig) {
securityInterceptorConfigs.add(interceptorConfig);
return this;
}
public List getSecurityInterceptorConfigs() {
return securityInterceptorConfigs;
}
public void setSecurityInterceptorConfigs(final List securityInterceptorConfigs) {
this.securityInterceptorConfigs = securityInterceptorConfigs;
}
public boolean isEnabled() {
return enabled;
}
public SecurityConfig setEnabled(boolean enabled) {
this.enabled = enabled;
return this;
}
public SecurityConfig addMemberLoginModuleConfig(LoginModuleConfig loginModuleConfig) {
memberLoginModuleConfigs.add(loginModuleConfig);
return this;
}
public SecurityConfig addClientLoginModuleConfig(LoginModuleConfig loginModuleConfig) {
clientLoginModuleConfigs.add(loginModuleConfig);
return this;
}
public SecurityConfig addClientPermissionConfig(PermissionConfig permissionConfig) {
clientPermissionConfigs.add(permissionConfig);
return this;
}
public List getClientLoginModuleConfigs() {
return clientLoginModuleConfigs;
}
public SecurityConfig setClientLoginModuleConfigs(List loginModuleConfigs) {
this.clientLoginModuleConfigs = loginModuleConfigs;
return this;
}
public List getMemberLoginModuleConfigs() {
return memberLoginModuleConfigs;
}
public SecurityConfig setMemberLoginModuleConfigs(List memberLoginModuleConfigs) {
this.memberLoginModuleConfigs = memberLoginModuleConfigs;
return this;
}
public PermissionPolicyConfig getClientPolicyConfig() {
return clientPolicyConfig;
}
public SecurityConfig setClientPolicyConfig(PermissionPolicyConfig policyConfig) {
this.clientPolicyConfig = policyConfig;
return this;
}
public Set getClientPermissionConfigs() {
return clientPermissionConfigs;
}
public SecurityConfig setClientPermissionConfigs(Set permissions) {
this.clientPermissionConfigs = permissions;
return this;
}
public CredentialsFactoryConfig getMemberCredentialsConfig() {
return memberCredentialsConfig;
}
public SecurityConfig setMemberCredentialsConfig(CredentialsFactoryConfig credentialsFactoryConfig) {
this.memberCredentialsConfig = credentialsFactoryConfig;
return this;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("SecurityConfig");
sb.append("{enabled=").append(enabled);
sb.append(", memberCredentialsConfig=").append(memberCredentialsConfig);
sb.append(", memberLoginModuleConfigs=").append(memberLoginModuleConfigs);
sb.append(", clientLoginModuleConfigs=").append(clientLoginModuleConfigs);
sb.append(", clientPolicyConfig=").append(clientPolicyConfig);
sb.append(", clientPermissionConfigs=").append(clientPermissionConfigs);
sb.append('}');
return sb.toString();
}
}