@Override public String getBroadcastUri() { return vpcGateway.getBroadcastUri(); }
@Override public String getGateway() { return vpcGateway.getGateway(); }
@Override public String getIp4Address() { return vpcGateway.getIp4Address(); }
public StaticRouteProfile(StaticRoute staticRoute, VpcGateway gateway) { id = staticRoute.getId(); uuid = staticRoute.getUuid(); targetCidr = staticRoute.getCidr(); accountId = staticRoute.getAccountId(); domainId = staticRoute.getDomainId(); gatewayId = staticRoute.getVpcGatewayId(); state = staticRoute.getState(); vpcId = staticRoute.getVpcId(); vlanTag = gateway.getBroadcastUri(); this.gateway = gateway.getGateway(); netmask = gateway.getNetmask(); ipAddress = gateway.getIp4Address(); }
@Override @DB public NicProfile createPrivateNicProfileForGateway(final VpcGateway privateGateway, final VirtualRouter router) { final Network privateNetwork = _networkModel.getNetwork(privateGateway.getNetworkId()); PrivateIpVO ipVO = _privateIpDao.allocateIpAddress(privateNetwork.getDataCenterId(), privateNetwork.getId(), privateGateway.getIp4Address()); final Long vpcId = privateGateway.getVpcId(); if (ipVO == null) { ipVO = _privateIpDao.findByIpAndVpcId(vpcId, privateGateway.getIp4Address()); if (ipVO == null) { throw new CloudRuntimeException("cannot find IP address " + privateGateway.getIp4Address() + " to reuse for private gateway on vpc (id==" + vpcId + ")");
@Override public Long getVpcId() { return vpcGateway.getVpcId(); }
if (gateway.getVpcId() == null) { throw new InvalidParameterValueException("Unable to find specified vpc id"); if (!gateway.getVpcId().equals(acl.getVpcId())) { throw new InvalidParameterValueException("private gateway: " + privateGatewayId + " and ACL: " + aclId + " do not belong to the same VPC"); final PrivateGateway privateGateway = _vpcSvc.getVpcPrivateGateway(gateway.getId()); _accountMgr.checkAccess(caller, null, true, privateGateway);
if (gateway.getState() != VpcGateway.State.Ready) { throw new InvalidParameterValueException("Gateway is not in the " + VpcGateway.State.Ready + " state: " + gateway.getState()); final Vpc vpc = getActiveVpc(gateway.getVpcId()); if (vpc == null) { throw new InvalidParameterValueException("Can't add static route to VPC that is being deleted");
@Override public long getNetworkACLId() { return vpcGateway.getNetworkACLId(); }
@Override public String getNetmask() { return vpcGateway.getNetmask(); }
@Override public long getId() { return vpcGateway.getId(); }
@Override public long getNetworkId() { return vpcGateway.getNetworkId(); }
@Override public long getAccountId() { return vpcGateway.getAccountId(); }
@Override public long getDomainId() { return vpcGateway.getDomainId(); }
@Override public Long getSyncObjId() { VpcGateway gateway = _entityMgr.findById(VpcGateway.class, gatewayId); if (gateway == null) { throw new InvalidParameterValueException("Invalid id is specified for the gateway"); } return gateway.getVpcId(); }
@Override public Long getNetworkAclIdForPrivateIp(long vpcId, long networkId, String ipaddr) { SearchCriteria<VpcGatewayVO> sc = AllFieldsSearch.create(); sc.setParameters("vpcId", vpcId); sc.setParameters("networkid", networkId); sc.setParameters("ipaddress", ipaddr); VpcGateway vpcGateway = findOneBy(sc); if (vpcGateway != null) { return vpcGateway.getNetworkACLId(); } else { return null; } }
if (gateway == null) { gateway = _vpcGatewayDao.findById(route.getVpcGatewayId()); gatewayMap.put(gateway.getId(), gateway);
protected PrivateGateway getPrivateGatewayProfile(final VpcGateway gateway) { final Network network = _ntwkModel.getNetwork(gateway.getNetworkId()); return new PrivateGatewayProfile(gateway, network.getPhysicalNetworkId()); }
@Override public Long getSyncObjId() { VpcGateway gateway = _vpcService.getVpcPrivateGateway(getId()); if (gateway == null) { throw new InvalidParameterValueException("Invalid private gateway id"); } return gateway.getVpcId(); }
@Override public StaticRouteVO doInTransaction(final TransactionStatus status) throws NetworkRuleConflictException { StaticRouteVO newRoute = new StaticRouteVO(gateway.getId(), cidr, vpc.getId(), vpc.getAccountId(), vpc.getDomainId()); s_logger.debug("Adding static route " + newRoute); newRoute = _staticRouteDao.persist(newRoute); detectRoutesConflict(newRoute); if (!_staticRouteDao.setStateToAdd(newRoute)) { throw new CloudRuntimeException("Unable to update the state to add for " + newRoute); } CallContext.current().setEventDetails("Static route Id: " + newRoute.getId()); return newRoute; } });