use of com.hazelcast.internal.management.operation.UpdatePermissionConfigOperation in project hazelcast by hazelcast.
the class OnJoinOp method run.
@Override
public void run() throws Exception {
if (!operations.isEmpty()) {
SecurityConfig securityConfig = getNodeEngine().getConfig().getSecurityConfig();
boolean runPermissionUpdates = securityConfig.getOnJoinPermissionOperation() == OnJoinPermissionOperationName.RECEIVE;
for (Operation op : operations) {
if ((op instanceof UpdatePermissionConfigOperation) && !runPermissionUpdates) {
continue;
}
try {
// not running via OperationService since we don't want any restrictions like cluster state check etc.
runDirect(op);
} catch (Exception e) {
getLogger().warning("Error while running post-join operation: " + op, e);
}
}
final ClusterService clusterService = getService();
// if executed on master, broadcast to all other members except sender (joining member)
if (clusterService.isMaster()) {
final OperationService operationService = getNodeEngine().getOperationService();
for (Member member : clusterService.getMembers()) {
if (!member.localMember() && !member.getUuid().equals(getCallerUuid())) {
OnJoinOp operation = new OnJoinOp(operations);
operationService.invokeOnTarget(getServiceName(), operation, member.getAddress());
}
}
}
}
}
use of com.hazelcast.internal.management.operation.UpdatePermissionConfigOperation in project hazelcast by hazelcast.
the class ManagementDataSerializerHook method createFactory.
@Override
@SuppressWarnings("unchecked")
public DataSerializableFactory createFactory() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[UPDATE_MAP_CONFIG] = arg -> new UpdateMapConfigOperation();
constructors[SET_LICENSE] = arg -> new SetLicenseOperation();
constructors[CHANGE_CLUSTER_STATE] = arg -> new ChangeClusterStateOperation();
constructors[UPDATE_PERMISSION_CONFIG_OPERATION] = arg -> new UpdatePermissionConfigOperation();
constructors[RELOAD_CONFIG_OPERATION] = arg -> new ReloadConfigOperation();
constructors[UPDATE_CONFIG_OPERATION] = arg -> new UpdateConfigOperation();
return new ArrayDataSerializableFactory(constructors);
}
Aggregations