s_logger.debug("Creating a guest VLAN with tag " + vlanTag);
_vlanApi.create(vlanNames, vlanTags, vlanMemberEntries, commonEnabledState, new long[]{10L}, new String[]{"00:00:00:00:00:00"});
if (!getVlans().contains(vlanName)) {
throw new ExecutionException("Failed to create vlan with tag " + vlanTag);
}
}
if (inline) {
List<Long> allRouteDomains = getRouteDomains();
if (!allRouteDomains.contains(vlanTag)) {
long[] routeDomainIds = genLongArray(vlanTag);
String[][] vlanNames = new String[][]{genStringArray(genVlanName(vlanTag))};
s_logger.debug("Creating route domain " + vlanTag);
_routeDomainApi.create(routeDomainIds, vlanNames);
if (!getRouteDomains().contains(vlanTag)) {
throw new ExecutionException("Failed to create route domain " + vlanTag);
}
}
}
List<String> allSelfIps = getSelfIps();
if (!allSelfIps.contains(vlanSelfIp)) {
String[] selfIpsToCreate = genStringArray(vlanSelfIp);
String[] vlans = genStringArray(vlanName);
String[] netmasks = genStringArray(vlanNetmask);
long[] unitIds = genLongArray(0L);
CommonEnabledState[] enabledStates = new CommonEnabledState[]{CommonEnabledState.STATE_DISABLED};
s_logger.debug("Creating self IP " + vlanSelfIp);
_selfIpApi.create(selfIpsToCreate, vlans, netmasks, unitIds, enabledStates);
if (!getSelfIps().contains(vlanSelfIp)) {
throw new ExecutionException("Failed to create self IP " + vlanSelfIp);
}
}
} catch (RemoteException e) {
s_logger.error(e);
throw new ExecutionException(e.getMessage());
}
}