use of com.hazelcast.internal.management.operation.UpdateMapConfigOperation in project hazelcast by hazelcast.
the class MapConfigRequest method writeResponse.
@Override
public void writeResponse(ManagementCenterService mcs, JsonObject root) {
final JsonObject result = new JsonObject();
result.add("update", update);
if (update) {
final Set<Member> members = mcs.getHazelcastInstance().getCluster().getMembers();
for (Member member : members) {
mcs.callOnMember(member, new UpdateMapConfigOperation(mapName, config.getMapConfig()));
}
result.add("updateResult", "success");
} else {
MapConfig cfg = (MapConfig) mcs.callOnThis(new GetMapConfigOperation(mapName));
if (cfg != null) {
result.add("hasMapConfig", true);
result.add("mapConfig", new MapConfigDTO(cfg).toJson());
} else {
result.add("hasMapConfig", false);
}
}
root.add("result", result);
}
use of com.hazelcast.internal.management.operation.UpdateMapConfigOperation in project hazelcast by hazelcast.
the class DynamicMapConfigTest method updateMapConfig.
private void updateMapConfig(String mapName, HazelcastInstance node) throws InterruptedException, ExecutionException {
MapConfig mapConfig = createMapConfig();
Operation updateMapConfigOperation = new UpdateMapConfigOperation(mapName, mapConfig);
executeOperation(node, updateMapConfigOperation);
}
use of com.hazelcast.internal.management.operation.UpdateMapConfigOperation in project hazelcast by hazelcast.
the class ManagementDataSerializerHook method createFactory.
@Override
@SuppressWarnings("unchecked")
public DataSerializableFactory createFactory() {
ConstructorFunction<Integer, IdentifiedDataSerializable>[] constructors = new ConstructorFunction[LEN];
constructors[SCRIPT_EXECUTOR] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return new ScriptExecutorOperation();
}
};
constructors[UPDATE_MANAGEMENT_CENTER_URL] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return new UpdateManagementCenterUrlOperation();
}
};
constructors[UPDATE_MAP_CONFIG] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return new UpdateMapConfigOperation();
}
};
constructors[MAP_CONFIG_DTO] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
public IdentifiedDataSerializable createNew(Integer arg) {
return new MapConfigDTO();
}
};
constructors[ADD_WAN_CONFIG] = new ConstructorFunction<Integer, IdentifiedDataSerializable>() {
@Override
public IdentifiedDataSerializable createNew(Integer arg) {
return new AddWanConfigOperation();
}
};
return new ArrayDataSerializableFactory(constructors);
}
Aggregations