package de.fau.amos.virtualledger.server.banking.adorsys.api;

import de.fau.amos.virtualledger.server.banking.model.BankAccessBankingModel;
import de.fau.amos.virtualledger.server.banking.model.BankAccountBankingModel;
import de.fau.amos.virtualledger.server.banking.model.BankingException;
import de.fau.amos.virtualledger.server.banking.model.BookingModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Class that can be used in other controllers to do interaction with banking
 * api.
 */
@Component

public class BankingApiFacade {

    private BankingApiBinder binder;

    @Autowired
    public BankingApiFacade(BankingApiBinder binder) {
        this.binder = binder;
    }

    // protected empty constructor required for server to init it
    protected BankingApiFacade() {
    }

    public List<BankAccessBankingModel> getBankAccesses(String userId) throws BankingException {
        return binder.getBankAccessEndpoint(userId).getBankAccesses(userId);
    }

    public List<BankAccountBankingModel> getBankAccounts(String userId, String bankAccessId) throws BankingException {
        return binder.getBankAccountEndpoint(userId).getBankAccounts(userId, bankAccessId);
    }

    public List<BookingModel> syncBankAccount(String userId, String bankAccessId, String bankAccountId, String pin)
            throws BankingException {
        return binder.getBankAccountEndpoint(userId).syncBankAccount(userId, bankAccessId, bankAccountId, pin);
    }

    public void addBankAccess(String userId, BankAccessBankingModel bankAccess) throws BankingException {
        binder.getBankAccessEndpoint(userId).addBankAccess(userId, bankAccess);
    }

}

@@ -710,16 +710,22 @@
 iFacade(
+final 
 BankingA
@@ -944,16 +944,22 @@
 ccesses(
+final 
 String u
@@ -1132,16 +1132,22 @@
 ccounts(
+final 
 String u
@@ -1144,32 +1144,38 @@
 l String userId,
+ final
  String bankAcce
@@ -1351,16 +1351,22 @@
 Account(
+final 
 String u
@@ -1371,16 +1371,22 @@
  userId,
+ final
  String 
@@ -1398,16 +1398,22 @@
 ccessId,
+ final
  String 
@@ -1426,16 +1426,22 @@
 countId,
+ final
  String 
@@ -1632,16 +1632,22 @@
 kAccess(
+final 
 String u
@@ -1652,16 +1652,22 @@
  userId,
+ final
  BankAcc

Clean up BankingApiFacade.java