/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.l7tech.gateway.common.AsyncAdminMethods$JobId
 *  com.l7tech.gateway.common.AsyncAdminMethods$JobResult
 *  com.l7tech.gateway.common.AsyncAdminMethods$JobStillActiveException
 *  com.l7tech.gateway.common.AsyncAdminMethods$UnknownJobException
 *  com.l7tech.gateway.common.admin.UDDIRegistryAdmin
 *  com.l7tech.gateway.common.service.PublishedService
 *  com.l7tech.gateway.common.service.PublishedService$WsdlStrategy
 *  com.l7tech.gateway.common.service.PublishedServiceAlias
 *  com.l7tech.gateway.common.service.SampleMessage
 *  com.l7tech.gateway.common.service.ServiceAdmin
 *  com.l7tech.gateway.common.service.ServiceAdmin$ConflictInfo
 *  com.l7tech.gateway.common.service.ServiceAdmin$DownloadDocumentType
 *  com.l7tech.gateway.common.service.ServiceAdmin$ResolutionReport
 *  com.l7tech.gateway.common.service.ServiceDocument
 *  com.l7tech.gateway.common.service.ServiceDocumentWsdlStrategy
 *  com.l7tech.gateway.common.service.ServiceHeader
 *  com.l7tech.gateway.common.service.ServiceHeaderDifferentiator
 *  com.l7tech.gateway.common.service.ServiceTemplate
 *  com.l7tech.gateway.common.transport.ResolutionConfiguration
 *  com.l7tech.gateway.common.uddi.UDDIRegistry
 *  com.l7tech.objectmodel.DeleteException
 *  com.l7tech.objectmodel.EntityHeader
 *  com.l7tech.objectmodel.EntityType
 *  com.l7tech.objectmodel.FindException
 *  com.l7tech.objectmodel.Goid
 *  com.l7tech.objectmodel.ObjectModelException
 *  com.l7tech.objectmodel.PersistentEntity
 *  com.l7tech.objectmodel.SaveException
 *  com.l7tech.objectmodel.UpdateException
 *  com.l7tech.objectmodel.VersionException
 *  com.l7tech.policy.AssertionLicense
 *  com.l7tech.policy.Policy
 *  com.l7tech.policy.PolicyValidator
 *  com.l7tech.policy.PolicyValidatorResult
 *  com.l7tech.policy.PolicyVersion
 *  com.l7tech.policy.assertion.Assertion
 *  com.l7tech.policy.assertion.PolicyAssertionException
 *  com.l7tech.policy.assertion.PolicyReference
 *  com.l7tech.policy.assertion.composite.CompositeAssertion
 *  com.l7tech.policy.validator.PolicyValidationContext
 *  com.l7tech.policy.wsp.WspReader
 *  com.l7tech.uddi.UDDIClient
 *  com.l7tech.uddi.UDDIException
 *  com.l7tech.uddi.UDDINamedEntity
 *  com.l7tech.uddi.UDDIRegistryInfo
 *  com.l7tech.uddi.WsdlPortInfo
 *  com.l7tech.util.Background
 *  com.l7tech.util.CollectionUpdate
 *  com.l7tech.util.CollectionUpdate$Differentiator
 *  com.l7tech.util.CollectionUpdateProducer
 *  com.l7tech.util.Config
 *  com.l7tech.util.ExceptionUtils
 *  com.l7tech.util.Functions$UnaryThrows
 *  com.l7tech.util.GoidUpgradeMapper
 *  com.l7tech.util.Resolver
 *  com.l7tech.util.ResolvingComparator
 *  com.l7tech.util.ResourceUtils
 *  com.l7tech.util.Triple
 *  com.l7tech.util.ValidatedConfig
 *  jakarta.inject.Inject
 *  org.jetbrains.annotations.Nullable
 *  org.springframework.beans.factory.DisposableBean
 */
package com.l7tech.server.service;

import com.l7tech.gateway.common.AsyncAdminMethods;
import com.l7tech.gateway.common.admin.UDDIRegistryAdmin;
import com.l7tech.gateway.common.service.PublishedService;
import com.l7tech.gateway.common.service.PublishedServiceAlias;
import com.l7tech.gateway.common.service.SampleMessage;
import com.l7tech.gateway.common.service.ServiceAdmin;
import com.l7tech.gateway.common.service.ServiceDocument;
import com.l7tech.gateway.common.service.ServiceDocumentWsdlStrategy;
import com.l7tech.gateway.common.service.ServiceHeader;
import com.l7tech.gateway.common.service.ServiceHeaderDifferentiator;
import com.l7tech.gateway.common.service.ServiceTemplate;
import com.l7tech.gateway.common.transport.ResolutionConfiguration;
import com.l7tech.gateway.common.uddi.UDDIRegistry;
import com.l7tech.objectmodel.DeleteException;
import com.l7tech.objectmodel.EntityHeader;
import com.l7tech.objectmodel.EntityType;
import com.l7tech.objectmodel.FindException;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.ObjectModelException;
import com.l7tech.objectmodel.PersistentEntity;
import com.l7tech.objectmodel.SaveException;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.objectmodel.VersionException;
import com.l7tech.policy.AssertionLicense;
import com.l7tech.policy.Policy;
import com.l7tech.policy.PolicyValidator;
import com.l7tech.policy.PolicyValidatorResult;
import com.l7tech.policy.PolicyVersion;
import com.l7tech.policy.assertion.Assertion;
import com.l7tech.policy.assertion.PolicyAssertionException;
import com.l7tech.policy.assertion.PolicyReference;
import com.l7tech.policy.assertion.composite.CompositeAssertion;
import com.l7tech.policy.validator.PolicyValidationContext;
import com.l7tech.policy.wsp.WspReader;
import com.l7tech.server.admin.AsyncAdminMethodsImpl;
import com.l7tech.server.event.AdminInfo;
import com.l7tech.server.policy.PolicyAssertionRbacChecker;
import com.l7tech.server.policy.PolicyVersionManager;
import com.l7tech.server.service.SampleMessageManager;
import com.l7tech.server.service.ServiceAliasManager;
import com.l7tech.server.service.ServiceCache;
import com.l7tech.server.service.ServiceDocumentManager;
import com.l7tech.server.service.ServiceDocumentResolver;
import com.l7tech.server.service.ServiceManager;
import com.l7tech.server.service.ServiceTemplateManager;
import com.l7tech.server.service.ap;
import com.l7tech.server.service.aq;
import com.l7tech.server.service.c;
import com.l7tech.server.service.h;
import com.l7tech.server.service.k;
import com.l7tech.server.service.m;
import com.l7tech.server.service.n;
import com.l7tech.server.service.o;
import com.l7tech.server.service.p;
import com.l7tech.server.service.q;
import com.l7tech.server.service.r;
import com.l7tech.server.service.resolution.NonUniqueServiceResolutionException;
import com.l7tech.server.service.resolution.ServiceResolutionException;
import com.l7tech.server.service.s;
import com.l7tech.server.tokenservice.SecurityTokenServiceTemplateRegistry;
import com.l7tech.server.transport.ResolutionConfigurationManager;
import com.l7tech.server.uddi.ServiceWsdlUpdateChecker;
import com.l7tech.server.uddi.UDDIHelper;
import com.l7tech.server.uddi.UDDITemplateManager;
import com.l7tech.uddi.UDDIClient;
import com.l7tech.uddi.UDDIException;
import com.l7tech.uddi.UDDINamedEntity;
import com.l7tech.uddi.UDDIRegistryInfo;
import com.l7tech.uddi.WsdlPortInfo;
import com.l7tech.util.Background;
import com.l7tech.util.CollectionUpdate;
import com.l7tech.util.CollectionUpdateProducer;
import com.l7tech.util.Config;
import com.l7tech.util.ExceptionUtils;
import com.l7tech.util.Functions;
import com.l7tech.util.GoidUpgradeMapper;
import com.l7tech.util.Resolver;
import com.l7tech.util.ResolvingComparator;
import com.l7tech.util.ResourceUtils;
import com.l7tech.util.Triple;
import com.l7tech.util.ValidatedConfig;
import jakarta.inject.Inject;
import java.io.Closeable;
import java.io.IOException;
import java.io.Serializable;
import java.net.ConnectException;
import java.net.MalformedURLException;
import java.net.SocketException;
import java.net.SocketTimeoutException;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
import java.util.TimerTask;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.FutureTask;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.DisposableBean;

