use of org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config in project jdk8u_jdk by JetBrains.
the class Semicolon method main.
public static void main(String[] args) throws Throwable {
System.setProperty("java.security.krb5.conf", System.getProperty("test.src", ".") + "/comments.conf");
Config config = Config.getInstance();
config.get("section", "value");
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config in project jdk8u_jdk by JetBrains.
the class ConfigWithQuotations method main.
public static void main(String[] args) throws Exception {
// This config file is generated using Kerberos.app on a Mac
System.setProperty("java.security.krb5.conf", System.getProperty("test.src", ".") + "/edu.mit.Kerberos");
Config config = Config.getInstance();
System.out.println(config);
if (!config.getDefaultRealm().equals("MAC.LOCAL")) {
throw new Exception("Realm error");
}
if (!config.getKDCList("MAC.LOCAL").equals("kdc.mac.local:88")) {
throw new Exception("KDC error");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config in project jdk8u_jdk by JetBrains.
the class KDCOptions method setDefault.
private void setDefault() {
try {
Config config = Config.getInstance();
// If key not present, returns Integer.MIN_VALUE, which is
// almost all zero.
int options = config.getIntValue("libdefaults", "kdc_default_options");
if ((options & KDC_OPT_RENEWABLE_OK) == KDC_OPT_RENEWABLE_OK) {
set(RENEWABLE_OK, true);
} else {
if (config.getBooleanValue("libdefaults", "renewable")) {
set(RENEWABLE_OK, true);
}
}
if ((options & KDC_OPT_PROXIABLE) == KDC_OPT_PROXIABLE) {
set(PROXIABLE, true);
} else {
if (config.getBooleanValue("libdefaults", "proxiable")) {
set(PROXIABLE, true);
}
}
if ((options & KDC_OPT_FORWARDABLE) == KDC_OPT_FORWARDABLE) {
set(FORWARDABLE, true);
} else {
if (config.getBooleanValue("libdefaults", "forwardable")) {
set(FORWARDABLE, true);
}
}
} catch (KrbException e) {
if (DEBUG) {
System.out.println("Exception in getting default values for " + "KDC Options from the configuration ");
e.printStackTrace();
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config in project netvirt by opendaylight.
the class L2GwValidateCli method compareNodes.
private boolean compareNodes(Node node1, Node node2, boolean parentChildComparison, LogicalDatastoreType datastoreType) {
if (node1 == null || node2 == null) {
return false;
}
InstanceIdentifier<Node> nodeIid1 = HwvtepSouthboundUtils.createInstanceIdentifier(node1.getNodeId());
InstanceIdentifier<Node> nodeIid2 = HwvtepSouthboundUtils.createInstanceIdentifier(node2.getNodeId());
NodeId nodeId1 = nodeIid1.firstKeyOf(Node.class).getNodeId();
NodeId nodeId2 = nodeIid2.firstKeyOf(Node.class).getNodeId();
PhysicalSwitchAugmentation psAug1 = node1.getAugmentation(PhysicalSwitchAugmentation.class);
PhysicalSwitchAugmentation psAug2 = node2.getAugmentation(PhysicalSwitchAugmentation.class);
HwvtepGlobalAugmentation aug1 = node1.getAugmentation(HwvtepGlobalAugmentation.class);
HwvtepGlobalAugmentation aug2 = node2.getAugmentation(HwvtepGlobalAugmentation.class);
boolean globalNodes = psAug1 == null && psAug2 == null ? true : false;
MergeCommand[] commands = globalNodes ? globalCommands : physicalSwitchCommands;
for (MergeCommand cmd : commands) {
List<DataObject> data1 = null;
List<DataObject> data2 = null;
if (globalNodes) {
data1 = cmd.getData(aug1);
data2 = cmd.getData(aug2);
} else {
data1 = cmd.getData(node1);
data2 = cmd.getData(node2);
}
data1 = data1 == null ? Collections.EMPTY_LIST : data1;
data2 = data2 == null ? Collections.EMPTY_LIST : data2;
if (parentChildComparison) {
data2 = cmd.transform(nodeIid1, data2);
}
Function<DataObject, DataObject> withoutUuidTransformer = cmd::withoutUuid;
data1 = Lists.transform(data1, withoutUuidTransformer);
data2 = Lists.transform(data2, withoutUuidTransformer);
Map<Identifier<?>, DataObject> map1 = new HashMap<>();
Map<Identifier<?>, DataObject> map2 = new HashMap<>();
for (DataObject dataObject : data1) {
map1.put(cmd.getKey(dataObject), dataObject);
}
for (DataObject dataObject : data2) {
map2.put(cmd.getKey(dataObject), dataObject);
}
Set<DataObject> diff = Sets.newHashSet();
for (Entry<Identifier<?>, DataObject> entry : map1.entrySet()) {
DataObject obj1 = entry.getValue();
DataObject obj2 = map2.get(entry.getKey());
if (obj2 == null || !cmd.areEqual(obj1, obj2)) {
diff.add(obj1);
}
}
if (!diff.isEmpty()) {
if (parentChildComparison) {
pw.println("Missing " + cmd.getDescription() + " child entries in " + datastoreType + " parent node " + nodeId1 + " contain " + " more entries than child " + nodeId2 + " " + diff.size());
} else {
pw.println("Missing " + cmd.getDescription() + " op entries config " + nodeId1 + " contain " + " more entries than operational node " + diff.size());
}
if (diff.size() < 10) {
for (Object obj : diff) {
pw.println(cmd.getKey((DataObject) obj));
}
}
}
diff = Sets.newHashSet();
for (Entry<Identifier<?>, DataObject> entry : map2.entrySet()) {
DataObject obj1 = entry.getValue();
DataObject obj2 = map1.get(entry.getKey());
if (globalNodes || parentChildComparison) {
if (obj2 == null || !cmd.areEqual(obj1, obj2)) {
diff.add(obj1);
}
}
}
if (!diff.isEmpty()) {
if (parentChildComparison) {
pw.println("Extra " + cmd.getDescription() + " child entries in " + datastoreType + " node " + nodeId2 + " contain " + " more entries than parent node " + nodeId1 + " " + diff.size());
} else {
pw.println("Extra " + cmd.getDescription() + " operational node " + nodeId2 + " contain " + " more entries than config node " + diff.size());
}
if (diff.size() < 10) {
for (Object obj : diff) {
pw.println(cmd.getKey((DataObject) obj));
}
}
}
}
return true;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.topology.singleton.config.rev170419.Config in project netvirt by opendaylight.
the class L2GatewayConnectionListener method loadL2GwDeviceCache.
private void loadL2GwDeviceCache(List<Node> nodes) {
if (nodes == null) {
LOG.debug("No config topology nodes are present");
return;
}
Map<InstanceIdentifier<Node>, Node> allNodes = nodes.stream().collect(toMap(TO_NODE_PATH, Function.identity()));
LOG.trace("Loading all config nodes");
Set<InstanceIdentifier<Node>> allIids = allNodes.keySet();
Map<String, List<InstanceIdentifier<Node>>> psNodesByDeviceName = allIids.stream().filter(IS_PS_NODE).collect(groupingBy(GET_DEVICE_NAME, toList()));
// Process HA nodes
allNodes.values().stream().filter(IS_HA_PARENT_NODE).forEach(parentNode -> {
allIids.stream().filter(IS_PS_NODE).filter(psIid -> PS_NODE_OF_PARENT_NODE.test(psIid, parentNode)).forEach(psIid -> {
addL2DeviceToCache(psIid, parentNode, allNodes.get(psIid));
});
});
// Process non HA nodes there will be only one ps node iid for each device for non ha nodes
psNodesByDeviceName.values().stream().filter(psIids -> psIids.size() == 1).map(psIids -> psIids.get(0)).forEach(psIid -> {
Node psNode = allNodes.get(psIid);
Node globalNode = allNodes.get(TO_GLOBAL_PATH.apply(psNode));
if (globalNode != null) {
addL2DeviceToCache(psIid, globalNode, psNode);
}
});
}
Aggregations