All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.eg.agent.android.Agent Maven / Gradle / Ivy

There is a newer version: 2.1.3
Show newest version
package com.eg.agent.android;

import com.eg.agent.android.common.TransactionData;
import com.eg.agent.android.util.Encoder;
import com.eg.agent.android.util.ErrorData;

import java.util.List;
import java.util.concurrent.TimeUnit;


/**
 * Created by Venkateswari.J on 4/24/2017.
 */


public final class Agent {
    private static final String VERSION = "1.0";
    private static final MainInterface NULL_AGENT_IMPL = new NullAgentImpl();
    private static Object implLock = new Object();
    private static MainInterface impl;

    public Agent() {
    }

    public static void setImpl(MainInterface impl) {
        Object var1 = implLock;
        synchronized (implLock) {
            if (impl == null) {
                impl = NULL_AGENT_IMPL;
            } else {
                impl = impl;
            }

        }
    }

 /*public static MainInterface getImpl() {
        Object var0 = implLock;
        synchronized(implLock) {
            return impl;
        }
    }
*/

    public static MainInterface getImpl() {
        MainInterface agentImpl;
        synchronized (implLock) {
            agentImpl = impl;
        }
        return agentImpl;
    }

    public static String getVersion() {
        return "1.0";
    }

    public static String getCrossProcessId() {
        return getImpl().getCrossProcessId();
    }

    public static int getStackTraceLimit() {
        return getImpl().getStackTraceLimit();
    }

    public static int getResponseBodyLimit() {
        return getImpl().getResponseBodyLimit();
    }

    public static void addTransactionData(TransactionData transactionData) {
        getImpl().addTransactionData(transactionData);
    }

    public static List getAndClearTransactionData() {
        return getImpl().getAndClearTransactionData();
    }

    public static void mergeTransactionData(List transactionDataList) {
        getImpl().mergeTransactionData(transactionDataList);
    }

    public static void addErrorData(ErrorData errorData) {
        getImpl().addErrorData(errorData);
    }

    public static List getAndClearErrorData() {
        return getImpl().getAndClearErrorData();
    }

    public static void mergeErrorData(List errorDataList) {
        getImpl().mergeErrorData(errorDataList);
    }

    public static String getActiveNetworkCarrier() {
        return getImpl().getNetworkCarrier();
    }

    public static void disable() {
        getImpl().disable();
    }

    public static boolean isDisabled() {
        return getImpl().isDisabled();
    }

    public static boolean waitForConnect(long time, TimeUnit unit) throws InterruptedException {
        return getImpl().waitForConnect(time, unit);
    }

    public static boolean waitForHarvest(long time, TimeUnit unit) throws InterruptedException {
        return getImpl().waitForHarvest(time, unit);
    }

    public static void start() {
        getImpl().start();
    }

    public static void stop() {
        getImpl().stop();
    }

    public static void setLocation(String countryCode, String adminRegion) {
        getImpl().setLocation(countryCode, adminRegion);
    }

    public static Encoder getEncoder() {
        return getImpl().getEncoder();
    }

    static {
        impl = NULL_AGENT_IMPL;
    }

    public static String getActiveNetworkWanType() {
        return getImpl().getNetworkWanType();
    }

    public static DeviceInformation getDeviceInformation() {
        return getImpl().getDeviceInformation();
    }

    public static ApplicationInformation getApplicationInformation() {
        return getImpl().getApplicationInformation();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy