Committed by
Gerrit Code Review
Deprecating all SNMP releated classes. not compliant with ONOS architecture
Change-Id: Ia2a4953ea68d88e510689a3131398fc003194c1e
Showing
8 changed files
with
26 additions
and
2 deletions
| ... | @@ -43,7 +43,9 @@ import org.snmp4j.smi.OctetString; | ... | @@ -43,7 +43,9 @@ import org.snmp4j.smi.OctetString; |
| 43 | 43 | ||
| 44 | /** | 44 | /** |
| 45 | * BTI 7000 specific implementation to provide a list of current alarms. | 45 | * BTI 7000 specific implementation to provide a list of current alarms. |
| 46 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 46 | */ | 47 | */ |
| 48 | +@Deprecated | ||
| 47 | public class Bti7000SnmpAlarmProvider implements SnmpDeviceAlarmProvider { | 49 | public class Bti7000SnmpAlarmProvider implements SnmpDeviceAlarmProvider { |
| 48 | private final Logger log = getLogger(getClass()); | 50 | private final Logger log = getLogger(getClass()); |
| 49 | protected static final IClassRegistry CLASS_REGISTRY = new ClassRegistry(_OidRegistry.oidRegistry, I_Device.class); | 51 | protected static final IClassRegistry CLASS_REGISTRY = new ClassRegistry(_OidRegistry.oidRegistry, I_Device.class); | ... | ... |
| ... | @@ -36,7 +36,9 @@ import org.snmp4j.smi.OID; | ... | @@ -36,7 +36,9 @@ import org.snmp4j.smi.OID; |
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * Net SNMP specific implementation to provide a list of current alarms. | 38 | * Net SNMP specific implementation to provide a list of current alarms. |
| 39 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 39 | */ | 40 | */ |
| 41 | +@Deprecated | ||
| 40 | public class NetSnmpAlarmProvider implements SnmpDeviceAlarmProvider { | 42 | public class NetSnmpAlarmProvider implements SnmpDeviceAlarmProvider { |
| 41 | private final Logger log = getLogger(getClass()); | 43 | private final Logger log = getLogger(getClass()); |
| 42 | protected static final IClassRegistry CLASS_REGISTRY = | 44 | protected static final IClassRegistry CLASS_REGISTRY = | ... | ... |
| ... | @@ -60,7 +60,9 @@ import static org.slf4j.LoggerFactory.getLogger; | ... | @@ -60,7 +60,9 @@ import static org.slf4j.LoggerFactory.getLogger; |
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 62 | * SNMP alarms provider. | 62 | * SNMP alarms provider. |
| 63 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 63 | */ | 64 | */ |
| 65 | +@Deprecated | ||
| 64 | @Component(immediate = true) | 66 | @Component(immediate = true) |
| 65 | @Service | 67 | @Service |
| 66 | public class SnmpAlarmProviderService extends AbstractProvider implements AlarmProvider { | 68 | public class SnmpAlarmProviderService extends AbstractProvider implements AlarmProvider { |
| ... | @@ -87,6 +89,7 @@ public class SnmpAlarmProviderService extends AbstractProvider implements AlarmP | ... | @@ -87,6 +89,7 @@ public class SnmpAlarmProviderService extends AbstractProvider implements AlarmP |
| 87 | // TODO Could be replaced with a service lookup, and bundles per device variant. | 89 | // TODO Could be replaced with a service lookup, and bundles per device variant. |
| 88 | Map<String, SnmpDeviceAlarmProvider> providers = new HashMap<>(); | 90 | Map<String, SnmpDeviceAlarmProvider> providers = new HashMap<>(); |
| 89 | 91 | ||
| 92 | + @Deprecated | ||
| 90 | public SnmpAlarmProviderService() { | 93 | public SnmpAlarmProviderService() { |
| 91 | super(new ProviderId("snmp", "org.onosproject.provider.alarm")); | 94 | super(new ProviderId("snmp", "org.onosproject.provider.alarm")); |
| 92 | log.info("SnmpAlarmProviderService ..."); | 95 | log.info("SnmpAlarmProviderService ..."); | ... | ... |
| ... | @@ -18,13 +18,19 @@ import java.util.Collection; | ... | @@ -18,13 +18,19 @@ import java.util.Collection; |
| 18 | import org.onosproject.incubator.net.faultmanagement.alarm.Alarm; | 18 | import org.onosproject.incubator.net.faultmanagement.alarm.Alarm; |
| 19 | import org.onosproject.net.DeviceId; | 19 | import org.onosproject.net.DeviceId; |
| 20 | 20 | ||
| 21 | +/** | ||
| 22 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 23 | + */ | ||
| 24 | +@Deprecated | ||
| 21 | public interface SnmpDeviceAlarmProvider { | 25 | public interface SnmpDeviceAlarmProvider { |
| 22 | /** | 26 | /** |
| 23 | * Implemented by device specific implementations which query the current | 27 | * Implemented by device specific implementations which query the current |
| 24 | * alarms from a device. | 28 | * alarms from a device. |
| 29 | + * @deprecated 1.5.0 Falcon | ||
| 25 | * @param snmpSession SNMP Session | 30 | * @param snmpSession SNMP Session |
| 26 | * @param deviceId device identifier | 31 | * @param deviceId device identifier |
| 27 | * @return device alarms | 32 | * @return device alarms |
| 28 | */ | 33 | */ |
| 34 | + @Deprecated | ||
| 29 | Collection<Alarm> getAlarms(ISnmpSession snmpSession, DeviceId deviceId); | 35 | Collection<Alarm> getAlarms(ISnmpSession snmpSession, DeviceId deviceId); |
| 30 | } | 36 | } | ... | ... |
| ... | @@ -29,7 +29,9 @@ import org.snmp4j.smi.OID; | ... | @@ -29,7 +29,9 @@ import org.snmp4j.smi.OID; |
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * A vendor-specific implementation supporting BTI Systems BTI-7000 equipment. | 31 | * A vendor-specific implementation supporting BTI Systems BTI-7000 equipment. |
| 32 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 32 | */ | 33 | */ |
| 34 | +@Deprecated | ||
| 33 | public class Bti7000DeviceDescriptionProvider implements SnmpDeviceDescriptionProvider { | 35 | public class Bti7000DeviceDescriptionProvider implements SnmpDeviceDescriptionProvider { |
| 34 | private final Logger log = getLogger(getClass()); | 36 | private final Logger log = getLogger(getClass()); |
| 35 | protected static final IClassRegistry CLASS_REGISTRY = | 37 | protected static final IClassRegistry CLASS_REGISTRY = | ... | ... |
| ... | @@ -30,7 +30,9 @@ import org.snmp4j.smi.OID; | ... | @@ -30,7 +30,9 @@ import org.snmp4j.smi.OID; |
| 30 | 30 | ||
| 31 | /** | 31 | /** |
| 32 | * A agent-specific implementation supporting NET-SNMP agents. | 32 | * A agent-specific implementation supporting NET-SNMP agents. |
| 33 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 33 | */ | 34 | */ |
| 35 | +@Deprecated | ||
| 34 | public class NetSnmpDeviceDescriptionProvider implements SnmpDeviceDescriptionProvider { | 36 | public class NetSnmpDeviceDescriptionProvider implements SnmpDeviceDescriptionProvider { |
| 35 | private final Logger log = getLogger(getClass()); | 37 | private final Logger log = getLogger(getClass()); |
| 36 | protected static final IClassRegistry CLASS_REGISTRY = | 38 | protected static final IClassRegistry CLASS_REGISTRY = | ... | ... |
| ... | @@ -18,16 +18,19 @@ import org.onosproject.net.device.DeviceDescription; | ... | @@ -18,16 +18,19 @@ import org.onosproject.net.device.DeviceDescription; |
| 18 | 18 | ||
| 19 | /** | 19 | /** |
| 20 | * Abstraction of an entity which updates a device description with information retrieved via SNMP. | 20 | * Abstraction of an entity which updates a device description with information retrieved via SNMP. |
| 21 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 21 | */ | 22 | */ |
| 23 | +@Deprecated | ||
| 22 | public interface SnmpDeviceDescriptionProvider { | 24 | public interface SnmpDeviceDescriptionProvider { |
| 23 | 25 | ||
| 24 | /** | 26 | /** |
| 25 | * Generated an updated device description. | 27 | * Generated an updated device description. |
| 26 | - * | 28 | + * @deprecated 1.5.0 Falcon |
| 27 | * @param session SNMP session | 29 | * @param session SNMP session |
| 28 | * @param description old device description | 30 | * @param description old device description |
| 29 | * @return new updated description | 31 | * @return new updated description |
| 30 | */ | 32 | */ |
| 33 | + @Deprecated | ||
| 31 | DeviceDescription populateDescription(ISnmpSession session, DeviceDescription description); | 34 | DeviceDescription populateDescription(ISnmpSession session, DeviceDescription description); |
| 32 | 35 | ||
| 33 | } | 36 | } | ... | ... |
| ... | @@ -117,6 +117,7 @@ public class SnmpDeviceProvider extends AbstractProvider | ... | @@ -117,6 +117,7 @@ public class SnmpDeviceProvider extends AbstractProvider |
| 117 | super(new ProviderId("snmp", "org.onosproject.provider.device")); | 117 | super(new ProviderId("snmp", "org.onosproject.provider.device")); |
| 118 | sessionFactory = new SnmpSessionFactory( | 118 | sessionFactory = new SnmpSessionFactory( |
| 119 | new DefaultSnmpConfigurationFactory(new V2cSnmpConfiguration())); | 119 | new DefaultSnmpConfigurationFactory(new V2cSnmpConfiguration())); |
| 120 | + //TODO refactor, no hardcoding in provider, device information should be in drivers | ||
| 120 | providers.put("1.3.6.1.4.1.18070.2.2", new Bti7000DeviceDescriptionProvider()); | 121 | providers.put("1.3.6.1.4.1.18070.2.2", new Bti7000DeviceDescriptionProvider()); |
| 121 | providers.put("1.3.6.1.4.1.20408", new NetSnmpDeviceDescriptionProvider()); | 122 | providers.put("1.3.6.1.4.1.20408", new NetSnmpDeviceDescriptionProvider()); |
| 122 | } | 123 | } |
| ... | @@ -362,7 +363,10 @@ public class SnmpDeviceProvider extends AbstractProvider | ... | @@ -362,7 +363,10 @@ public class SnmpDeviceProvider extends AbstractProvider |
| 362 | + (device != null ? device.deviceInfo() : null), e); | 363 | + (device != null ? device.deviceInfo() : null), e); |
| 363 | } | 364 | } |
| 364 | } | 365 | } |
| 365 | - | 366 | + /** |
| 367 | + * @deprecated 1.5.0 Falcon, not compliant with ONOS SB and driver architecture. | ||
| 368 | + */ | ||
| 369 | + @Deprecated | ||
| 366 | private DeviceDescription populateDescriptionFromDevice(DeviceId did, DeviceDescription desc) { | 370 | private DeviceDescription populateDescriptionFromDevice(DeviceId did, DeviceDescription desc) { |
| 367 | String[] deviceComponents = did.toString().split(":"); | 371 | String[] deviceComponents = did.toString().split(":"); |
| 368 | if (deviceComponents.length > 1) { | 372 | if (deviceComponents.length > 1) { | ... | ... |
-
Please register or login to post a comment