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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations