Search in sources :

Example 1 with ErrorCode

use of com.att.aro.core.pojo.ErrorCode in project VideoOptimzer by attdevsupport.

the class Validator method validate.

public ErrorCode validate(Commands cmd, ApplicationContext context) {
    if (cmd.getAnalyze() != null) {
        if (cmd.getFormat().equals("json") && cmd.getFormat().equals("html")) {
            return ErrorCodeRegistry.getUnsupportedFormat();
        }
        if (cmd.getOutput() == null) {
            return ErrorCodeRegistry.getOutputRequired();
        }
        IFileManager filemg = context.getBean(IFileManager.class);
        if (filemg.fileExist(cmd.getOutput())) {
            if ("yes".equals(cmd.getOverwrite())) {
                filemg.deleteFile(cmd.getOutput());
            } else {
                return ErrorCodeRegistry.getFileExist();
            }
        }
    } else {
        if (cmd.getStartcollector() != null) {
            String colname = cmd.getStartcollector();
            if (!"rooted_android".equals(colname) && !"vpn_android".equals(colname) && !"ios".equals(colname)) {
                return ErrorCodeRegistry.getUnsupportedCollector();
            }
            if (cmd.getOutput() == null) {
                return ErrorCodeRegistry.getOutputRequired();
            }
        }
        if (cmd.getVideo() != null && !cmd.getVideo().equals("yes") && !cmd.getVideo().equals("no") && !cmd.getVideo().equals("hd") && !cmd.getVideo().equals("sd") && !cmd.getVideo().equals("slow")) {
            return ErrorCodeRegistry.getInvalidVideoOption();
        }
        ErrorCode uplinkErrorCode = validateUplink(cmd);
        if (uplinkErrorCode != null) {
            return uplinkErrorCode;
        }
        ErrorCode downlinkErrorCode = validateDownlink(cmd);
        if (downlinkErrorCode != null) {
            return downlinkErrorCode;
        }
    }
    return null;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode) IFileManager(com.att.aro.core.fileio.IFileManager)

Example 2 with ErrorCode

use of com.att.aro.core.pojo.ErrorCode in project VideoOptimzer by attdevsupport.

the class ErrorCodeRegistry method getInvalidiOSArgs.

public static ErrorCode getInvalidiOSArgs() {
    ErrorCode err = new ErrorCode();
    err.setCode(314);
    err.setName("Limited support for iOS collection");
    err.setDescription("VO console does not support HD/SD collection with iOS devices.");
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Example 3 with ErrorCode

use of com.att.aro.core.pojo.ErrorCode in project VideoOptimzer by attdevsupport.

the class ErrorCodeRegistry method getInvalidPasswordError.

public static ErrorCode getInvalidPasswordError() {
    ErrorCode err = new ErrorCode();
    err.setCode(313);
    err.setName("Invalid administrator password");
    err.setDescription("Please check that you have admin rights or re-enter your password");
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Example 4 with ErrorCode

use of com.att.aro.core.pojo.ErrorCode in project VideoOptimzer by attdevsupport.

the class ErrorCodeRegistry method getAttenuatorNotApplicable.

public static ErrorCode getAttenuatorNotApplicable() {
    ErrorCode err = new ErrorCode();
    err.setCode(308);
    err.setName("Attenuator not applicable");
    err.setDescription("--uplink and --downlink options are not applicable for ios and rooted android device.");
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Example 5 with ErrorCode

use of com.att.aro.core.pojo.ErrorCode in project VideoOptimzer by attdevsupport.

the class ErrorCodeRegistry method getInvalidVideoOption.

public static ErrorCode getInvalidVideoOption() {
    ErrorCode err = new ErrorCode();
    err.setCode(303);
    err.setName("Invalid video option");
    err.setDescription("Valid video option is yes or no. Invalid value was entered.");
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Aggregations

ErrorCode (com.att.aro.core.pojo.ErrorCode)78 ImHereThread (com.att.aro.console.printstreamutils.ImHereThread)1 OutSave (com.att.aro.console.printstreamutils.OutSave)1 IAROService (com.att.aro.core.IAROService)1 TsharkException (com.att.aro.core.exception.TsharkException)1 IFileManager (com.att.aro.core.fileio.IFileManager)1 AROTraceData (com.att.aro.core.pojo.AROTraceData)1 IOException (java.io.IOException)1