import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.*;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode;
-import org.opendaylight.yangtools.yang.binding.DataContainer;
import org.osgi.framework.BundleContext;
import org.osgi.framework.ServiceReference;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SecurityServicesImpl implements ConfigInterface, SecurityServicesManager {
- static final Logger logger = LoggerFactory.getLogger(TenantNetworkManagerImpl.class);
+ private static final Logger LOG = LoggerFactory.getLogger(TenantNetworkManagerImpl.class);
private volatile INeutronPortCRUD neutronPortCache;
private volatile INeutronSubnetCRUD neutronSubnetCache;
private volatile Southbound southbound;
*/
public boolean isPortSecurityReady(OvsdbTerminationPointAugmentation terminationPointAugmentation) {
if (neutronPortCache == null) {
- logger.error("neutron port is null");
+ LOG.error("neutron port is null");
return false;
}
- logger.trace("isPortSecurityReady for {}", terminationPointAugmentation.getName());
+ LOG.trace("isPortSecurityReady for {}", terminationPointAugmentation.getName());
String neutronPortId = southbound.getInterfaceExternalIdsValue(terminationPointAugmentation,
Constants.EXTERNAL_ID_INTERFACE_ID);
if (neutronPortId == null) {
}
String deviceOwner = neutronPort.getDeviceOwner();
if (!deviceOwner.contains("compute")) {
- logger.debug("Port {} is not a compute host, it is a: {}", neutronPortId, deviceOwner);
+ LOG.debug("Port {} is not a compute host, it is a: {}", neutronPortId, deviceOwner);
}
- logger.debug("isPortSecurityReady() is a {} ", deviceOwner);
+ LOG.debug("isPortSecurityReady() is a {} ", deviceOwner);
List<NeutronSecurityGroup> securityGroups = neutronPort.getSecurityGroups();
if (securityGroups.isEmpty()) {
- logger.debug("Check for device: {} does not contain a Security Group for port: {}", deviceOwner,
+ LOG.debug("Check for device: {} does not contain a Security Group for port: {}", deviceOwner,
neutronPortId);
return false;
}
- String vmPort = southbound.getInterfaceExternalIdsValue(terminationPointAugmentation,
- Constants.EXTERNAL_ID_VM_MAC);
- logger.debug("Security Group Check {} DOES contain a Neutron Security Group", neutronPortId);
+ LOG.debug("Security Group Check {} DOES contain a Neutron Security Group", neutronPortId);
return true;
}
*/
public NeutronSecurityGroup getSecurityGroupInPort(OvsdbTerminationPointAugmentation terminationPointAugmentation) {
if (neutronPortCache == null) {
- logger.error("neutron port is null");
+ LOG.error("neutron port is null");
return null;
}
- logger.trace("isPortSecurityReady for {}", terminationPointAugmentation.getName());
+ LOG.trace("isPortSecurityReady for {}", terminationPointAugmentation.getName());
String neutronPortId = southbound.getInterfaceExternalIdsValue(terminationPointAugmentation,
Constants.EXTERNAL_ID_INTERFACE_ID);
if (neutronPortId == null) {
List<NeutronSecurityGroup> neutronSecurityGroups = neutronPort.getSecurityGroups();
if (neutronSecurityGroups != null) {
- NeutronSecurityGroup neutronSecurityGroup = (NeutronSecurityGroup) neutronSecurityGroups.toArray()[0];
- return neutronSecurityGroup;
+ return (NeutronSecurityGroup) neutronSecurityGroups.toArray()[0];
} else {
return null;
}
public NeutronPort getDHCPServerPort(
OvsdbTerminationPointAugmentation terminationPointAugmentation) {
if (neutronPortCache == null) {
- logger.error("getDHCPServerPort: neutron port is null");
+ LOG.error("getDHCPServerPort: neutron port is null");
return null;
}
- logger.trace("getDHCPServerPort for {}",
+ LOG.trace("getDHCPServerPort for {}",
terminationPointAugmentation.getName());
String neutronPortId = southbound.getInterfaceExternalIdsValue(
terminationPointAugmentation,
List<Neutron_IPs> fixedIps = neutronPort.getFixedIPs();
if(null==fixedIps || 0 == fixedIps.size() )
{
- logger.error("getDHCPServerPort: No fixed ip is assigned");
+ LOG.error("getDHCPServerPort: No fixed ip is assigned");
return null;
}
String subnetUUID = fixedIps.iterator().next().getSubnetUUID();
@Override
public boolean isComputePort(OvsdbTerminationPointAugmentation terminationPointAugmentation) {
if (neutronPortCache == null) {
- logger.error("neutron port is null");
+ LOG.error("neutron port is null");
return false;
}
- logger.trace("isComputePort for {}", terminationPointAugmentation.getName());
+ LOG.trace("isComputePort for {}", terminationPointAugmentation.getName());
String neutronPortId = southbound.getInterfaceExternalIdsValue(terminationPointAugmentation,
Constants.EXTERNAL_ID_INTERFACE_ID);
if (neutronPortId == null) {
}
String deviceOwner = neutronPort.getDeviceOwner();
if (!deviceOwner.contains("compute")) {
- logger.debug("isComputePort : Port {} is not a DHCP server port", neutronPortId,deviceOwner);
+ LOG.debug("isComputePort : Port {} is not a DHCP server port", neutronPortId, deviceOwner);
return false;
}
return true;
@Override
public boolean isLastPortinSubnet(Node node, OvsdbTerminationPointAugmentation terminationPointAugmentation) {
if (neutronPortCache == null) {
- logger.error("isLastPortinSubnet: neutron port is null");
+ LOG.error("isLastPortinSubnet: neutron port is null");
return false;
}
- logger.trace("isLastPortinSubnet: for {}", terminationPointAugmentation.getName());
+ LOG.trace("isLastPortinSubnet: for {}", terminationPointAugmentation.getName());
String neutronPortId = southbound.getInterfaceExternalIdsValue(terminationPointAugmentation,
Constants.EXTERNAL_ID_INTERFACE_ID);
if (neutronPortId == null) {
@Override
public boolean isLastPortinBridge(Node node, OvsdbTerminationPointAugmentation terminationPointAugmentation) {
- logger.trace("isLastPortinBridge: for {}", terminationPointAugmentation.getName());
+ LOG.trace("isLastPortinBridge: for {}", terminationPointAugmentation.getName());
List<TerminationPoint> terminationPoints = node.getTerminationPoint();
if(terminationPoints != null && !terminationPoints.isEmpty()){
for(TerminationPoint tp : terminationPoints){
public List<Neutron_IPs> getIpAddress(Node node,
OvsdbTerminationPointAugmentation terminationPointAugmentation) {
if (neutronPortCache == null) {
- logger.error("getIpAddress: neutron port is null");
+ LOG.error("getIpAddress: neutron port is null");
return null;
}
- logger.trace("getIpAddress: for {}", terminationPointAugmentation.getName());
+ LOG.trace("getIpAddress: for {}", terminationPointAugmentation.getName());
String neutronPortId = southbound.getInterfaceExternalIdsValue(terminationPointAugmentation,
Constants.EXTERNAL_ID_INTERFACE_ID);
if (neutronPortId == null) {
return null;
}
NeutronPort neutronPort = neutronPortCache.getPort(neutronPortId);
- List<Neutron_IPs> fixedIps = neutronPort.getFixedIPs();
- return fixedIps;
+ return neutronPort.getFixedIPs();
}
@Override