public final class ServiceAdminImpl
implements ServiceAdmin,
DisposableBean {
    private static final ServiceHeader[] a;
    private final AssertionLicense b;
    private final UDDIHelper c;
    private final ServiceManager d;
    private final ServiceAliasManager e;
    private final PolicyValidator f;
    private final SampleMessageManager g;
    private final ServiceDocumentManager h;
    private final WspReader i;
    private final UDDITemplateManager j;
    private final PolicyVersionManager k;
    private final ServiceTemplateManager l;
    private final ServiceDocumentResolver m;
    private final SecurityTokenServiceTemplateRegistry n;
    private final ServiceCache o;
    private final ResolutionConfigurationManager p;
    private final AsyncAdminMethodsImpl q = new AsyncAdminMethodsImpl();
    private final ExecutorService r;
    private final UDDIRegistryAdmin s;
    private final ServiceWsdlUpdateChecker t;
    @Inject
    private PolicyAssertionRbacChecker policyChecker;
    private CollectionUpdateProducer<ServiceHeader, FindException> u = new c(this, 300000L, 100, (CollectionUpdate.Differentiator)new ServiceHeaderDifferentiator());
    private final Logger v = Logger.getLogger(this.getClass().getName());
    private static final String[] w;

    public ServiceAdminImpl(AssertionLicense assertionLicense, UDDIHelper uDDIHelper, ServiceManager serviceManager, ServiceAliasManager serviceAliasManager, PolicyValidator policyValidator, SampleMessageManager sampleMessageManager, ServiceDocumentManager serviceDocumentManager, WspReader wspReader, UDDITemplateManager uDDITemplateManager, PolicyVersionManager policyVersionManager, Config config, ServiceTemplateManager serviceTemplateManager, ServiceDocumentResolver serviceDocumentResolver, UDDIRegistryAdmin uDDIRegistryAdmin, ServiceWsdlUpdateChecker serviceWsdlUpdateChecker, SecurityTokenServiceTemplateRegistry securityTokenServiceTemplateRegistry, ServiceCache serviceCache, ResolutionConfigurationManager resolutionConfigurationManager) {
        this.b = assertionLicense;
        this.c = uDDIHelper;
        this.d = serviceManager;
        this.e = serviceAliasManager;
        this.f = policyValidator;
        this.g = sampleMessageManager;
        this.h = serviceDocumentManager;
        this.i = wspReader;
        this.j = uDDITemplateManager;
        this.k = policyVersionManager;
        this.l = serviceTemplateManager;
        this.m = serviceDocumentResolver;
        this.s = uDDIRegistryAdmin;
        this.t = serviceWsdlUpdateChecker;
        this.n = securityTokenServiceTemplateRegistry;
        this.o = serviceCache;
        this.p = resolutionConfigurationManager;
        int n2 = this.a(config).getIntProperty(w[1], 15);
        LinkedBlockingQueue<Runnable> linkedBlockingQueue = new LinkedBlockingQueue<Runnable>();
        this.r = new ThreadPoolExecutor(1, n2, 300L, TimeUnit.SECONDS, linkedBlockingQueue);
    }

    public String resolveWsdlTarget(String string) throws IOException {
        return this.m.resolveWsdlTarget(string);
    }

    public String resolveUrlTarget(String string, String string2) throws IOException {
        return this.m.resolveDocumentTarget(string, ServiceAdmin.DownloadDocumentType.MOD_ASS, string2);
    }

    public String resolveUrlTarget(String string, ServiceAdmin.DownloadDocumentType downloadDocumentType, String string2) throws IOException {
        return this.m.resolveDocumentTarget(string, downloadDocumentType, string2);
    }

    public AsyncAdminMethods.JobId<String> resolveUrlTargetAsync(String string, String string2) {
        FutureTask<String> futureTask = new FutureTask<String>(AdminInfo.find(false).wrapCallable(new n(this, string, string2)));
        Background.scheduleOneShot((TimerTask)new ap(this, futureTask), (long)0L);
        return this.q.registerJob(futureTask, String.class);
    }

    public String resolveUrlTarget(String string, ServiceAdmin.DownloadDocumentType downloadDocumentType) throws IOException {
        return this.m.resolveDocumentTarget(string, downloadDocumentType);
    }

    public AsyncAdminMethods.JobId<String> resolveUrlTargetAsync(String string, ServiceAdmin.DownloadDocumentType downloadDocumentType) {
        FutureTask<String> futureTask = new FutureTask<String>(AdminInfo.find(false).wrapCallable(new o(this, string, downloadDocumentType)));
        Background.scheduleOneShot((TimerTask)new aq(this, futureTask), (long)0L);
        return this.q.registerJob(futureTask, String.class);
    }

    public PublishedService findServiceByID(String string) throws FindException {
        Goid goid = ServiceAdminImpl.a(string);
        PublishedService publishedService = (PublishedService)this.d.findByPrimaryKey(goid);
        if (publishedService != null) {
            String[] stringArray = w;
            this.v.finest(stringArray[26] + goid.toHexString() + stringArray[7] + publishedService.getVersion());
            Policy policy = publishedService.getPolicy();
            PolicyVersion policyVersion = this.k.findActiveVersionForPolicy(policy.getGoid());
            try {
                if (policyVersion != null) {
                    policy.setVersionOrdinal(policyVersion.getOrdinal());
                    policy.setVersionActive(true);
                }
            }
            catch (FindException findException) {
                throw ServiceAdminImpl.a((Exception)((Object)findException));
            }
        }
        return publishedService;
    }

    public Collection<ServiceDocument> findServiceDocumentsByServiceID(String string) throws FindException {
        Goid goid = ServiceAdminImpl.a(string);
        return this.h.findByServiceId(goid);
    }

    public ServiceHeader[] findAllPublishedServices() throws FindException {
        Collection collection = this.d.findAllHeaders();
        return this.a(collection);
    }

    public ServiceHeader[] findAllPublishedServices(boolean bl2) throws FindException {
        Collection<ServiceHeader> collection = this.d.findAllHeaders(bl2);
        return this.a(collection);
    }

    public ServiceHeader[] findAllPublishedServicesByOffset(int n2, int n3) throws FindException {
        Collection collection = this.d.findAllHeaders(n2, n3);
        return this.a(collection);
    }

    public PublishedServiceAlias findAliasByEntityAndFolder(Goid goid, Goid goid2) throws FindException {
        return (PublishedServiceAlias)this.e.findAliasByEntityAndFolder(goid, goid2);
    }

    public CollectionUpdate<ServiceHeader> getPublishedServicesUpdate(int n2) throws FindException {
        return this.u.createUpdate(n2);
    }

    public AsyncAdminMethods.JobId<PolicyValidatorResult> validatePolicy(String string, PolicyValidationContext policyValidationContext) {
        Assertion assertion;
        try {
            assertion = this.i.parsePermissively(string, WspReader.INCLUDE_DISABLED);
        }
        catch (IOException iOException) {
            throw new RuntimeException(w[29] + ExceptionUtils.getMessage((Throwable)iOException), iOException);
        }
        return this.a(assertion, policyValidationContext);
    }

    private AsyncAdminMethods.JobId<PolicyValidatorResult> a(@Nullable Assertion assertion, PolicyValidationContext policyValidationContext) {
        return this.q.registerJob(this.r.submit(AdminInfo.find(false).wrapCallable(new p(this, assertion, policyValidationContext))), PolicyValidatorResult.class);
    }

    public AsyncAdminMethods.JobId<PolicyValidatorResult> validatePolicy(String string, PolicyValidationContext policyValidationContext, HashMap<String, Policy> hashMap) {
        Assertion assertion;
        try {
            assertion = this.i.parsePermissively(string, WspReader.INCLUDE_DISABLED);
            this.a(assertion, hashMap);
        }
        catch (IOException iOException) {
            throw new RuntimeException(w[5] + ExceptionUtils.getMessage((Throwable)iOException), iOException);
        }
        return this.a(assertion, policyValidationContext);
    }

    /*
     * Enabled force condition propagation
     * Lifted jumps to return sites
     */
    private void a(@Nullable Assertion assertion, HashMap<String, Policy> hashMap) throws IOException {
        if (assertion instanceof CompositeAssertion) {
            CompositeAssertion compositeAssertion = (CompositeAssertion)assertion;
            Iterator iterator = compositeAssertion.children();
            while (iterator.hasNext()) {
                Assertion assertion2 = (Assertion)iterator.next();
                this.a(assertion2, hashMap);
            }
            return;
        } else {
            if (!(assertion instanceof PolicyReference)) return;
            PolicyReference policyReference = (PolicyReference)assertion;
            try {
                if (!hashMap.containsKey(policyReference.retrievePolicyGuid())) return;
                policyReference.replaceFragmentPolicy(hashMap.get(policyReference.retrievePolicyGuid()));
                this.a(policyReference.retrieveFragmentPolicy().getAssertion(), hashMap);
                return;
            }
            catch (IOException iOException) {
                throw ServiceAdminImpl.a(iOException);
            }
        }
    }

    private static boolean a(PersistentEntity persistentEntity) {
        return Goid.isDefault((Goid)persistentEntity.getGoid());
    }

    public Goid savePublishedService(PublishedService publishedService) throws UpdateException, SaveException, VersionException, PolicyAssertionException {
        return this.a(publishedService, true);
    }

    /*
     * Loose catch block
     */
    private Goid a(PublishedService publishedService, boolean bl2) throws UpdateException, SaveException, VersionException, PolicyAssertionException {
        Goid goid;
        block22: {
            Policy policy;
            block21: {
                policy = publishedService.getPolicy();
                if (policy == null) break block21;
                try {
                    block24: {
                        if (ServiceAdminImpl.a((PersistentEntity)publishedService) == ServiceAdminImpl.a((PersistentEntity)policy)) break block21;
                        break block24;
                        catch (ObjectModelException objectModelException) {
                            throw ServiceAdminImpl.a((Exception)((Object)objectModelException));
                        }
                    }
                    throw new SaveException(w[23]);
                }
                catch (ObjectModelException objectModelException) {
                    throw ServiceAdminImpl.a((Exception)((Object)objectModelException));
                }
            }
            try {
                block23: {
                    if (!ServiceAdminImpl.a((PersistentEntity)publishedService)) {
                        goid = publishedService.getGoid();
                        try {
                            this.v.fine(w[9] + goid.toHexString());
                            if (bl2) {
                                this.t.isWsdlUpdatePermitted(publishedService, true);
                            }
                        }
                        catch (ObjectModelException objectModelException) {
                            throw ServiceAdminImpl.a((Exception)((Object)objectModelException));
                        }
                        PublishedService publishedService2 = (PublishedService)this.d.findByPrimaryKey(publishedService.getGoid());
                        try {
                            if (publishedService2 == null) {
                                throw new UpdateException(w[16]);
                            }
                        }
                        catch (ObjectModelException objectModelException) {
                            throw ServiceAdminImpl.a((Exception)((Object)objectModelException));
                        }
                        try {
                            if (policy != null) {
                                publishedService.setPolicy(publishedService2.getPolicy());
                            }
                        }
                        catch (ObjectModelException objectModelException) {
                            throw ServiceAdminImpl.a((Exception)((Object)objectModelException));
                        }
                        publishedService.setFolder(publishedService2.getFolder());
                        publishedService.setTracingEnabled(publishedService2.isTracingEnabled());
                        this.d.update((PersistentEntity)publishedService);
                        break block22;
                    }
                    try {
                        this.v.fine(w[30]);
                        if (policy == null || policy.getGuid() != null) break block23;
                    }
                    catch (ObjectModelException objectModelException) {
                        throw ServiceAdminImpl.a((Exception)((Object)objectModelException));
                    }
                    UUID uUID = UUID.randomUUID();
                    policy.setGuid(uUID.toString());
                }
                publishedService.setTracingEnabled(false);
                goid = this.d.save((PersistentEntity)publishedService);
                try {
                    if (policy != null) {
                        this.policyChecker.checkPolicy(policy);
                        this.k.checkpointPolicy(policy, true, true);
                    }
                }
                catch (ObjectModelException objectModelException) {
                    throw ServiceAdminImpl.a((Exception)((Object)objectModelException));
                }
                this.d.createRoles((PersistentEntity)publishedService);
            }
            catch (ObjectModelException | IOException throwable) {
                throw new SaveException(throwable);
            }
        }
        return goid;
    }

    public Goid saveAlias(PublishedServiceAlias publishedServiceAlias) throws UpdateException, SaveException, VersionException {
        Goid goid;
        try {
            if (!Goid.isDefault((Goid)publishedServiceAlias.getGoid())) {
                goid = publishedServiceAlias.getGoid();
                String[] stringArray = w;
                this.v.fine(stringArray[31] + goid.toHexString());
                this.e.update((PersistentEntity)publishedServiceAlias);
            } else {
                this.v.fine(w[12]);
                goid = this.e.save((PersistentEntity)publishedServiceAlias);
            }
        }
        catch (UpdateException updateException) {
            throw updateException;
        }
        catch (SaveException saveException) {
            throw saveException;
        }
        return goid;
    }

    public Goid savePublishedServiceWithDocuments(PublishedService publishedService, Collection<ServiceDocument> collection) throws UpdateException, SaveException, VersionException, PolicyAssertionException {
        boolean bl2 = true;
        if (!Goid.isDefault((Goid)publishedService.getGoid())) {
            bl2 = false;
        }
        try {
            publishedService.parseWsdlStrategy((PublishedService.WsdlStrategy)new ServiceDocumentWsdlStrategy(collection));
            if (!this.t.isWsdlUpdatePermitted(publishedService)) {
                throw new UpdateException(w[13]);
            }
        }
        catch (FindException findException) {
            throw ServiceAdminImpl.a((Exception)((Object)findException));
        }
        Goid goid = this.a(publishedService, false);
        try {
            Collection<ServiceDocument> collection2 = this.h.findByServiceId(goid);
            for (ServiceDocument serviceDocument : collection2) {
                this.h.delete((PersistentEntity)serviceDocument);
            }
            for (ServiceDocument serviceDocument : collection) {
                serviceDocument.setGoid(ServiceDocument.DEFAULT_GOID);
                serviceDocument.setServiceId(goid);
                this.h.save((PersistentEntity)serviceDocument);
            }
        }
        catch (FindException findException) {
            String[] stringArray = w;
            String string = stringArray[0] + findException.getMessage() + stringArray[10];
            try {
                if (bl2) {
                    throw new SaveException(string);
                }
            }
            catch (FindException findException2) {
                throw ServiceAdminImpl.a((Exception)((Object)findException2));
            }
            throw new UpdateException(string);
        }
        catch (DeleteException deleteException) {
            String[] stringArray = w;
            String string = stringArray[3] + deleteException.getMessage() + stringArray[20];
            try {
                if (bl2) {
                    throw new SaveException(string);
                }
            }
            catch (FindException findException) {
                throw ServiceAdminImpl.a((Exception)((Object)findException));
            }
            throw new UpdateException(string);
        }
        return goid;
    }

    public void setTracingEnabled(Goid goid, boolean bl2) throws UpdateException {
        try {
            PublishedService publishedService = (PublishedService)this.d.findByPrimaryKey(goid);
            publishedService.setTracingEnabled(bl2);
            this.d.update((PersistentEntity)publishedService);
        }
        catch (FindException findException) {
            String[] stringArray = w;
            throw new UpdateException(stringArray[33] + goid.toHexString() + stringArray[4] + ExceptionUtils.getMessage((Throwable)findException), (Throwable)findException);
        }
    }

    public void deletePublishedService(String string) throws DeleteException {
        try {
            Goid goid = ServiceAdminImpl.a(string);
            Collection collection = this.e.findAllAliasesForEntity(goid);
            for (PublishedServiceAlias publishedServiceAlias : collection) {
                this.e.delete((PersistentEntity)publishedServiceAlias);
            }
            PublishedService publishedService = (PublishedService)this.d.findByPrimaryKey(goid);
            this.d.delete((PersistentEntity)publishedService);
            String[] stringArray = w;
            this.v.info(stringArray[24] + String.valueOf(goid));
        }
        catch (FindException findException) {
            throw new DeleteException(w[19], (Throwable)findException);
        }
    }

    public void deleteEntityAlias(String string) throws DeleteException {
        try {
            Goid goid = ServiceAdminImpl.a(string);
            PublishedServiceAlias publishedServiceAlias = (PublishedServiceAlias)this.e.findByPrimaryKey(goid);
            this.e.delete((PersistentEntity)publishedServiceAlias);
            String[] stringArray = w;
            this.v.info(stringArray[27] + String.valueOf(goid));
        }
        catch (FindException findException) {
            throw new DeleteException(w[28], (Throwable)findException);
        }
    }

    private ServiceHeader[] a(Collection<ServiceHeader> collection) {
        try {
            if (collection == null) {
                return a;
            }
        }
        catch (ClassCastException classCastException) {
            throw ServiceAdminImpl.a(classCastException);
        }
        ServiceHeader[] serviceHeaderArray = new ServiceHeader[collection.size()];
        int n2 = 0;
        for (ServiceHeader serviceHeader : collection) {
            try {
                serviceHeaderArray[n2] = serviceHeader;
            }
            catch (ClassCastException classCastException) {
                this.v.log(Level.SEVERE, null, classCastException);
                throw new RuntimeException(w[14], classCastException);
            }
            ++n2;
        }
        return serviceHeaderArray;
    }

    public UDDINamedEntity[] findPoliciesFromUDDIRegistry(Goid goid, String string) throws FindException {
        UDDIRegistry uDDIRegistry = this.s.findByPrimaryKey(goid);
        try {
            if (uDDIRegistry == null) {
                throw new FindException(w[8] + String.valueOf(goid));
            }
        }
        catch (FindException findException) {
            throw ServiceAdminImpl.a((Exception)((Object)findException));
        }
        return this.a(uDDIRegistry, new q(this, string));
    }

    private void a(UDDINamedEntity[] uDDINamedEntityArray) {
        Arrays.sort(uDDINamedEntityArray, new ResolvingComparator((Resolver)new r(this), false));
    }

    public AsyncAdminMethods.JobId<WsdlPortInfo[]> findWsdlInfosForSingleBusinessService(Goid goid, String string, boolean bl2) throws FindException {
        return this.q.registerJob(this.r.submit(AdminInfo.find(false).wrapCallable(new s(this, goid, string, bl2))), WsdlPortInfo[].class);
    }

    public AsyncAdminMethods.JobId<WsdlPortInfo[]> findWsdlInfosFromUDDIRegistry(Goid goid, String string, boolean bl2, boolean bl3) {
        return this.q.registerJob(this.r.submit(AdminInfo.find(false).wrapCallable(new h(this, goid, string, bl2, bl3))), WsdlPortInfo[].class);
    }

    public AsyncAdminMethods.JobId<UDDINamedEntity[]> findBusinessesFromUDDIRegistry(Goid goid, String string, boolean bl2) {
        return this.q.registerJob(this.r.submit(AdminInfo.find(false).wrapCallable(new k(this, goid, string, bl2))), UDDINamedEntity[].class);
    }

    private FindException a(UDDIException uDDIException) {
        String string;
        block12: {
            block11: {
                block10: {
                    String[] stringArray = w;
                    string = stringArray[2] + ExceptionUtils.getMessage((Throwable)uDDIException) + ".";
                    try {
                        try {
                            try {
                                try {
                                    try {
                                        if (ExceptionUtils.causedBy((Throwable)uDDIException, MalformedURLException.class) || ExceptionUtils.causedBy((Throwable)uDDIException, URISyntaxException.class)) break block10;
                                    }
                                    catch (RuntimeException runtimeException) {
                                        throw ServiceAdminImpl.a(runtimeException);
                                    }
                                    if (ExceptionUtils.causedBy((Throwable)uDDIException, UnknownHostException.class)) break block10;
                                }
                                catch (RuntimeException runtimeException) {
                                    throw ServiceAdminImpl.a(runtimeException);
                                }
                                if (ExceptionUtils.causedBy((Throwable)uDDIException, ConnectException.class)) break block10;
                            }
                            catch (RuntimeException runtimeException) {
                                throw ServiceAdminImpl.a(runtimeException);
                            }
                            if (ExceptionUtils.causedBy((Throwable)uDDIException, SocketTimeoutException.class)) break block10;
                        }
                        catch (RuntimeException runtimeException) {
                            throw ServiceAdminImpl.a(runtimeException);
                        }
                        if (!ExceptionUtils.causedBy((Throwable)uDDIException, SocketException.class)) break block11;
                    }
                    catch (RuntimeException runtimeException) {
                        throw ServiceAdminImpl.a(runtimeException);
                    }
                }
                string = string + w[17] + ExceptionUtils.getMessage((Throwable)ExceptionUtils.unnestToRoot((Throwable)uDDIException)) + "'";
                this.v.log(Level.WARNING, string, ExceptionUtils.getDebugException((Throwable)uDDIException));
                break block12;
            }
            this.v.log(Level.WARNING, string, ExceptionUtils.getDebugException((Throwable)uDDIException));
        }
        return new FindException(string);
    }

    private <T> T a(UDDIRegistry uDDIRegistry, Functions.UnaryThrows<T, UDDIClient, UDDIException> unaryThrows) throws FindException {
        Object object;
        UDDIClient uDDIClient = null;
        try {
            uDDIClient = this.c.newUDDIClient(uDDIRegistry);
            object = unaryThrows.call((Object)uDDIClient);
        }
        catch (UDDIException uDDIException) {
            try {
                throw this.a(uDDIException);
            }
            catch (Throwable throwable) {
                ResourceUtils.closeQuietly(uDDIClient);
                throw throwable;
            }
        }
        ResourceUtils.closeQuietly((Closeable)uDDIClient);
        return (T)object;
    }

    public SampleMessage findSampleMessageById(Goid goid) throws FindException {
        return (SampleMessage)this.g.findByPrimaryKey(goid);
    }

    public EntityHeader[] findSampleMessageHeaders(Goid goid, String string) throws FindException {
        return this.g.findHeaders(goid, string);
    }

    public Goid saveSampleMessage(SampleMessage sampleMessage) throws SaveException {
        Goid goid = sampleMessage.getGoid();
        if (SampleMessage.DEFAULT_GOID.equals((Object)sampleMessage.getGoid())) {
            goid = this.g.save((PersistentEntity)sampleMessage);
        } else {
            try {
                this.g.update((PersistentEntity)sampleMessage);
            }
            catch (UpdateException updateException) {
                throw new SaveException(w[15], updateException.getCause());
            }
        }
        return goid;
    }

    public void deleteSampleMessage(SampleMessage sampleMessage) throws DeleteException {
        this.g.delete((PersistentEntity)sampleMessage);
    }

    public Set<ServiceTemplate> findAllTemplates() {
        return this.l.findAll();
    }

    public ServiceTemplate createSecurityTokenServiceTemplate(String string) {
        return this.n.createServiceTemplate(string);
    }

    /*
     * Loose catch block
     */
    public ServiceAdmin.ResolutionReport generateResolutionReport(PublishedService publishedService, Collection<ServiceDocument> collection) throws FindException {
        boolean bl2;
        ServiceAdmin.ResolutionReport resolutionReport;
        ServiceAdmin.ResolutionReport resolutionReport2;
        ArrayList<ServiceAdmin.ConflictInfo> arrayList;
        block18: {
            block16: {
                boolean bl3;
                block15: {
                    block14: {
                        try {
                            if (collection != null) {
                                publishedService.parseWsdlStrategy((PublishedService.WsdlStrategy)new ServiceDocumentWsdlStrategy(collection));
                            }
                        }
                        catch (NonUniqueServiceResolutionException nonUniqueServiceResolutionException) {
                            throw ServiceAdminImpl.a(nonUniqueServiceResolutionException);
                        }
                        ResolutionConfiguration resolutionConfiguration = (ResolutionConfiguration)this.p.findByUniqueName(w[22]);
                        if (resolutionConfiguration == null) break block14;
                        try {
                            block17: {
                                if (!resolutionConfiguration.isPathRequired()) break block14;
                                break block17;
                                catch (NonUniqueServiceResolutionException nonUniqueServiceResolutionException) {
                                    throw ServiceAdminImpl.a(nonUniqueServiceResolutionException);
                                }
                            }
                            bl3 = true;
                            break block15;
                        }
                        catch (NonUniqueServiceResolutionException nonUniqueServiceResolutionException) {
                            throw ServiceAdminImpl.a(nonUniqueServiceResolutionException);
                        }
                    }
                    bl3 = false;
                }
                boolean bl4 = bl3;
                arrayList = new ArrayList<ServiceAdmin.ConflictInfo>();
                try {
                    this.o.checkResolution(publishedService);
                }
                catch (NonUniqueServiceResolutionException nonUniqueServiceResolutionException) {
                    for (Goid goid : nonUniqueServiceResolutionException.getConflictingServices()) {
                        for (Triple<String, String, String> triple : nonUniqueServiceResolutionException.getParameters(goid)) {
                            arrayList.add(new ServiceAdmin.ConflictInfo((String)triple.left, nonUniqueServiceResolutionException.getServiceName(goid, true), nonUniqueServiceResolutionException.getServiceName(goid, false), goid, (String)triple.right, (String)triple.middle));
                        }
                    }
                }
                catch (ServiceResolutionException serviceResolutionException) {
                    throw new FindException(ExceptionUtils.getMessage((Throwable)serviceResolutionException));
                }
                try {
                    ServiceAdmin.ResolutionReport resolutionReport3;
                    resolutionReport2 = resolutionReport3;
                    resolutionReport = resolutionReport3;
                    if (publishedService.getRoutingUri() == null && bl4) break block16;
                }
                catch (NonUniqueServiceResolutionException nonUniqueServiceResolutionException) {
                    throw ServiceAdminImpl.a(nonUniqueServiceResolutionException);
                }
                bl2 = true;
                break block18;
            }
            bl2 = false;
        }
        resolutionReport2(bl2, arrayList.toArray(new ServiceAdmin.ConflictInfo[arrayList.size()]));
        return resolutionReport;
    }

    public ServiceAdmin.ResolutionReport generateResolutionReportForNewService(PublishedService publishedService, Collection<ServiceDocument> collection) throws FindException {
        Collection<Object> collection2;
        PublishedService publishedService2;
        ServiceAdminImpl serviceAdminImpl;
        try {
            if (!Goid.isDefault((Goid)publishedService.getGoid())) {
                throw new FindException(w[25]);
            }
        }
        catch (FindException findException) {
            throw ServiceAdminImpl.a((Exception)((Object)findException));
        }
        try {
            serviceAdminImpl = this;
            publishedService2 = publishedService;
            collection2 = collection == null ? Collections.emptyList() : collection;
        }
        catch (FindException findException) {
            throw ServiceAdminImpl.a((Exception)((Object)findException));
        }
        return serviceAdminImpl.generateResolutionReport(publishedService2, collection2);
    }

    public PublishedService findByAlias(Goid goid) throws FindException {
        PublishedService publishedService = null;
        PublishedServiceAlias publishedServiceAlias = (PublishedServiceAlias)this.e.findByPrimaryKey(goid);
        if (publishedServiceAlias != null) {
            publishedService = this.findServiceByID(String.valueOf(publishedServiceAlias.getEntityGoid()));
        }
        return publishedService;
    }

    private static Goid a(String string) throws FindException {
        try {
            if (string == null) {
                throw new FindException(w[18]);
            }
        }
        catch (IllegalArgumentException illegalArgumentException) {
            throw ServiceAdminImpl.a(illegalArgumentException);
        }
        try {
            return GoidUpgradeMapper.mapId((EntityType)EntityType.SERVICE, (String)string);
        }
        catch (IllegalArgumentException illegalArgumentException) {
            String[] stringArray = w;
            throw new FindException(stringArray[32] + string + stringArray[20], (Throwable)illegalArgumentException);
        }
    }

    protected void initDao() throws Exception {
        try {
            if (this.d == null) {
                throw new IllegalArgumentException(w[6]);
            }
        }
        catch (Exception exception) {
            throw ServiceAdminImpl.a(exception);
        }
        try {
            if (this.f == null) {
                throw new IllegalArgumentException(w[21]);
            }
        }
        catch (Exception exception) {
            throw ServiceAdminImpl.a(exception);
        }
    }

    public String getPolicyURL(String string, boolean bl2) throws FindException {
        return this.c.getExternalPolicyUrlForService(ServiceAdminImpl.a(string), bl2, false);
    }

    public String getConsumptionURL(String string) throws FindException {
        return this.c.getExternalUrlForService(ServiceAdminImpl.a(string));
    }

    public Collection<UDDIRegistryInfo> getUDDIRegistryInfo() {
        return this.j.getTemplatesAsUDDIRegistryInfo();
    }

    public <OUT extends Serializable> String getJobStatus(AsyncAdminMethods.JobId<OUT> jobId) {
        return this.q.getJobStatus(jobId);
    }

    public <OUT extends Serializable> AsyncAdminMethods.JobResult<OUT> getJobResult(AsyncAdminMethods.JobId<OUT> jobId) throws AsyncAdminMethods.UnknownJobException, AsyncAdminMethods.JobStillActiveException {
        return this.q.getJobResult(jobId);
    }

    public <OUT extends Serializable> void cancelJob(AsyncAdminMethods.JobId<OUT> jobId, boolean bl2) {
        this.q.cancelJob(jobId, bl2);
    }

    public void destroy() throws Exception {
        try {
            if (this.r != null) {
                this.r.shutdown();
            }
        }
        catch (Exception exception) {
            throw ServiceAdminImpl.a(exception);
        }
    }

    private Config a(Config config) {
        ValidatedConfig validatedConfig = new ValidatedConfig(config, this.v, (Resolver)new m(this));
        validatedConfig.setMinimumValue(w[11], (Number)1);
        return validatedConfig;
    }

    /*
     * Unable to fully structure code
     */
    static {
        block10: {
            block9: {
                var5 = new String[34];
                var3_1 = 0;
                var2_2 = "w\u0004;\u0005WrnW\u0002=\u0003K5)A\u0013;\u001cL1l\u0012\u0012&\tP?l\\\u0002:J\u0002%A\u0013;\u001c@ Y]\u001a \t\\\u0004h^\u001f-\u000bQ;f\\X$\u000b]\u0011f\\\u0015<\u0018W7gQ\u000f\u001fw\u0004;\u0005WrzW\u0017;\tM;gUV\u001c.a\u001b)@\u0013.\u0003V&{KLi%w\u0004;\u0005Wr{W\u001b&\u001cL<n\u0012\u0019%\u000e\u0005!l@\u0000 \t@rm]\u0015<\u0007@<}\u0012Q\u0002\bV q\u0017'\u0004J&)B\u0017;\u0019@ryS\u0005:\u000fArY]\u001a \t\\rQ\u007f:sJ\u001bA\u0013;\u001cL1l\u0012\u001b(\u0004D5l@V \u0019\u0005 lC\u0003 \u0018@6\n\u001eV?\u000fW!`]\u0018i\u0011{\u0018?\u000bI;m\u0012\u0004,\rL!}@\u000fi\u001bg\u0006-\u000bQ;gUV\u0019\u001fG>`A\u001e,\u000ev7{D\u001f*\u000f\u001fr\u0002\u0015X%A\u0013;\u001c@ Y]\u001a \t\\\u0004h^\u001f-\u000bQ;f\\X$\u000b]\u0011f\\\u0015<\u0018W7gQ\u000f a\u0017?\u0003K5)\\\u0013>Ju'k^\u001f:\u0002@6ZW\u0004?\u0003F7H^\u001f(\u0019Rq\u0017'\u0004J&)Q\u001e(\u0004B7)F\u001e,Jr\u0001M~V/\u0005Wrh\u0012&<\bI;zZ\u0013-Jv7{D\u001f*\u000f\u0005%aW\u0018i\u0003Q!)e%\r&\u0005;z\u0012\u0003'\u000e@ )g2\r#\u00051f\\\u0002;\u0005I8q\u0019%\u0006@1}[\u0019'JF=gF\u0017 \u0004@6)A\u0019$\u000fQ:`\\\u0011i\u0005Q:l@V=\u0002D<)SV\f\u0004Q;}K>,\u000bA7{&q\u0019<\u0006A<.FV<\u001aA3}WV,\u0012L!}[\u0018.Jv3dB\u001a,'@!zS\u0011,4g\u0018(\bI7)F\u0019i\u001fU6hF\u0013i\u0019@ \u007f[\u0015,P\u0005\"{W\u0000 \u0005P!)D\u0013;\u0019L=g\u0012\u0018&\u001e\u00054fG\u0018-\r\u001cV\n\u000bP!lVV+\u0013\u0005u#\u007f\u001f:\u0019L<n\u0012\u0004,\u001bP;{W\u0012i\u0019@ \u007f[\u0015,JL6l\\\u0002 \fL7{ q\u0019<\u0006Arg]\u0002i\fL<m\u0012\u0019+\u0000@1}\u0012\u0002&JA7eW\u0002,D\u0002\u0015X\u001cb\u0019%\u0003F+)d\u0017%\u0003A3}]\u0004i\u0003Vr{W\u0007<\u0003W7m\u0007v\u0013/\u000bP>}^g\u0018(\bI7)F\u0019i\u0019D$l\u0012\u0018,\u001d\u0005!l@\u0000 \t@r~[\u0002!J@*`A\u0002 \u0004Bry]\u001a \t\\~)]\u0004i\u001eJr|B\u0012(\u001e@rlJ\u001f:\u001eL<n\u0012\u0005,\u0018S;jWV>\u0003Q:)\\\u0013>JU=e[\u00150\u001av\u0013%\u000fQ7m\u0012&<\bI;zZ\u0013-9@ \u007f[\u0015,P\u0005\u001ea\u0013;\u001cL1l\u0012\u001b<\u0019Qrg]\u0002i\b@ryW\u0004:\u0003V&l\\\u0002\u0015`\u0013=\u001fW<`\\\u0011i\u0019@ \u007f[\u0015,JL6)\u001fv\u0013%\u000fQ7m\u0012&<\bI;zZ\u0013-9@ \u007f[\u0015,+I;hALi q\u0019<\u0006Arg]\u0002i\fL<m\u0012\u0019+\u0000@1}\u0012\u0002&JA7eW\u0002,D q\u0017'\u0004J&)B\u0017;\u0019@ryS\u0005:\u000fArY]\u001a \t\\rQ\u007f:sJ\u001ba\u0017?\u0003K5)\\\u0013>Ju'k^\u001f:\u0002@6ZW\u0004?\u0003F7 g\u0006-\u000bQ;gUV\u0019\u001fG>`A\u001e,\u000ev7{D\u001f*\u000fd>`S\u0005sJ";
                var4_3 = "w\u0004;\u0005WrnW\u0002=\u0003K5)A\u0013;\u001cL1l\u0012\u0012&\tP?l\\\u0002:J\u0002%A\u0013;\u001c@ Y]\u001a \t\\\u0004h^\u001f-\u000bQ;f\\X$\u000b]\u0011f\\\u0015<\u0018W7gQ\u000f\u001fw\u0004;\u0005WrzW\u0017;\tM;gUV\u001c.a\u001b)@\u0013.\u0003V&{KLi%w\u0004;\u0005Wr{W\u001b&\u001cL<n\u0012\u0019%\u000e\u0005!l@\u0000 \t@rm]\u0015<\u0007@<}\u0012Q\u0002\bV q\u0017'\u0004J&)B\u0017;\u0019@ryS\u0005:\u000fArY]\u001a \t\\rQ\u007f:sJ\u001bA\u0013;\u001cL1l\u0012\u001b(\u0004D5l@V \u0019\u0005 lC\u0003 \u0018@6\n\u001eV?\u000fW!`]\u0018i\u0011{\u0018?\u000bI;m\u0012\u0004,\rL!}@\u000fi\u001bg\u0006-\u000bQ;gUV\u0019\u001fG>`A\u001e,\u000ev7{D\u001f*\u000f\u001fr\u0002\u0015X%A\u0013;\u001c@ Y]\u001a \t\\\u0004h^\u001f-\u000bQ;f\\X$\u000b]\u0011f\\\u0015<\u0018W7gQ\u000f a\u0017?\u0003K5)\\\u0013>Ju'k^\u001f:\u0002@6ZW\u0004?\u0003F7H^\u001f(\u0019Rq\u0017'\u0004J&)Q\u001e(\u0004B7)F\u001e,Jr\u0001M~V/\u0005Wrh\u0012&<\bI;zZ\u0013-Jv7{D\u001f*\u000f\u0005%aW\u0018i\u0003Q!)e%\r&\u0005;z\u0012\u0003'\u000e@ )g2\r#\u00051f\\\u0002;\u0005I8q\u0019%\u0006@1}[\u0019'JF=gF\u0017 \u0004@6)A\u0019$\u000fQ:`\\\u0011i\u0005Q:l@V=\u0002D<)SV\f\u0004Q;}K>,\u000bA7{&q\u0019<\u0006A<.FV<\u001aA3}WV,\u0012L!}[\u0018.Jv3dB\u001a,'@!zS\u0011,4g\u0018(\bI7)F\u0019i\u001fU6hF\u0013i\u0019@ \u007f[\u0015,P\u0005\"{W\u0000 \u0005P!)D\u0013;\u0019L=g\u0012\u0018&\u001e\u00054fG\u0018-\r\u001cV\n\u000bP!lVV+\u0013\u0005u#\u007f\u001f:\u0019L<n\u0012\u0004,\u001bP;{W\u0012i\u0019@ \u007f[\u0015,JL6l\\\u0002 \fL7{ q\u0019<\u0006Arg]\u0002i\fL<m\u0012\u0019+\u0000@1}\u0012\u0002&JA7eW\u0002,D\u0002\u0015X\u001cb\u0019%\u0003F+)d\u0017%\u0003A3}]\u0004i\u0003Vr{W\u0007<\u0003W7m\u0007v\u0013/\u000bP>}^g\u0018(\bI7)F\u0019i\u0019D$l\u0012\u0018,\u001d\u0005!l@\u0000 \t@r~[\u0002!J@*`A\u0002 \u0004Bry]\u001a \t\\~)]\u0004i\u001eJr|B\u0012(\u001e@rlJ\u001f:\u001eL<n\u0012\u0005,\u0018S;jWV>\u0003Q:)\\\u0013>JU=e[\u00150\u001av\u0013%\u000fQ7m\u0012&<\bI;zZ\u0013-9@ \u007f[\u0015,P\u0005\u001ea\u0013;\u001cL1l\u0012\u001b<\u0019Qrg]\u0002i\b@ryW\u0004:\u0003V&l\\\u0002\u0015`\u0013=\u001fW<`\\\u0011i\u0019@ \u007f[\u0015,JL6)\u001fv\u0013%\u000fQ7m\u0012&<\bI;zZ\u0013-9@ \u007f[\u0015,+I;hALi q\u0019<\u0006Arg]\u0002i\fL<m\u0012\u0019+\u0000@1}\u0012\u0002&JA7eW\u0002,D q\u0017'\u0004J&)B\u0017;\u0019@ryS\u0005:\u000fArY]\u001a \t\\rQ\u007f:sJ\u001ba\u0017?\u0003K5)\\\u0013>Ju'k^\u001f:\u0002@6ZW\u0004?\u0003F7 g\u0006-\u000bQ;gUV\u0019\u001fG>`A\u001e,\u000ev7{D\u001f*\u000fd>`S\u0005sJ".length();
                var1_4 = 33;
                var0_5 = -1;
lbl7:
                // 2 sources

                while (true) {
                    v0 = 105;
                    v1 = ++var0_5;
                    v2 = var2_2.substring(v1, v1 + var1_4);
                    v3 = -1;
                    break block9;
                    break;
                }
lbl13:
                // 1 sources

                while (true) {
                    var5[var3_1++] = ServiceAdminImpl.a(v0, ServiceAdminImpl.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    var2_2 = "H+\f8z\b^!6\u001f+`\bYde\u0013=s\u000fNh#\u0013<dA\u001d!T+\u001b;z\u0004\u001au*Z?\u007f\u000f^!6\u001f+`\bYde\r0b\t\u001af*\u0013=6";
                    var4_3 = "H+\f8z\b^!6\u001f+`\bYde\u0013=s\u000fNh#\u0013<dA\u001d!T+\u001b;z\u0004\u001au*Z?\u007f\u000f^!6\u001f+`\bYde\r0b\t\u001af*\u0013=6".length();
                    var1_4 = 28;
                    var0_5 = -1;
lbl22:
                    // 2 sources

                    while (true) {
                        v0 = 90;
                        v4 = ++var0_5;
                        v2 = var2_2.substring(v4, v4 + var1_4);
                        v3 = 0;
                        break block9;
                        break;
                    }
                    break;
                }
lbl28:
                // 1 sources

                while (true) {
                    var5[var3_1++] = ServiceAdminImpl.a(v0, ServiceAdminImpl.b(v2));
                    if ((var0_5 += var1_4) < var4_3) {
                        var1_4 = var2_2.charAt(var0_5);
                        ** continue;
                    }
                    break block10;
                    break;
                }
            }
            switch (v3) {
                default: {
                    ** continue;
                }
                ** case 0:
lbl39:
                // 1 sources

                ** continue;
            }
        }
        ServiceAdminImpl.w = var5;
        ServiceAdminImpl.a = new ServiceHeader[0];
    }

    private static Exception a(Exception exception) {
        return exception;
    }

    private static char[] b(String string) {
        char[] cArray = string.toCharArray();
        if (cArray.length < 2) {
            cArray = cArray;
            cArray[0] = (char)(cArray[0] ^ 0x60);
        }
        return cArray;
    }

    /*
     * Handled impossible loop by duplicating code
     * Enabled aggressive block sorting
     */
    private static String a(int n2, char[] cArray) {
        char[] cArray2;
        block11: {
            int n3;
            int n4;
            int n5;
            block10: {
                n5 = n2;
                cArray2 = cArray;
                n4 = cArray.length;
                n3 = 0;
                if (!true) break block10;
                n4 = n4;
                if (n4 <= n3) break block11;
            }
            do {
                n5 = n5;
                cArray2 = cArray2;
                int n6 = n3;
                cArray2[n6] = (char)(cArray2[n6] ^ (n5 ^ (switch (n3 % 7) {
                    case 0 -> 91;
                    case 1 -> 31;
                    case 2 -> 32;
                    case 3 -> 3;
                    case 4 -> 76;
                    case 5 -> 59;
                    default -> 96;
                })));
                ++n3;
                n4 = n4;
            } while (n4 > n3);
        }
        return new String(cArray2).intern();
    }
}

