Search in sources :

Example 1 with AttnrEventFlow

use of com.att.aro.core.peripheral.pojo.AttenuatorEvent.AttnrEventFlow in project VideoOptimzer by attdevsupport.

the class AttenuationEventReaderImpl method processAttnrData.

private AttenuatorEvent processAttnrData(String line) {
    AttenuatorEvent attnrEvent = null;
    try {
        String[] tokens = line.split(DELIMITER);
        AttnrEventFlow atnrFL = AttnrEventFlow.valueOf(tokens[0].trim());
        int delayTime = Integer.valueOf(tokens[1].trim());
        long timeStamp = Long.valueOf(tokens[2].trim());
        attnrEvent = new AttenuatorEvent(atnrFL, delayTime, timeStamp);
    } catch (NumberFormatException numberException) {
        LOGGER.error("Invalid number format : " + line, numberException);
        return new AttenuatorEvent(AttnrEventFlow.DL, 0, 0L);
    } catch (Exception exception) {
        LOGGER.error("Invalid input: " + line, exception);
        return new AttenuatorEvent(AttnrEventFlow.DL, 0, 0L);
    }
    return attnrEvent;
}
Also used : AttnrEventFlow(com.att.aro.core.peripheral.pojo.AttenuatorEvent.AttnrEventFlow) IOException(java.io.IOException) AttenuatorEvent(com.att.aro.core.peripheral.pojo.AttenuatorEvent)

Aggregations

AttenuatorEvent (com.att.aro.core.peripheral.pojo.AttenuatorEvent)1 AttnrEventFlow (com.att.aro.core.peripheral.pojo.AttenuatorEvent.AttnrEventFlow)1 IOException (java.io.IOException)1