com.eg.agent.android.NullAgentImpl Maven / Gradle / Ivy
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.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.ReentrantLock;
/**
* Created by Venkateswari.J on 4/25/2017.
*/
public class NullAgentImpl implements MainInterface {
public static final NullAgentImpl instance = new NullAgentImpl();
private boolean harvestHappened = false;
private final ReentrantLock lock = new ReentrantLock();
private final Condition harvestCond;
public NullAgentImpl() {
this.harvestCond = this.lock.newCondition();
}
public void addTransactionData(TransactionData transactionData) {
}
public List getAndClearTransactionData() {
return new ArrayList();
}
public void mergeTransactionData(List transactionDataList) {
}
public void addErrorData(ErrorData transactionData) {
}
public List getAndClearErrorData() {
return new ArrayList();
}
public void mergeErrorData(List transactionDataList) {
}
public String getCrossProcessId() {
return null;
}
public int getStackTraceLimit() {
return 0;
}
public int getResponseBodyLimit() {
return 0;
}
public void start() {
}
public void stop() {
}
public void disable() {
}
public boolean isDisabled() {
return true;
}
public String getNetworkCarrier() {
return "unknown";
}
@Override
public String getNetworkWanType() {
return null;
}
@Override
public DeviceInformation getDeviceInformation() {
return null;
}
@Override
public ApplicationInformation getApplicationInformation() {
return null;
}
@Override
public EnvironmentInformation getEnvironmentInformation() {
return null;
}
@Override
public MemoryInformation getMemoryInformation() {
return null;
}
@Override
public ResourceInforamtion getResourceInforamtion() {
return null;
}
@Override
public Map eGdata() {
return null;
}
public void setLocation(String countryCode, String adminRegion) {
}
public boolean waitForConnect(long time, TimeUnit unit) {
return true;
}
public boolean waitForHarvest(long time, TimeUnit unit) throws InterruptedException {
this.lock.lock();
boolean var5;
try {
this.harvestHappened = false;
Date end = new Date(System.currentTimeMillis() + TimeUnit.MILLISECONDS.convert(time, unit));
while(!this.harvestHappened) {
if(!this.harvestCond.awaitUntil(end)) {
var5 = false;
return var5;
}
}
var5 = true;
} finally {
this.lock.unlock();
}
return var5;
}
public Encoder getEncoder() {
return new Encoder() {
public String encode(byte[] bytes) {
return new String(bytes);
}
};
}
@Override
public long getSessionDurationMillis() {
return 0;
}
@Override
public boolean updateSavedConnectInformation() {
return false;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy