Class CDataDevice
java.lang.Object
org.bgerp.plugin.bgb.getolt.telnet.OltDevice
org.bgerp.plugin.bgb.getolt.telnet.vendor.CDataDevice
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
CDataFD1208Device, CDataFD1608Device, CDataGponDevice
CData EPON OLT device. Ported from GetOltv2 CData.java.
Base class for CData family (CDataGpon, CDataFD1608, CDataFD1208).
-
Nested Class Summary
Nested classes/interfaces inherited from class OltDevice
OltDevice.AuthenticationException, OltDevice.OLTException, OltDevice.ONUInfo -
Field Summary
Fields inherited from class OltDevice
AUTH_ERROR, curLogin, curPass, log, logMessages, loop_detection, MAX_RETRY_COUNT, passCurPos, patterns, port_isolation, portsCount, s1, sessionState, telnet -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcleanConfigurationOutput(String config) Cleans the configuration from pagination prompts, system messages and invalid lines according to CData OLT device syntaxprotected voidprotected voidEnters interface mode (epon or gpon 0/0)Gets distance and RTT information for all ONUs on all ports.getInfo()protected StringReturns interface type for this device family.getMacToOnuRawForPort(int port) getOnuMacAddressesRawForPort(int port) getOpticalInfo(int port) getOpticalInfo(int port, Map<Integer, Boolean> loopDetectionMap) Gets optical information for a specific port with loop detection statusprotected intprotected static StringnormalizeMac(String mac) parseDistanceInfo(String response) Parses the output ofshow ont basic-info 0/0 <port> alland extracts distance for each ONU.parseDistanceInfoForPort(String response, int port) Parses the output ofshow ont basic-info 0/0 <port> alland extracts distance for ONU on a specific port.voidrebootOnu(int port, int onuId) Methods inherited from class OltDevice
addlog, addlog, authenticate, close, convertUtilsToLog, firmwareVersionInfo, getAllMac, getCurLogin, getCurPass, getDefaultPatterns, getLog, getLoopDetectionCached, getMacToOnu, getMacToOnuForPort, getOnuMacAddresses, getOnuMacAddressesForPort, getPortCount, getPortIsolationCached, getServerIp, getSessionState, getStatsOnuAllPorts, getStatsOnuInPort, getTelnet, isConnected, setAuthenticationResult, setAuthenticationResult
-
Constructor Details
-
CDataDevice
- Throws:
IOException
-
CDataDevice
- Throws:
IOException
-
-
Method Details
-
getVendor
-
getInterfaceType
Returns interface type for this device family. Override in GPON subclasses to return "gpon". -
getSerialNumber
- Specified by:
getSerialNumberin classOltDevice
-
getSystemTime
- Specified by:
getSystemTimein classOltDevice
-
getDistanceInfo
Gets distance and RTT information for all ONUs on all ports. EPON CData does not support a single command for all ports, so each port is polled separately.- Specified by:
getDistanceInfoin classOltDevice- Returns:
Map<port, Map<onuId, int[]{distance, rtt}>>where int[0]=distance in meters, int[1]=RTT in Time Quanta- Throws:
IOException
-
parseDistanceInfo
-
parseDistanceInfoForPort
Parses the output ofshow ont basic-info 0/0 <port> alland extracts distance for ONU on a specific port. Output format: F/S P ONT MAC Type Distance Up Extended ID (m) Time Model 0/0 1 1 00:6D:61:A9:50:20 SFU 5249 0:01:58:15 D401 0/0 1 2 E0:E8:E6:1B:02:3C SFU 6978 12:04:42:12 101Z- Parameters:
response- response from the OLTport- port number- Returns:
Map<onuId, int[]{distance, rtt}>
-
getLoopDetection
- Specified by:
getLoopDetectionin classOltDevice- Throws:
IOException
-
getPortIsolation
- Specified by:
getPortIsolationin classOltDevice- Throws:
IOException
-
getMacToOnuRaw
- Overrides:
getMacToOnuRawin classOltDevice- Throws:
IOException
-
getMacToOnuRawForPort
- Overrides:
getMacToOnuRawForPortin classOltDevice- Throws:
IOException
-
getPortsCount
- Specified by:
getPortsCountin classOltDevice- Throws:
IOException
-
getOpticalInfo
- Specified by:
getOpticalInfoin classOltDevice- Throws:
IOException
-
getOpticalInfo
- Specified by:
getOpticalInfoin classOltDevice- Throws:
IOException
-
getOpticalInfo
public List<OpticalInfo> getOpticalInfo(int port, Map<Integer, Boolean> loopDetectionMap) throws IOExceptionGets optical information for a specific port with loop detection status- Parameters:
port- Port numberloopDetectionMap- Map of port numbers to loop detection status- Returns:
- List of OpticalInfo objects with loop detection status set
- Throws:
IOException- If an I/O error occurs
-
enableConfigMode
protected void enableConfigMode() -
enterInterfaceMode
Enters interface mode (epon or gpon 0/0)- Throws:
IOException
-
getInfo
- Specified by:
getInfoin classOltDevice- Throws:
IOException
-
getOnuMacAddressesRaw
- Overrides:
getOnuMacAddressesRawin classOltDevice- Throws:
IOException
-
getOnuMacAddressesRawForPort
protected Map<Integer, List<Map<String,String>>> getOnuMacAddressesRawForPort(int port) throws IOException - Overrides:
getOnuMacAddressesRawForPortin classOltDevice- Throws:
IOException
-
cleanConfigurationOutput
-
getRunningConfig
- Overrides:
getRunningConfigin classOltDevice
-
getStartupConfig
- Overrides:
getStartupConfigin classOltDevice
-
rebootOnu
- Specified by:
rebootOnuin classOltDevice- Throws:
IOException
-
normalizeMac
-