Search in sources :

Example 66 with ErrorCode

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

the class ErrorCodeRegistry method getRootedStatus.

public static ErrorCode getRootedStatus() {
    ErrorCode err = new ErrorCode();
    err.setCode(213);
    err.setName("Device not rooted");
    err.setDescription(ApplicationConfig.getInstance().getAppName() + " detected that device is not rooted. A rooted device is required to run this collector");
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Example 67 with ErrorCode

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

the class ErrorCodeRegistry method getRemoveEntitlementsFileError.

/**
 * @return
 */
public static ErrorCode getRemoveEntitlementsFileError() {
    ErrorCode err = new ErrorCode();
    err.setCode(519);
    err.setName("Failed to remove entitlements.plist");
    err.setDescription(defaultBundle.getString("Error.app.removeentitlements"));
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Example 68 with ErrorCode

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

the class ErrorCodeRegistry method getAppTrustError.

/**
 * @return
 */
public static ErrorCode getAppTrustError() {
    ErrorCode err = new ErrorCode();
    err.setCode(526);
    err.setName("App trust error");
    err.setDescription(defaultBundle.getString("Error.app.trust"));
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Example 69 with ErrorCode

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

the class ErrorCodeRegistry method getAppDeploymentError.

/**
 * @return
 */
public static ErrorCode getAppDeploymentError(String errorReturn) {
    ErrorCode err = new ErrorCode();
    err.setCode(522);
    err.setName("Failed to deploy/launch app");
    err.setDescription(defaultBundle.getString("Error.app.deploymentfailed") + " (" + errorReturn + ")");
    sendGAErrorCode(err);
    return err;
}
Also used : ErrorCode(com.att.aro.core.pojo.ErrorCode)

Example 70 with ErrorCode

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

the class Application method runAnalyzer.

/**
 * Analyze a trace and produce a report either in json or html<br>
 *
 * <pre>
 * Required command:
 *   --analyze with path to trace directory of traffic.cap
 *   --output output file, error if missing
 *   --format html or json, if missing defaults to json
 *
 * @param context
 *            - Spring ApplicationContext
 * @param cmds
 *            - user commands
 */
void runAnalyzer(ApplicationContext context, Commands cmds) {
    String trace = cmds.getAnalyze();
    IAROService serv = context.getBean(IAROService.class);
    AROTraceData results = null;
    // analyze trace file or directory?
    OutSave outSave = prepareSystemOut();
    ImHereThread imHereThread = new ImHereThread(outSave.getOut(), Logger.getRootLogger());
    try {
        if (serv.isFile(trace)) {
            try {
                results = serv.analyzeFile(retrieveBestPractices(), trace);
            } catch (IOException | TsharkException e) {
                errln("Error occured analyzing trace, detail: " + e.getMessage());
                System.exit(1);
            }
        } else {
            try {
                results = serv.analyzeDirectory(retrieveBestPractices(), trace);
            } catch (IOException e) {
                errln("Error occured analyzing trace directory, detail: " + e.getMessage());
                System.exit(1);
            }
        }
        if (results != null && results.isSuccess()) {
            outSave = prepareSystemOut();
            if (cmds.getFormat().equals("json")) {
                if (serv.getJSonReport(cmds.getOutput(), results)) {
                    outln("Successfully produced JSON report: " + cmds.getOutput());
                } else {
                    errln("Failed to produce JSON report.");
                }
            } else {
                if (serv.getHtmlReport(cmds.getOutput(), results)) {
                    println("Successfully produced HTML report: " + cmds.getOutput());
                } else {
                    errln("Failed to produce HTML report.");
                }
            }
        } else {
            printError(results == null ? new ErrorCode() : results.getError());
        }
    } finally {
        imHereThread.endIndicator();
        while (imHereThread.isRunning()) {
            Thread.yield();
        }
        restoreSystemOut(outSave);
    }
    System.exit(0);
}
Also used : IAROService(com.att.aro.core.IAROService) OutSave(com.att.aro.console.printstreamutils.OutSave) TsharkException(com.att.aro.core.exception.TsharkException) IOException(java.io.IOException) ErrorCode(com.att.aro.core.pojo.ErrorCode) AROTraceData(com.att.aro.core.pojo.AROTraceData) ImHereThread(com.att.aro.console.printstreamutils.ImHereThread)

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