Replace LOGGER by LOG to follow the OpenDaylight recommendations.
https://wiki.opendaylight.org/view/BestPractices/Logging_Best_Practices
Change-Id: Idad0d8a3d38e51dc5e0fd3d3e7d41a4b6c129eb1
Signed-off-by: David Suarez <david.suarez.fuentes@ericsson.com>
String base;
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronNetworkTests.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronNetworkTests.class);
public NeutronNetworkTests(String base) {
this.base = base;
URL url = new URL(urlS);
HttpURLConnection httpConn = ITNeutronE2E.httpURLConnectionFactoryGet(url);
if (httpConn.getResponseCode() != 200) {
- LOGGER.info("trial " + Integer.toString(retry) + ": failed with: "
+ LOG.info("trial " + Integer.toString(retry) + ": failed with: "
+ Integer.toString(httpConn.getResponseCode()));
Thread.sleep(1000);
} else {
import org.slf4j.LoggerFactory;
public final class NeutronCRUDInterfaces {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronCRUDInterfaces.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronCRUDInterfaces.class);
private NeutronCRUDInterfaces() {
throw new UnsupportedOperationException("NeutronCRUDInterfaces class shouldn't be instantiated");
return bundleCtx.getService(service);
}
} catch (InvalidSyntaxException e) {
- LOGGER.error("Error in getInstances", e);
+ LOG.error("Error in getInstances", e);
}
return null;
}
// T extends NeutronObject as 0th type argument. Used by extractFields()
private static final int NEUTRON_OBJECT_CLASS_TYPE_INDEX = 0;
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronFirewallRule.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronFirewallRule.class);
private static final long serialVersionUID = 1L;
}
for (String s : fields) {
if (!extractField(s, ans)) {
- LOGGER.warn("Unknown {} {}.", cls.getSimpleName(), s);
+ LOG.warn("Unknown {} {}.", cls.getSimpleName(), s);
}
}
return ans;
import org.w3c.dom.Text;
public final class NeutronResourceMapPropertyAdapter extends XmlAdapter<Object, Map<String, String>> {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronResourceMapPropertyAdapter.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronResourceMapPropertyAdapter.class);
@Override
public Map<String, String> unmarshal(Object domTree) {
}
return customXml;
} catch (javax.xml.parsers.ParserConfigurationException e) {
- LOGGER.error("ParserConfigurationException", e);
+ LOG.error("ParserConfigurationException", e);
}
return null;
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public final class NeutronSubnet extends NeutronBaseAttributes<NeutronSubnet> implements Serializable {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronCRUDInterfaces.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronCRUDInterfaces.class);
private static final long serialVersionUID = 1L;
private static final int IPV4_VERSION = 4;
return false;
}
} catch (IllegalArgumentException e) {
- LOGGER.warn("Failure in isValidCIDR()", e);
+ LOG.warn("Failure in isValidCIDR()", e);
return false;
}
return true;
allocationPools = source.splitPool(gatewayIp);
}
} catch (IllegalArgumentException e) {
- LOGGER.warn("Failure in initDefault()", e);
+ LOG.warn("Failure in initDefault()", e);
return;
}
}
SubnetInfo info = util.getInfo();
return info.isInRange(ipAddress);
} catch (IllegalArgumentException e) {
- LOGGER.warn("Failure in isValidIp()", e);
+ LOG.warn("Failure in isValidIp()", e);
return false;
}
}
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public final class NeutronSubnetIpAllocationPool implements Serializable {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronSubnetIpAllocationPool.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronSubnetIpAllocationPool.class);
private static final long serialVersionUID = 1L;
try {
return Inet6Address.getByAddress(ipv4BigInteger.toByteArray()).getHostAddress();
} catch (UnknownHostException e) {
- LOGGER.error("bigIntegerToIp", e);
+ LOG.error("bigIntegerToIp", e);
return "ERROR";
}
}
public final class NeutronL2gatewayConnectionNorthbound extends AbstractNeutronNorthbound<NeutronL2gatewayConnection,
NeutronL2gatewayConnectionRequest, INeutronL2gatewayConnectionCRUD> {
- static final Logger LOGGER = LoggerFactory.getLogger(NeutronL2gatewayConnectionNorthbound.class);
+ static final Logger LOG = LoggerFactory.getLogger(NeutronL2gatewayConnectionNorthbound.class);
private static final String RESOURCE_NAME = "L2gatewayConnection";
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createL2gatewayConnection(final NeutronL2gatewayConnectionRequest input) {
- LOGGER.debug("createL2GatewayConnection NeutronL2GatewayConnectionRequest");
+ LOG.debug("createL2GatewayConnection NeutronL2GatewayConnectionRequest");
return create(input);
}
@Path("/l2-gateways")
public final class NeutronL2gatewayNorthbound
extends AbstractNeutronNorthbound<NeutronL2gateway, NeutronL2gatewayRequest, INeutronL2gatewayCRUD> {
- static final Logger LOGGER = LoggerFactory.getLogger(NeutronL2gatewayNorthbound.class);
+ static final Logger LOG = LoggerFactory.getLogger(NeutronL2gatewayNorthbound.class);
private static final String RESOURCE_NAME = "L2gateway";
@ResponseCode(code = HttpURLConnection.HTTP_UNAVAILABLE, condition = "No providers available") })
public Response createL2gateway(final NeutronL2gatewayRequest input) {
- LOGGER.debug("CreateL2gateway NeutronL2gatewayRequest");
+ LOG.debug("CreateL2gateway NeutronL2gatewayRequest");
return create(input);
}
// S extends INeutronObject<S> as 3rd type argument
private static final int NEUTRON_OBJECT_TYPE_INDEX = 3;
- private static final Logger LOGGER = LoggerFactory.getLogger(AbstractNeutronInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(AbstractNeutronInterface.class);
private static final int DEDASHED_UUID_LENGTH = 32;
private static final int DEDASHED_UUID_START = 0;
private static final int DEDASHED_UUID_DIV1 = 8;
if (neutronObject.getID() != null) {
setUuid.invoke(builder, toUuid(neutronObject.getID()));
} else {
- LOGGER.warn("Attempting to write neutron object {} without UUID", builderClass.getSimpleName());
+ LOG.warn("Attempting to write neutron object {} without UUID", builderClass.getSimpleName());
}
if (neutronObject.getTenantID() != null && !neutronObject.getTenantID().isEmpty()) {
setTenantId.invoke(builder, toUuid(neutronObject.getTenantID()));
result = optional.get();
}
} catch (final ReadFailedException e) {
- LOGGER.warn("Failed to read {}", path, e);
+ LOG.warn("Failed to read {}", path, e);
}
}
return result;
addMd(neutronObject, tx);
return true;
} catch (InterruptedException | ExecutionException e) {
- LOGGER.warn("Transaction failed", e);
+ LOG.warn("Transaction failed", e);
}
return false;
}
return true;
} catch (InterruptedException | ExecutionException e) {
if (e.getCause() instanceof OptimisticLockFailedException) {
- LOGGER.warn("Got OptimisticLockFailedException - {} {}", neutronObject, retries);
+ LOG.warn("Got OptimisticLockFailedException - {} {}", neutronObject, retries);
continue;
}
// TODO: rethrow exception. don't mask exception
- LOGGER.error("Transaction failed", e);
+ LOG.error("Transaction failed", e);
}
break;
}
removeMd(item, tx);
return true;
} catch (InterruptedException | ExecutionException e) {
- LOGGER.warn("Transaction failed", e);
+ LOG.warn("Transaction failed", e);
}
return false;
}
allNeutronObjects.add(fromMd(dataObject));
}
}
- LOGGER.debug("Exiting _getAll, Found {} OpenStackFirewall", allNeutronObjects.size());
+ LOG.debug("Exiting _getAll, Found {} OpenStackFirewall", allNeutronObjects.size());
final List<S> ans = new ArrayList<>();
ans.addAll(allNeutronObjects);
return ans;
return add(input, tx);
} catch (InterruptedException | ExecutionException e) {
if (e.getCause() instanceof OptimisticLockFailedException) {
- LOGGER.warn("Got OptimisticLockFailedException - {} {}", input, retries);
+ LOG.warn("Got OptimisticLockFailedException - {} {}", input, retries);
continue;
}
// TODO: rethrow exception. don't mask exception
- LOGGER.error("Transaction failed", e);
+ LOG.error("Transaction failed", e);
}
break;
}
return remove(uuid, tx);
} catch (InterruptedException | ExecutionException e) {
if (e.getCause() instanceof OptimisticLockFailedException) {
- LOGGER.warn("Got OptimisticLockFailedException - {} {}", uuid, retries);
+ LOG.warn("Got OptimisticLockFailedException - {} {}", uuid, retries);
continue;
}
// TODO: rethrow exception. don't mask exception
- LOGGER.error("Transaction failed", e);
+ LOG.error("Transaction failed", e);
}
break;
}
return update(uuid, delta, tx);
} catch (InterruptedException | ExecutionException e) {
if (e.getCause() instanceof OptimisticLockFailedException) {
- LOGGER.warn("Got OptimisticLockFailedException - {} {} {}", uuid, delta, retries);
+ LOG.warn("Got OptimisticLockFailedException - {} {} {}", uuid, delta, retries);
continue;
}
// TODO: rethrow exception. don't mask exception
- LOGGER.error("Transaction failed", e);
+ LOG.error("Transaction failed", e);
}
break;
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpns.rev150903.bgpvpns.attributes.bgpvpns.Bgpvpn;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpns.rev150903.bgpvpns.attributes.bgpvpns.BgpvpnBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.bgpvpns.rev150903.bgpvpns.attributes.bgpvpns.BgpvpnKey;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
public final class NeutronBgpvpnInterface extends AbstractNeutronInterface<Bgpvpn, Bgpvpns, BgpvpnKey, NeutronBgpvpn>
implements INeutronBgpvpnCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronBgpvpnInterface.class);
private static final ImmutableBiMap<Class<? extends BgpvpnTypeBase>,
String> BGPVPN_TYPE_MAP = new ImmutableBiMap.Builder<Class<? extends BgpvpnTypeBase>, String>()
public final class NeutronFloatingIpInterface
extends AbstractNeutronInterface<Floatingip, Floatingips, FloatingipKey, NeutronFloatingIp>
implements INeutronFloatingIpCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronFloatingIpInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronFloatingIpInterface.class);
NeutronFloatingIpInterface(DataBroker db) {
super(FloatingipBuilder.class, db);
if (floatingIp.getID() != null) {
floatingipBuilder.setUuid(toUuid(floatingIp.getID()));
} else {
- LOGGER.warn("Attempting to write neutron floating IP without UUID");
+ LOG.warn("Attempting to write neutron floating IP without UUID");
}
return floatingipBuilder.build();
}
extends AbstractNeutronInterface<Healthmonitor, Healthmonitors, HealthmonitorKey,
NeutronLoadBalancerHealthMonitor>
implements INeutronLoadBalancerHealthMonitorCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronLoadBalancerHealthMonitorInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronLoadBalancerHealthMonitorInterface.class);
private static final ImmutableBiMap<Class<? extends ProbeBase>,
String> PROBE_MAP = new ImmutableBiMap.Builder<Class<? extends ProbeBase>, String>()
if (healthMonitor.getID() != null) {
healthmonitorBuilder.setUuid(toUuid(healthMonitor.getID()));
} else {
- LOGGER.warn("Attempting to write neutron laod balancer health monitor without UUID");
+ LOG.warn("Attempting to write neutron laod balancer health monitor without UUID");
}
return healthmonitorBuilder.build();
}
if (healthMonitor.getUuid() != null) {
answer.setID(healthMonitor.getUuid().getValue());
} else {
- LOGGER.warn("Attempting to write neutron laod balancer health monitor without UUID");
+ LOG.warn("Attempting to write neutron laod balancer health monitor without UUID");
}
return answer;
}
public final class NeutronLoadBalancerPoolInterface
extends AbstractNeutronInterface<Pool, Pools, PoolKey, NeutronLoadBalancerPool>
implements INeutronLoadBalancerPoolCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronLoadBalancerPoolInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronLoadBalancerPoolInterface.class);
private static final ImmutableBiMap<Class<? extends ProtocolBase>,
String> PROTOCOL_MAP = new ImmutableBiMap.Builder<Class<? extends ProtocolBase>, String>()
if (pool.getID() != null) {
poolBuilder.setUuid(toUuid(pool.getID()));
} else {
- LOGGER.warn("Attempting to write neutron load balancer pool without UUID");
+ LOG.warn("Attempting to write neutron load balancer pool without UUID");
}
return poolBuilder.build();
}
allLoadBalancerPoolMembers.add(fromMemberMd(member));
}
}
- LOGGER.debug("Exiting getLoadBalancerPoolMembers, Found {} OpenStackLoadBalancerPoolMember",
+ LOG.debug("Exiting getLoadBalancerPoolMembers, Found {} OpenStackLoadBalancerPoolMember",
allLoadBalancerPoolMembers.size());
final List<NeutronLoadBalancerPoolMember> ans = new ArrayList<>();
ans.addAll(allLoadBalancerPoolMembers);
result = optional.get();
}
} catch (final ReadFailedException e) {
- LOGGER.warn("Failed to read {}", path, e);
+ LOG.warn("Failed to read {}", path, e);
}
}
transaction.close();
try {
future.get();
} catch (InterruptedException | ExecutionException e) {
- LOGGER.warn("Transation failed ", e);
+ LOG.warn("Transation failed ", e);
return false;
}
return true;
try {
future.get();
} catch (InterruptedException | ExecutionException e) {
- LOGGER.warn("Transation failed ", e);
+ LOG.warn("Transation failed ", e);
return false;
}
return true;
NeutronSFCFlowClassifier>
implements INeutronSFCFlowClassifierCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronSFCFlowClassifierInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronSFCFlowClassifierInterface.class);
private static final ImmutableBiMap<Class<? extends EthertypeBase>,
String> ETHERTYPE_MAP = new ImmutableBiMap.Builder<Class<? extends EthertypeBase>, String>()
@Override
protected SfcFlowClassifier toMd(NeutronSFCFlowClassifier neutronClassifier) {
- LOGGER.trace("toMd: REST SFC Flow Classifier data : {}", neutronClassifier);
+ LOG.trace("toMd: REST SFC Flow Classifier data : {}", neutronClassifier);
SfcFlowClassifierBuilder result = new SfcFlowClassifierBuilder();
toMdBaseAttributes(neutronClassifier, result);
}
result.setL7Parameter(l7Params);
}
- LOGGER.trace("toMd: Yang SFC Flow Classifier data : {}", result);
+ LOG.trace("toMd: Yang SFC Flow Classifier data : {}", result);
return result.build();
}
@Override
protected NeutronSFCFlowClassifier fromMd(SfcFlowClassifier mdClassifier) {
- LOGGER.trace("fromMd: Yang SFC flow classifier data : {}", mdClassifier);
+ LOG.trace("fromMd: Yang SFC flow classifier data : {}", mdClassifier);
NeutronSFCFlowClassifier result = new NeutronSFCFlowClassifier();
fromMdBaseAttributes(mdClassifier, result);
if (mdClassifier.getEthertype() != null) {
}
result.setL7Parameters(l7Param);
}
- LOGGER.trace("fromMd: REST SFC Flow Classifier data : {}", result);
+ LOG.trace("fromMd: REST SFC Flow Classifier data : {}", result);
return result;
}
}
extends AbstractNeutronInterface<PortChain, PortChains, PortChainKey, NeutronSFCPortChain>
implements INeutronSFCPortChainCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronSFCPortChainInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronSFCPortChainInterface.class);
NeutronSFCPortChainInterface(DataBroker db) {
super(PortChainBuilder.class, db);
@Override
protected PortChain toMd(NeutronSFCPortChain neutronPortChain) {
- LOGGER.trace("toMd: REST SFC Port Chain data : {}", neutronPortChain);
+ LOG.trace("toMd: REST SFC Port Chain data : {}", neutronPortChain);
PortChainBuilder result = new PortChainBuilder();
toMdBaseAttributes(neutronPortChain, result);
}
result.setChainParameters(chainParams);
}
- LOGGER.trace("toMd: Yang SFC Port Chain data : {}", result);
+ LOG.trace("toMd: Yang SFC Port Chain data : {}", result);
return result.build();
}
@Override
protected NeutronSFCPortChain fromMd(PortChain mdPortChain) {
- LOGGER.trace("fromMd: Yang SFC Port Chain data : {}", mdPortChain);
+ LOG.trace("fromMd: Yang SFC Port Chain data : {}", mdPortChain);
NeutronSFCPortChain result = new NeutronSFCPortChain();
fromMdBaseAttributes(mdPortChain, result);
if (mdPortChain.getPortPairGroups() != null) {
}
result.setChainParameters(chainParams);
}
- LOGGER.trace("fromMd: REST SFC Port Chain data : {}", result);
+ LOG.trace("fromMd: REST SFC Port Chain data : {}", result);
return result;
}
}
extends AbstractNeutronInterface<PortPairGroup, PortPairGroups, PortPairGroupKey, NeutronSFCPortPairGroup>
implements INeutronSFCPortPairGroupCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronSFCPortPairGroupInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronSFCPortPairGroupInterface.class);
NeutronSFCPortPairGroupInterface(DataBroker db) {
super(PortPairGroupBuilder.class, db);
@Override
protected PortPairGroup toMd(NeutronSFCPortPairGroup neutronPortPairGroup) {
- LOGGER.trace("toMd: REST SFC Port Pair Group data : {}", neutronPortPairGroup);
+ LOG.trace("toMd: REST SFC Port Pair Group data : {}", neutronPortPairGroup);
PortPairGroupBuilder result = new PortPairGroupBuilder();
toMdBaseAttributes(neutronPortPairGroup, result);
}
result.setPortPairs(portPairs);
}
- LOGGER.trace("toMd: Yang SFC Port Pair Group data : {}", result);
+ LOG.trace("toMd: Yang SFC Port Pair Group data : {}", result);
return result.build();
}
@Override
protected NeutronSFCPortPairGroup fromMd(PortPairGroup mdPortPairGroup) {
- LOGGER.trace("fromMd: Yang SFC Port Pair Group data : {}", mdPortPairGroup);
+ LOG.trace("fromMd: Yang SFC Port Pair Group data : {}", mdPortPairGroup);
NeutronSFCPortPairGroup result = new NeutronSFCPortPairGroup();
fromMdBaseAttributes(mdPortPairGroup, result);
if (mdPortPairGroup.getPortPairs() != null) {
}
result.setPortPairs(portPairsUUID);
}
- LOGGER.trace("fromMd: REST SFC Port Pair Group data : {}", result);
+ LOG.trace("fromMd: REST SFC Port Pair Group data : {}", result);
return result;
}
extends AbstractNeutronInterface<PortPair, PortPairs, PortPairKey, NeutronSFCPortPair>
implements INeutronSFCPortPairCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronSFCPortPairInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronSFCPortPairInterface.class);
NeutronSFCPortPairInterface(DataBroker db) {
super(PortPairBuilder.class, db);
@Override
protected PortPair toMd(NeutronSFCPortPair neutronPortPair) {
- LOGGER.trace("toMd: REST SFC Port Pair data : {}", neutronPortPair);
+ LOG.trace("toMd: REST SFC Port Pair data : {}", neutronPortPair);
PortPairBuilder result = new PortPairBuilder();
toMdBaseAttributes(neutronPortPair, result);
}
result.setServiceFunctionParameters(serviceFunctionParams);
}
- LOGGER.trace("toMd: Yang SFC Port Pair data : {}", result);
+ LOG.trace("toMd: Yang SFC Port Pair data : {}", result);
return result.build();
}
@Override
protected NeutronSFCPortPair fromMd(PortPair mdPortPair) {
- LOGGER.trace("fromMd: Yang SFC Port Pair data : {}", mdPortPair);
+ LOG.trace("fromMd: Yang SFC Port Pair data : {}", mdPortPair);
NeutronSFCPortPair result = new NeutronSFCPortPair();
fromMdBaseAttributes(mdPortPair, result);
if (mdPortPair.getIngress() != null) {
}
result.setServiceFunctionParameters(serviceFunctionParam);
}
- LOGGER.trace("fromMd: REST SFC Port Pair data : {}", result);
+ LOG.trace("fromMd: REST SFC Port Pair data : {}", result);
return result;
}
public final class NeutronSecurityRuleInterface extends
AbstractNeutronInterface<SecurityRule, SecurityRules, SecurityRuleKey, NeutronSecurityRule>
implements INeutronSecurityRuleCRUD {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronSecurityRuleInterface.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronSecurityRuleInterface.class);
private static final ImmutableBiMap<Class<? extends DirectionBase>,
String> DIRECTION_MAP = new ImmutableBiMap.Builder<Class<? extends DirectionBase>, String>()
if (securityRule.getID() != null) {
securityRuleBuilder.setUuid(toUuid(securityRule.getID()));
} else {
- LOGGER.warn("Attempting to write neutron securityRule without UUID");
+ LOG.warn("Attempting to write neutron securityRule without UUID");
}
return securityRuleBuilder.build();
}
import org.slf4j.LoggerFactory;
public final class NeutronTranscriberProvider implements AutoCloseable, NeutronTranscriber {
- private static final Logger LOGGER = LoggerFactory.getLogger(NeutronTranscriberProvider.class);
+ private static final Logger LOG = LoggerFactory.getLogger(NeutronTranscriberProvider.class);
private BundleContext context;
private final DataBroker db;
private final List<AutoCloseable> neutronInterfaces = new ArrayList<>();
public NeutronTranscriberProvider(BundleContext context, DataBroker db) {
- LOGGER.debug("DataBroker set to: {}", db);
+ LOG.debug("DataBroker set to: {}", db);
this.context = Preconditions.checkNotNull(context);
this.db = Preconditions.checkNotNull(db);
}