use of java.lang.Boolean.parseBoolean in project hazelcast by hazelcast.
the class MemberDomConfigProcessor method handleNearCacheConfig.
private NearCacheConfig handleNearCacheConfig(Node node, NearCacheConfig existingNearCacheConfig) {
String name = getAttribute(node, "name");
name = name == null ? NearCacheConfig.DEFAULT_NAME : name;
NearCacheConfig nearCacheConfig = existingNearCacheConfig != null ? existingNearCacheConfig : new NearCacheConfig(name);
Boolean serializeKeys = null;
for (Node child : childElements(node)) {
String nodeName = cleanNodeName(child);
if (matches("time-to-live-seconds", nodeName)) {
nearCacheConfig.setTimeToLiveSeconds(Integer.parseInt(getTextContent(child)));
} else if (matches("max-idle-seconds", nodeName)) {
nearCacheConfig.setMaxIdleSeconds(Integer.parseInt(getTextContent(child)));
} else if (matches("in-memory-format", nodeName)) {
nearCacheConfig.setInMemoryFormat(InMemoryFormat.valueOf(upperCaseInternal(getTextContent(child))));
} else if (matches("serialize-keys", nodeName)) {
serializeKeys = Boolean.parseBoolean(getTextContent(child));
nearCacheConfig.setSerializeKeys(serializeKeys);
} else if (matches("invalidate-on-change", nodeName)) {
nearCacheConfig.setInvalidateOnChange(Boolean.parseBoolean(getTextContent(child)));
} else if (matches("cache-local-entries", nodeName)) {
nearCacheConfig.setCacheLocalEntries(Boolean.parseBoolean(getTextContent(child)));
} else if (matches("local-update-policy", nodeName)) {
NearCacheConfig.LocalUpdatePolicy policy = NearCacheConfig.LocalUpdatePolicy.valueOf(getTextContent(child));
nearCacheConfig.setLocalUpdatePolicy(policy);
} else if (matches("eviction", nodeName)) {
nearCacheConfig.setEvictionConfig(getEvictionConfig(child, true, false));
}
}
if (serializeKeys != null && !serializeKeys && nearCacheConfig.getInMemoryFormat() == InMemoryFormat.NATIVE) {
LOGGER.warning("The Near Cache doesn't support keys by-reference with NATIVE in-memory-format." + " This setting will have no effect!");
}
return nearCacheConfig;
}
use of java.lang.Boolean.parseBoolean in project coprhd-controller by CoprHD.
the class BlockService method pauseMirrors.
/**
* Pause the specified mirror(s) for the source volume
*
* @param id
* the URN of a ViPR Source volume
* @param sync
* flag for pause operation; true=split, false=fracture
* @param copyID
* copyID Copy volume ID, none specified pauses all copies
*
* @return TaskList
*/
private TaskList pauseMirrors(URI id, String sync, URI copyID) {
Volume sourceVolume = queryVolumeResource(id);
ArgValidator.checkEntity(sourceVolume, id, true);
StringSet mirrors = sourceVolume.getMirrors();
if (mirrors == null || mirrors.isEmpty()) {
throw APIException.badRequests.invalidParameterVolumeHasNoContinuousCopies(sourceVolume.getId());
}
ArrayList<BlockMirror> mirrorList = null;
if (copyID != null) {
BlockMirror mirror = queryMirror(copyID);
ArgValidator.checkEntity(mirror, copyID, true);
if (!mirror.getSource().getURI().equals(id)) {
throw APIException.badRequests.invalidParameterBlockCopyDoesNotBelongToVolume(copyID, id);
} else {
mirrorList = new ArrayList();
mirrorList.add(mirror);
}
}
if (sync != null) {
ArgValidator.checkFieldValueFromArrayIgnoreCase(sync, ProtectionOp.SYNC.getRestOp(), TRUE_STR, FALSE_STR);
}
Boolean syncParam = Boolean.parseBoolean(sync);
String task = UUID.randomUUID().toString();
StorageSystem device = _dbClient.queryObject(StorageSystem.class, sourceVolume.getStorageController());
BlockServiceApi blockServiceApi = getBlockServiceImpl("mirror");
auditOp(OperationTypeEnum.FRACTURE_VOLUME_MIRROR, true, AuditLogManager.AUDITOP_BEGIN, mirrorList == null ? mirrors : mirrorList, sync);
return blockServiceApi.pauseNativeContinuousCopies(device, sourceVolume, mirrorList, syncParam, task);
}
Aggregations