Andrea Campanella
Committed by Gerrit Code Review

Deprecating all SNMP releated classes. not compliant with ONOS architecture

Change-Id: Ia2a4953ea68d88e510689a3131398fc003194c1e
......@@ -43,7 +43,9 @@ import org.snmp4j.smi.OctetString;
/**
* BTI 7000 specific implementation to provide a list of current alarms.
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
public class Bti7000SnmpAlarmProvider implements SnmpDeviceAlarmProvider {
private final Logger log = getLogger(getClass());
protected static final IClassRegistry CLASS_REGISTRY = new ClassRegistry(_OidRegistry.oidRegistry, I_Device.class);
......
......@@ -36,7 +36,9 @@ import org.snmp4j.smi.OID;
/**
* Net SNMP specific implementation to provide a list of current alarms.
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
public class NetSnmpAlarmProvider implements SnmpDeviceAlarmProvider {
private final Logger log = getLogger(getClass());
protected static final IClassRegistry CLASS_REGISTRY =
......
......@@ -60,7 +60,9 @@ import static org.slf4j.LoggerFactory.getLogger;
/**
* SNMP alarms provider.
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
@Component(immediate = true)
@Service
public class SnmpAlarmProviderService extends AbstractProvider implements AlarmProvider {
......@@ -87,6 +89,7 @@ public class SnmpAlarmProviderService extends AbstractProvider implements AlarmP
// TODO Could be replaced with a service lookup, and bundles per device variant.
Map<String, SnmpDeviceAlarmProvider> providers = new HashMap<>();
@Deprecated
public SnmpAlarmProviderService() {
super(new ProviderId("snmp", "org.onosproject.provider.alarm"));
log.info("SnmpAlarmProviderService ...");
......
......@@ -18,13 +18,19 @@ import java.util.Collection;
import org.onosproject.incubator.net.faultmanagement.alarm.Alarm;
import org.onosproject.net.DeviceId;
/**
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
public interface SnmpDeviceAlarmProvider {
/**
* Implemented by device specific implementations which query the current
* alarms from a device.
* @deprecated 1.5.0 Falcon
* @param snmpSession SNMP Session
* @param deviceId device identifier
* @return device alarms
*/
@Deprecated
Collection<Alarm> getAlarms(ISnmpSession snmpSession, DeviceId deviceId);
}
......
......@@ -29,7 +29,9 @@ import org.snmp4j.smi.OID;
/**
* A vendor-specific implementation supporting BTI Systems BTI-7000 equipment.
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
public class Bti7000DeviceDescriptionProvider implements SnmpDeviceDescriptionProvider {
private final Logger log = getLogger(getClass());
protected static final IClassRegistry CLASS_REGISTRY =
......
......@@ -30,7 +30,9 @@ import org.snmp4j.smi.OID;
/**
* A agent-specific implementation supporting NET-SNMP agents.
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
public class NetSnmpDeviceDescriptionProvider implements SnmpDeviceDescriptionProvider {
private final Logger log = getLogger(getClass());
protected static final IClassRegistry CLASS_REGISTRY =
......
......@@ -18,16 +18,19 @@ import org.onosproject.net.device.DeviceDescription;
/**
* Abstraction of an entity which updates a device description with information retrieved via SNMP.
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
public interface SnmpDeviceDescriptionProvider {
/**
* Generated an updated device description.
*
* @deprecated 1.5.0 Falcon
* @param session SNMP session
* @param description old device description
* @return new updated description
*/
@Deprecated
DeviceDescription populateDescription(ISnmpSession session, DeviceDescription description);
}
......
......@@ -117,6 +117,7 @@ public class SnmpDeviceProvider extends AbstractProvider
super(new ProviderId("snmp", "org.onosproject.provider.device"));
sessionFactory = new SnmpSessionFactory(
new DefaultSnmpConfigurationFactory(new V2cSnmpConfiguration()));
//TODO refactor, no hardcoding in provider, device information should be in drivers
providers.put("1.3.6.1.4.1.18070.2.2", new Bti7000DeviceDescriptionProvider());
providers.put("1.3.6.1.4.1.20408", new NetSnmpDeviceDescriptionProvider());
}
......@@ -362,7 +363,10 @@ public class SnmpDeviceProvider extends AbstractProvider
+ (device != null ? device.deviceInfo() : null), e);
}
}
/**
* @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture.
*/
@Deprecated
private DeviceDescription populateDescriptionFromDevice(DeviceId did, DeviceDescription desc) {
String[] deviceComponents = did.toString().split(":");
if (deviceComponents.length > 1) {
......