package com.l7tech.server.security.keystore.software;

import com.l7tech.objectmodel.UpdateException;
import com.l7tech.server.security.keystore.KeystoreFile;
import com.l7tech.util.ExceptionUtils;
import java.security.KeyStoreException;
import java.util.concurrent.Callable;

class b implements Callable<OUT> {
   final Callable val$mutator;
   final Runnable val$transactionCallback;
   final DatabasePkcs12SsgKeyStore this$0;

   b(DatabasePkcs12SsgKeyStore var1, Callable var2, Runnable var3) {
      this.this$0 = var1;
      this.val$mutator = var2;
      this.val$transactionCallback = var3;
   }

   @Override
   public Object call() throws Exception {
      Object[] var1 = new Object[]{null};

      try {
         synchronized (this.this$0) {
            KeystoreFile var3 = this.this$0.l.mutateKeystoreFile(this.this$0.getGoid(), new c(this, var1));
            this.this$0.o = var3.getVersion();
            this.this$0.n = this.this$0.a(var3.getDatabytes());
         }
      } catch (UpdateException var7) {
         UpdateException var2 = var7;

         try {
            if (ExceptionUtils.causedBy(var2, KeyStoreException.class)) {
               throw (KeyStoreException)ExceptionUtils.getCauseIfCausedBy(var2, KeyStoreException.class);
            }
         } catch (UpdateException var6) {
            throw a(var6);
         }

         throw new KeyStoreException(var7);
      }

      return var1[0];
   }

   private static UpdateException a(UpdateException var0) {
      return var0;
   }
}
