/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.log.LogAccessAdmin
 *  com.l7tech.gateway.common.log.LogFileInfo
 *  com.l7tech.gateway.common.log.LogSinkData
 *  com.l7tech.gateway.common.log.LogSinkQuery
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  jakarta.inject.Inject
 */
package com.l7tech.server.log;

import com.l7tech.gateway.common.log.LogAccessAdmin;
import com.l7tech.gateway.common.log.LogFileInfo;
import com.l7tech.gateway.common.log.LogSinkData;
import com.l7tech.gateway.common.log.LogSinkQuery;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.server.cluster.ClusterInfoManager;
import com.l7tech.server.log.SinkManager;
import jakarta.inject.Inject;
import java.util.Collection;
import java.util.Collections;

public class LogAccessAdminImpl
implements LogAccessAdmin {
    @Inject
    private SinkManager sinkManager;
    @Inject
    private ClusterInfoManager clusterInfoManager;

    public Collection<LogFileInfo> findAllFilesForSinkByNode(String string, Goid goid) throws FindException {
        try {
            if (!string.equals(this.clusterInfoManager.thisNodeId())) {
                return Collections.emptyList();
            }
        }
        catch (FindException findException) {
            throw LogAccessAdminImpl.a(findException);
        }
        return this.sinkManager.findAllFilesForSinkByNode(string, goid);
    }

    public LogSinkData getSinkLogs(String string, Goid goid, String string2, LogSinkQuery logSinkQuery) throws FindException {
        try {
            if (!string.equals(this.clusterInfoManager.thisNodeId())) {
                return null;
            }
        }
        catch (FindException findException) {
            throw LogAccessAdminImpl.a(findException);
        }
        return this.sinkManager.getSinkLogs(string, goid, string2, logSinkQuery);
    }

    private static FindException a(FindException findException) {
        return findException;
    }
}

