Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Servlets.BIATNET_V1;
- import java.io.IOException;
- import java.lang.reflect.Constructor;
- import java.lang.reflect.Field;
- import java.text.SimpleDateFormat;
- import java.util.ArrayList;
- import java.util.Calendar;
- import java.util.Iterator;
- import java.util.List;
- import javax.servlet.Servlet;
- import javax.servlet.ServletException;
- import javax.servlet.ServletInputStream;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import com.Models.BIATNET_V1.Governor;
- import com.Utility.BIATNET_V1.InvocationSingleton;
- import java.lang.reflect.Method;
- import java.net.SocketException;
- import java.lang.reflect.InvocationTargetException;
- public class Mobile_Banking_Servlet extends HttpServlet implements Servlet
- {
- String Method_Name=null;
- String Class_Name=null;
- String Recived_Class=null;
- public static List<Governor> Governors=new ArrayList<Governor>();
- int i=0;
- public String Response_Caller="";
- private static final long serialVersionUID = 1L;
- public Mobile_Banking_Servlet() {
- super();
- }
- protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- {
- String timeStamp = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(Calendar.getInstance().getTime());
- response.getOutputStream().println("Mobile Banking Servlet Has Been Called, And it's ready to Answer your needs : "+timeStamp);
- }
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
- {
- response.setCharacterEncoding("utf-8");
- System.out.println("-------------------------Beging Of One Response-------------------");
- String Message_To_Sent_To_User="";
- try
- {
- try
- {
- Client_Response Client=new Client_Response();
- String Reading_Request_Resualt=Reading_Client_Message(request);
- Field Variable = Client.getClass().getField(Method_Name);
- Message_To_Sent_To_User=(String)Variable.get(Client);
- System.out.println("--------------------Beging Of First Message Sent to user---------------------------");
- response.getOutputStream().write(Message_To_Sent_To_User.getBytes());
- System.out.println("Message Sent to user :"+Message_To_Sent_To_User);
- System.out.println("--------------------------End Of First Message Sent to user------------------------");
- response.getOutputStream().flush();
- System.out.println("--------------------Beging Of Second Message Sent to user---------------------------");
- response.getOutputStream().write(Reading_Request_Resualt.getBytes());
- System.out.println("Message Sent to user :"+Reading_Request_Resualt);
- System.out.println("--------------------------End Of Second Message Sent to user------------------------");
- response.getOutputStream().flush();
- response.getOutputStream().close();
- }
- catch(IllegalAccessException|NoSuchFieldException|IllegalAccessError ex)
- {
- System.out.println(ex.toString());
- }
- }
- catch (IOException ex)
- {
- System.out.println("error : "+ex);
- }
- System.out.println("-------------------------End Of One Response-------------------");
- doGet(request, response);
- }
- private String Reading_Client_Message(HttpServletRequest request) throws IOException
- {
- List<String> Parsed_Cliend_Request=new ArrayList<String>();
- int length = request.getContentLength();
- byte[] input = new byte[length];
- ServletInputStream sin = request.getInputStream();
- int c, count = 0 ;
- while ((c = sin.read(input, count, input.length-count)) != -1) {
- count +=c;
- }
- sin.close();
- String recievedString = new String(input);
- System.out.println("recivedString "+recievedString );
- String Recived_String="";
- for(int i=1;i<recievedString.length()-1;i++)
- {
- if(recievedString.charAt(i)!='"')
- {
- if(recievedString.charAt(i)!='\\')
- Recived_String=Recived_String+recievedString.charAt(i);
- }
- }
- System.out.println(Recived_String);
- String[] tokens=Recived_String.split("/");
- for (String t : tokens)
- {
- Parsed_Cliend_Request.add(t);
- }
- return Identifing_Client_Needs(Parsed_Cliend_Request);
- }
- private String Identifing_Client_Needs(List<String> Parsed_Client_Request)
- {
- try
- {
- Recived_Class=null;
- int i=0;
- Iterator<String> Parsed_Client_Request_Iterator=Parsed_Client_Request.iterator();
- while(Parsed_Client_Request_Iterator.hasNext())
- {
- String Current_String=Parsed_Client_Request_Iterator.next();
- if(i==0)
- {
- if(Current_String.contains(","))
- {
- Recived_Class=Current_String.substring(0,Current_String.lastIndexOf(','));
- System.out.println("Recived_Class : "+Recived_Class);
- Class_Name=Current_String.substring(Current_String.lastIndexOf(',')+1,Current_String.length());
- System.out.println("Recived_Class : "+Class_Name);
- }
- else
- {
- Class_Name=Current_String;
- }
- }
- else
- {
- Method_Name=Current_String;
- }
- i++;
- }
- if(Recived_Class==null)
- {
- Class<?> Called_Class = Class.forName(Class_Name);
- Constructor<?> Called_Class_Constructor = Called_Class.getConstructor();
- Object object = Called_Class_Constructor.newInstance();
- String Resualt=null;
- Method method = Called_Class.getDeclaredMethod (Method_Name);
- Resualt=(String)method.invoke(object);
- return Resualt;
- }
- else
- {
- Class<?> Called_Class = Class.forName(Class_Name);
- Constructor<?> Called_Class_Constructor = Called_Class.getConstructor();
- Object object = Called_Class_Constructor.newInstance();
- String Resualt=null;
- Method method = Called_Class.getDeclaredMethod (Method_Name,String.class);
- Resualt=(String)method.invoke(object,Recived_Class);
- return Resualt;
- }
- }
- catch(SecurityException|NoSuchMethodException|InvocationTargetException ex)
- {
- ex.printStackTrace();
- return null;
- }
- catch(IllegalAccessException|ClassNotFoundException|InstantiationException ex)
- {
- System.out.println("i'm the cause "+ex);
- return null;
- }
- }
- }
- class Client_Response
- {
- public final String Preparing_Agencies_List_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Agencies_List_Response\n";
- public final String Preparing_Dabs_List_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Dabs_List_Response\n";
- public final String Preparing_Currency_List_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Currency_List_Response\n";
- public final String Preparing_Customer_Info_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Account_Info_Response\n";
- public final String Preparing_Check_Note_Creation="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Check_Book_Creation_Response\n";
- public final String Preparing_Withdrawal_History_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Withdrawal_History_Response\n";
- public final String Preparing_Operation_History_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Operation_History_Response\n";
- public final String Preparing_Add_Beneficiary_Request_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Add_Beneficiary_Response\n";
- public final String Preparing_Remove_Beneficiary_Request_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Remove_Beneficiary_Response\n";
- public final String Preparing_Beneficiary_List_Request_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Beneficiary_List_Response\n";
- public final String Preparing_Transfer_Inter_Creation="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Transfer_Inter_Creation_Response\n";
- public final String Preparing_Transfer_Inter_Validation="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Transfer_Inter_Validation_Response\n";
- public final String Preparing_Transfer_Intra_Creation="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Transfer_Intra_Creation_Response\n";
- public final String Preparing_Transfer_Intra_Validation="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Transfer_Intra_Validation_Response\n";
- public final String Preparing_Transfer_History_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Transfer_History_Response\n";
- public final String Preparing_Remboursement_Constant_Duree_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Sim_Credit_Response\n";
- public final String Preparing_Remboursement_Constant_Montant_To_Send="com.app.taha.pfe.Server_Configuration.Server_Response_Manager/Sim_Credit_Response\n";
- }
- -----------------------------------------------------------------------------------------------------------------------------------------------------------------------
- package Response_Classes;
- import java.lang.reflect.Type;
- import java.net.SocketException;
- import java.rmi.RemoteException;
- import java.util.ArrayList;
- import java.util.List;
- import javax.xml.soap.MessageFactory;
- import javax.xml.soap.MimeHeaders;
- import javax.xml.soap.SOAPBody;
- import javax.xml.soap.SOAPElement;
- import javax.xml.soap.SOAPEnvelope;
- import javax.xml.soap.SOAPException;
- import javax.xml.soap.SOAPMessage;
- import javax.xml.soap.SOAPPart;
- import com.Models.BIATNET_V1.Beneficiary;
- import com.Models.BIATNET_V1.Customer;
- import com.Models.BIATNET_V1.Governor;
- import com.Models.BIATNET_V1.Operation_History;
- import com.Models.BIATNET_V1.Loans;
- import com.Models.BIATNET_V1.Transfer;
- import com.Models.BIATNET_V1.Withdrawal_History;
- import com.Servlets.BIATNET_V1.Mobile_Banking_Servlet;
- import com.Utility.BIATNET_V1.Agency_Parser;
- import com.Utility.BIATNET_V1.Beneficiry_Parser;
- import com.Utility.BIATNET_V1.Currency_Parser;
- import com.Utility.BIATNET_V1.Distributor_Parser;
- import com.Utility.BIATNET_V1.Governors_Manager;
- import com.Utility.BIATNET_V1.InvocationSingleton;
- import com.Utility.BIATNET_V1.Operation_Parser;
- import com.Utility.BIATNET_V1.Transfer_History_Parser;
- import com.Utility.BIATNET_V1.User_Information_Parser;
- import com.Utility.BIATNET_V1.Web_Service;
- import com.Utility.BIATNET_V1.Withdrawal_Parser;
- import com.google.gson.Gson;
- import com.google.gson.JsonSyntaxException;
- import com.google.gson.reflect.TypeToken;
- import com.google.gson.stream.MalformedJsonException;
- public class Client_Request_Manager
- {
- public Client_Request_Manager()
- {
- }
- public String Preparing_Agencies_List_To_Send()
- {
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Agency_Parser Parser=new Agency_Parser(Put_Server_Response_Into_List(Invocation.getListeAgences()));
- Governors_Manager Gov_Parser=new Governors_Manager();
- Gov_Parser.Sort_Governors();
- String json=new Gson().toJson(Mobile_Banking_Servlet.Governors);
- return json;
- }
- catch (RemoteException | NullPointerException e) {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Dabs_List_To_Send()
- {
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Distributor_Parser Parser=new Distributor_Parser(Put_Server_Response_Into_List(Invocation.getListeDAB()));
- Type listType = new TypeToken<List<Governor>>() {}.getType();
- Governors_Manager Gov_Parser=new Governors_Manager();
- Gov_Parser.Sort_Governors();
- String json=new Gson().toJson(Mobile_Banking_Servlet.Governors);
- return json;
- } catch (RemoteException | JsonSyntaxException | NullPointerException e) {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Currency_List_To_Send()
- {
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Currency_Parser Parser=new Currency_Parser(Put_Server_Response_Into_List(Invocation.getDevisesTable()));
- String json=new Gson().toJson(Parser.Get_Currency_List());
- return json;
- }
- catch (RemoteException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Customer_Info_To_Send()
- {
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- User_Information_Parser Parser=new User_Information_Parser(Put_Server_Response_Into_List(Invocation.getAccountIBInfos("IU1308852938")));
- String json=new Gson().toJson(Parser.Get_Gustomer());
- return json;
- }
- catch (RemoteException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Check_Note_Creation(String Param)throws MalformedJsonException
- {
- Type Type = new TypeToken<Customer>() {}.getType();
- Customer Current_Customer = new Gson().fromJson(Param, Type);
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- String Barre=Current_Customer.Get_Accounts().get(0).Get_Check_Books().get(0).Get_Barred().toLowerCase();
- String firstLetter = Barre.substring(0,1).toUpperCase();
- String restLetters =Barre.substring(1).toLowerCase();
- Barre=firstLetter + restLetters;
- Current_Customer.Get_Accounts().get(0).Get_Check_Books().get(0).Set_Barred(Barre);
- String Check_Book_Creation_Response_Message= Invocation.CommandeChequier(Current_Customer.Get_Accounts().get(0).Get_Identifier(), String.valueOf(Current_Customer.Get_Accounts().get(0).Get_Check_Books().get(0).Get_Number_Of_Pages()), Current_Customer.Get_Accounts().get(0).Get_Check_Books().get(0).Get_Barred(), Current_Customer.Get_ID(), Current_Customer.Get_Unknown_ID());
- Type listType = new TypeToken<String>() {}.getType();
- String json=new Gson().toJson(Check_Book_Creation_Response_Message,listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Withdrawal_History_To_Send(String Param)throws MalformedJsonException
- {
- String Date=null;
- String Account=null;
- Type Type = new TypeToken<List<String>>() {}.getType();
- List<String> Recived_Param = new Gson().fromJson(Param, Type);
- Account=Recived_Param.get(0);
- Date=Recived_Param.get(1);
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Withdrawal_Parser Parser=new Withdrawal_Parser(Invocation.getExtraitCompte(Account, Date));
- Type listType = new TypeToken<Withdrawal_History>() {}.getType();
- String json=new Gson().toJson(Parser.Get_Withdrawal_History(),listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Operation_History_To_Send(String Param)throws MalformedJsonException
- {
- String Account=null;
- String Date_Debut=null;
- String Date_Debut_Max=null;
- String Min_Amount=null;
- String Max_Amount=null;
- String Sensop=null;
- String Refop=null;
- String Libop=null;
- Type Type = new TypeToken<List<String>>() {}.getType();
- List<String> Recived_Param = new Gson().fromJson(Param, Type);
- System.out.println(Recived_Param.toString());
- Account=Recived_Param.get(0);
- Date_Debut=Recived_Param.get(1);
- if(Recived_Param.get(2)==null)
- {
- Date_Debut_Max="";
- }
- else
- {
- Date_Debut_Max=Recived_Param.get(2);
- }
- if(Recived_Param.get(3)==null)
- {
- Min_Amount="";
- }
- else
- {
- Min_Amount=Recived_Param.get(3);
- }
- if(Recived_Param.get(4)==null)
- {
- Max_Amount="";
- }
- else
- {
- Max_Amount=Recived_Param.get(4);
- }
- if(Recived_Param.get(5)==null)
- {
- Sensop="";
- }
- else
- {
- Sensop=Recived_Param.get(5);
- }
- if(Recived_Param.get(6)==null)
- {
- Refop="";
- }
- else
- {
- Refop=Recived_Param.get(6);
- }
- if(Recived_Param.get(7)==null)
- {
- Libop="";
- }
- else
- {
- Libop=Recived_Param.get(7);
- }
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Operation_Parser Parser=new Operation_Parser(Invocation.getOperation(Account, Date_Debut,Date_Debut_Max,Min_Amount,Max_Amount,Sensop,Refop,Libop));
- Type listType = new TypeToken<Operation_History>() {}.getType();
- String json=new Gson().toJson(Parser.Get_Operation_History(),listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Add_Beneficiary_Request_To_Send(String Param)throws MalformedJsonException
- {
- try
- {
- Param=Param.replaceAll(",", "\",\"");
- Param=Param.replaceAll("\\{", "{\"");
- Param=Param.replaceAll("\\}", "\"}");
- Param=Param.replaceAll(":", "\":\"");
- Type Current_Type = new TypeToken<Beneficiary>() {}.getType();
- Beneficiary Current_Beneficiary = new Gson().fromJson(Param, Current_Type);
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- String Add_Beneficiary_Response_Message=Invocation.addBeneficiary(Current_Beneficiary.Get_Useless(), Current_Beneficiary.Get_NickName(),Current_Beneficiary.Get_Note(),Current_Beneficiary.Get_Beneficiary_Account_Identifier(),Current_Beneficiary.Get_BIATNet_Customer_ID());
- Type listType = new TypeToken<String>() {}.getType();
- String json=new Gson().toJson(Add_Beneficiary_Response_Message,listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Remove_Beneficiary_Request_To_Send(String Param)throws MalformedJsonException
- {
- InvocationSingleton Invocation;
- try
- {
- Invocation=new InvocationSingleton();
- Type Type = new TypeToken<String>() {}.getType();
- String Current_Beneficiary_ID = new Gson().fromJson(Param, Type);
- return Invocation.removeBeneficiary(Current_Beneficiary_ID);
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Beneficiary_List_Request_To_Send(String Param)throws MalformedJsonException
- {
- Type Type = new TypeToken<String>() {}.getType();
- String Client_ID = new Gson().fromJson(Param, Type);
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Beneficiry_Parser Parser=new Beneficiry_Parser(Invocation.getListeBenefIB(Client_ID));
- Type listType = new TypeToken<List<Beneficiary>>() {}.getType();
- String json=new Gson().toJson(Parser.Get_Beneficiaries_List(),listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Transfer_Inter_Creation(String Param)throws MalformedJsonException
- {
- Type Type = new TypeToken<Transfer>() {}.getType();
- Transfer Current_Transfer = new Gson().fromJson(Param, Type);
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- String Virement_Inter1_Response=Invocation.virementInter1
- (
- Current_Transfer.Get_Sender_Account_ID(),
- Current_Transfer.Get_Reciver_Account_ID(),
- Current_Transfer.Get_Amount(),
- Current_Transfer.Get_Currency(),
- Current_Transfer.Get_Password(),
- Current_Transfer.Get_Phone_Number(),
- Current_Transfer.Get_BIATNet_Account_ID(),
- Current_Transfer.Get_Status()
- );
- String[] Tokens=Virement_Inter1_Response.split("/");
- String Transfer_ID=Tokens[0].substring(Tokens[0].indexOf(86));
- Current_Transfer.Set_Transfer_ID(Transfer_ID);
- Type listType = new TypeToken<Transfer>() {}.getType();
- String json=new Gson().toJson(Current_Transfer,listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Transfer_Inter_Validation(String Param)throws MalformedJsonException
- {
- Type Type = new TypeToken<Transfer>() {}.getType();
- Transfer Current_Transfer = new Gson().fromJson(Param, Type);
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- String Virement_Inter_Request=Invocation.virementInter
- (
- Current_Transfer.Get_Sender_Account_ID(),
- Current_Transfer.Get_Reciver_Account_ID(),
- Current_Transfer.Get_Amount(),
- Current_Transfer.Get_Currency(),
- Current_Transfer.Get_Password(),
- Current_Transfer.Get_Phone_Number(),
- Current_Transfer.Get_BIATNet_Account_ID(),
- "ATTENTE",
- Current_Transfer.Get_Transfer_ID(),
- Current_Transfer.Get_User_Code_Validation()
- );
- Type listType = new TypeToken<String>() {}.getType();
- String json=new Gson().toJson(Virement_Inter_Request,listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Transfer_Intra_Creation(String Param)throws MalformedJsonException
- {
- Type Type = new TypeToken<Transfer>() {}.getType();
- Transfer Current_Transfer = new Gson().fromJson(Param, Type);
- System.out.println("Recived param For Transfer Creation :");
- System.out.println(Current_Transfer.toString());
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- String Virement_Intra_Response=Invocation.virementIntra1
- (
- Current_Transfer.Get_Sender_Account_ID(),
- Current_Transfer.Get_Reciver_Account_ID(),
- Current_Transfer.Get_Amount(),
- Current_Transfer.Get_Currency(),
- Current_Transfer.Get_Password(),
- Current_Transfer.Get_Phone_Number(),
- Current_Transfer.Get_BIATNet_Account_ID(),
- "NONE"
- );
- String[] Tokens=Virement_Intra_Response.split("/");
- String Transfer_ID=Tokens[0].substring(Tokens[0].indexOf(86));
- Current_Transfer.Set_Transfer_ID(Transfer_ID);
- Type listType = new TypeToken<Transfer>() {}.getType();
- String json=new Gson().toJson(Current_Transfer,listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Transfer_Intra_Validation(String Param)throws MalformedJsonException
- {
- Type Type = new TypeToken<Transfer>() {}.getType();
- Transfer Current_Transfer = new Gson().fromJson(Param, Type);
- InvocationSingleton Invocation;
- System.out.println("Recived param For Transfer Validation :");
- System.out.println(Current_Transfer.toString());
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- String Virement_Intra_Request=Invocation.virementIntra
- (
- Current_Transfer.Get_Sender_Account_ID(),
- Current_Transfer.Get_Reciver_Account_ID(),
- Current_Transfer.Get_Amount(),
- Current_Transfer.Get_Currency(),
- Current_Transfer.Get_Password(),
- Current_Transfer.Get_Phone_Number(),
- Current_Transfer.Get_BIATNet_Account_ID(),
- Current_Transfer.Get_User_Code_Validation(),
- "ATTENTE",
- Current_Transfer.Get_Transfer_ID()
- );
- Type listType = new TypeToken<String>() {}.getType();
- String json=new Gson().toJson(Virement_Intra_Request,listType);
- return json;
- }
- catch(RemoteException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Transfer_History_To_Send(String Param)throws MalformedJsonException
- {
- Type Type = new TypeToken<String>() {}.getType();
- String Client_ID = new Gson().fromJson(Param, Type);
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Transfer_History_Parser Parser=new Transfer_History_Parser(Put_Server_Response_Into_List(Invocation.SuiviVirements(Client_ID)));
- String json=new Gson().toJson(Parser.Get_Transfer_History_List());
- return json;
- }
- catch (RemoteException | JsonSyntaxException | NullPointerException e) {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Remboursement_Degressif_Montant_To_Send(String Param)throws MalformedJsonException
- {
- try
- {
- Type Type = new TypeToken<Loans>() {}.getType();
- Loans Simulation_Param = new Gson().fromJson(Param, Type);
- MessageFactory messageFactory = MessageFactory.newInstance();
- SOAPMessage Soap_Message = messageFactory.createMessage();
- SOAPPart soapPart = Soap_Message.getSOAPPart();
- String serverURI = "http://BIATSI/SI_SERVICES/Credit/";
- // SOAP Envelope
- SOAPEnvelope envelope = soapPart.getEnvelope();
- envelope.addNamespaceDeclaration("",serverURI);
- // SOAP Body
- //SOAPBody soapBody = envelope.getBody();
- SOAPBody soapBody = envelope.getBody();
- SOAPElement Remboursement_Degressif_Montant = soapBody.addChildElement("RemboursementDegressifMontant","","http://BIATSI/SI_SERVICES/Credit");
- SOAPElement Montant_de_la_tranche = Remboursement_Degressif_Montant.addChildElement("Montant_de_la_tranche","","http://BIATSI/SI_SERVICES/Credit");
- Montant_de_la_tranche.addTextNode(Simulation_Param.Get_Montant_de_la_tranche());
- SOAPElement Montant_Remboursement = Remboursement_Degressif_Montant.addChildElement("Montant_Remboursement","","http://BIATSI/SI_SERVICES/Credit");
- Montant_Remboursement.addTextNode(Simulation_Param.Get_Montant_Remboursement());
- SOAPElement Taux = Remboursement_Degressif_Montant.addChildElement("Taux","","http://BIATSI/SI_SERVICES/Credit");
- Taux.addTextNode(Simulation_Param.Get_Taux());
- SOAPElement Periodicite_Principal= Remboursement_Degressif_Montant.addChildElement("Periodicite_Principal","","http://BIATSI/SI_SERVICES/Credit");
- Periodicite_Principal.addTextNode(Simulation_Param.Get_Periodicite_Principal());
- SOAPElement Periodicite_Interets = Remboursement_Degressif_Montant.addChildElement("Periodicite_Interets","","http://BIATSI/SI_SERVICES/Credit");
- Periodicite_Interets.addTextNode(Simulation_Param.Get_Periodicite_Interets());
- SOAPElement DateDeblocage = Remboursement_Degressif_Montant.addChildElement("DateDeblocage","","http://BIATSI/SI_SERVICES/Credit");
- DateDeblocage.addTextNode(Simulation_Param.Get_DateDeblocage());
- SOAPElement PremiereEcheancePrincipal = Remboursement_Degressif_Montant.addChildElement("PremiereEcheancePrincipal","","http://BIATSI/SI_SERVICES/Credit");
- PremiereEcheancePrincipal.addTextNode(Simulation_Param.Get_PremiereEcheancePrincipal());
- SOAPElement PremiereEcheanceInterets = Remboursement_Degressif_Montant.addChildElement("PremiereEcheanceInterets","","http://BIATSI/SI_SERVICES/Credit");
- PremiereEcheanceInterets.addTextNode(Simulation_Param.Get_PremiereEcheanceInterets());
- MimeHeaders headers = Soap_Message.getMimeHeaders();
- headers.addHeader("SOAPAction", serverURI + "RemboursementDegressifMontant");
- Soap_Message.saveChanges();
- Web_Service Web_Service_Caller=new Web_Service(Soap_Message);
- String json=new Gson().toJson(Web_Service_Caller.Get_Web_Service_Response_List());
- return json;
- }
- catch (SOAPException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Remboursement_Constant_Montant_To_Send(String Param)throws MalformedJsonException
- {
- try
- {
- Type Type = new TypeToken<Loans>() {}.getType();
- Loans Simulation_Param = new Gson().fromJson(Param, Type);
- MessageFactory messageFactory = MessageFactory.newInstance();
- SOAPMessage Soap_Message = messageFactory.createMessage();
- SOAPPart soapPart = Soap_Message.getSOAPPart();
- String serverURI = "http://BIATSI/SI_SERVICES/Credit/";
- // SOAP Envelope
- SOAPEnvelope envelope = soapPart.getEnvelope();
- envelope.addNamespaceDeclaration("",serverURI);
- // SOAP Body
- //SOAPBody soapBody = envelope.getBody();
- SOAPBody soapBody = envelope.getBody();
- SOAPElement Remboursement_Constant_Montant = soapBody.addChildElement("RemboursementConstantMontant","","http://BIATSI/SI_SERVICES/Credit");
- SOAPElement Montant_de_la_tranche = Remboursement_Constant_Montant.addChildElement("Montant_de_la_tranche","","http://BIATSI/SI_SERVICES/Credit");
- Montant_de_la_tranche.addTextNode(Simulation_Param.Get_Montant_de_la_tranche());
- SOAPElement Montant_Remboursement = Remboursement_Constant_Montant.addChildElement("Montant_Remboursement","","http://BIATSI/SI_SERVICES/Credit");
- Montant_Remboursement.addTextNode(Simulation_Param.Get_Montant_Remboursement());
- SOAPElement Taux = Remboursement_Constant_Montant.addChildElement("Taux","","http://BIATSI/SI_SERVICES/Credit");
- Taux.addTextNode(Simulation_Param.Get_Taux());
- SOAPElement Periodicite_Principal= Remboursement_Constant_Montant.addChildElement("Periodicite_Principal","","http://BIATSI/SI_SERVICES/Credit");
- Periodicite_Principal.addTextNode(Simulation_Param.Get_Periodicite_Principal());
- SOAPElement Periodicite_Interets = Remboursement_Constant_Montant.addChildElement("Periodicite_Interets","","http://BIATSI/SI_SERVICES/Credit");
- Periodicite_Interets.addTextNode(Simulation_Param.Get_Periodicite_Interets());
- SOAPElement DateDeblocage = Remboursement_Constant_Montant.addChildElement("DateDeblocage","","http://BIATSI/SI_SERVICES/Credit");
- DateDeblocage.addTextNode(Simulation_Param.Get_DateDeblocage());
- SOAPElement PremiereEcheancePrincipal = Remboursement_Constant_Montant.addChildElement("PremiereEcheancePrincipal","","http://BIATSI/SI_SERVICES/Credit");
- PremiereEcheancePrincipal.addTextNode(Simulation_Param.Get_PremiereEcheancePrincipal());
- SOAPElement PremiereEcheanceInterets = Remboursement_Constant_Montant.addChildElement("PremiereEcheanceInterets","","http://BIATSI/SI_SERVICES/Credit");
- PremiereEcheanceInterets.addTextNode(Simulation_Param.Get_PremiereEcheanceInterets());
- MimeHeaders headers = Soap_Message.getMimeHeaders();
- headers.addHeader("SOAPAction", serverURI + "RemboursementConstantMontant");
- Soap_Message.saveChanges();
- System.out.println(Soap_Message.toString());
- Web_Service Web_Service_Caller=new Web_Service(Soap_Message);
- String json=new Gson().toJson(Web_Service_Caller.Get_Web_Service_Response_List());
- return json;
- }
- catch (SOAPException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Remboursement_Degressif_Duree_To_Send(String Param)throws MalformedJsonException
- {
- try
- {
- Type Type = new TypeToken<Loans>() {}.getType();
- Loans Simulation_Param = new Gson().fromJson(Param, Type);
- MessageFactory messageFactory = MessageFactory.newInstance();
- SOAPMessage Soap_Message = messageFactory.createMessage();
- SOAPPart soapPart = Soap_Message.getSOAPPart();
- String serverURI = "http://BIATSI/SI_SERVICES/Credit/";
- // SOAP Envelope
- SOAPEnvelope envelope = soapPart.getEnvelope();
- envelope.addNamespaceDeclaration("",serverURI);
- // SOAP Body
- //SOAPBody soapBody = envelope.getBody();
- SOAPBody soapBody = envelope.getBody();
- SOAPElement Remboursement_Degressif_Duree = soapBody.addChildElement("RemboursementDegressifDuree","","http://BIATSI/SI_SERVICES/Credit");
- SOAPElement Montant_de_la_tranche = Remboursement_Degressif_Duree.addChildElement("Montant_de_la_tranche","","http://BIATSI/SI_SERVICES/Credit");
- Montant_de_la_tranche.addTextNode(Simulation_Param.Get_Montant_de_la_tranche());
- SOAPElement Duree_Tranche = Remboursement_Degressif_Duree.addChildElement("Duree_Tranche","","http://BIATSI/SI_SERVICES/Credit");
- Duree_Tranche.addTextNode(Simulation_Param.Get_Duree_Tranche());
- SOAPElement Taux = Remboursement_Degressif_Duree.addChildElement("Taux","","http://BIATSI/SI_SERVICES/Credit");
- Taux.addTextNode(Simulation_Param.Get_Taux());
- SOAPElement Periodicite_Principal= Remboursement_Degressif_Duree.addChildElement("Periodicite_Principal","","http://BIATSI/SI_SERVICES/Credit");
- Periodicite_Principal.addTextNode(Simulation_Param.Get_Periodicite_Principal());
- SOAPElement Periodicite_Interets = Remboursement_Degressif_Duree.addChildElement("Periodicite_Interets","","http://BIATSI/SI_SERVICES/Credit");
- Periodicite_Interets.addTextNode(Simulation_Param.Get_Periodicite_Interets());
- SOAPElement DateDeblocage = Remboursement_Degressif_Duree.addChildElement("DateDeblocage","","http://BIATSI/SI_SERVICES/Credit");
- DateDeblocage.addTextNode(Simulation_Param.Get_DateDeblocage());
- SOAPElement PremiereEcheancePrincipal = Remboursement_Degressif_Duree.addChildElement("PremiereEcheancePrincipal","","http://BIATSI/SI_SERVICES/Credit");
- PremiereEcheancePrincipal.addTextNode(Simulation_Param.Get_PremiereEcheancePrincipal());
- SOAPElement PremiereEcheanceInterets = Remboursement_Degressif_Duree.addChildElement("PremiereEcheanceInterets","","http://BIATSI/SI_SERVICES/Credit");
- PremiereEcheanceInterets.addTextNode(Simulation_Param.Get_PremiereEcheanceInterets());
- MimeHeaders headers = Soap_Message.getMimeHeaders();
- headers.addHeader("SOAPAction", serverURI + "RemboursementDegressifDuree");
- Soap_Message.saveChanges();
- System.out.println(Soap_Message.toString());
- Web_Service Web_Service_Caller=new Web_Service(Soap_Message);
- String json=new Gson().toJson(Web_Service_Caller.Get_Web_Service_Response_List());
- return json;
- }
- catch (SOAPException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- public String Preparing_Remboursement_Constant_Duree_To_Send(String Param)throws MalformedJsonException
- {
- try
- {
- Type Type = new TypeToken<Loans>() {}.getType();
- Loans Simulation_Param = new Gson().fromJson(Param, Type);
- MessageFactory messageFactory = MessageFactory.newInstance();
- SOAPMessage Soap_Message = messageFactory.createMessage();
- SOAPPart soapPart = Soap_Message.getSOAPPart();
- String serverURI = "http://BIATSI/SI_SERVICES/Credit/";
- // SOAP Envelope
- SOAPEnvelope envelope = soapPart.getEnvelope();
- envelope.addNamespaceDeclaration("",serverURI);
- // SOAP Body
- //SOAPBody soapBody = envelope.getBody();
- SOAPBody soapBody = envelope.getBody();
- SOAPElement Remboursement_Constant_Duree = soapBody.addChildElement("RemboursementConstantDuree","","http://BIATSI/SI_SERVICES/Credit");
- SOAPElement Montant_de_la_tranche = Remboursement_Constant_Duree.addChildElement("Montant_de_la_tranche","","http://BIATSI/SI_SERVICES/Credit");
- Montant_de_la_tranche.addTextNode(Simulation_Param.Get_Montant_de_la_tranche());
- SOAPElement Duree = Remboursement_Constant_Duree.addChildElement("Duree","","http://BIATSI/SI_SERVICES/Credit");
- Duree.addTextNode(Simulation_Param.Get_Duree());
- SOAPElement Taux = Remboursement_Constant_Duree.addChildElement("Taux","","http://BIATSI/SI_SERVICES/Credit");
- Taux.addTextNode(Simulation_Param.Get_Taux());
- SOAPElement Periodicite= Remboursement_Constant_Duree.addChildElement("Periodicite","","http://BIATSI/SI_SERVICES/Credit");
- Periodicite.addTextNode(Simulation_Param.Get_Periodicite());
- SOAPElement DateDeblocage = Remboursement_Constant_Duree.addChildElement("DateDeblocage","","http://BIATSI/SI_SERVICES/Credit");
- DateDeblocage.addTextNode(Simulation_Param.Get_DateDeblocage());
- SOAPElement PremiereEcheance = Remboursement_Constant_Duree.addChildElement("PremiereEcheance","","http://BIATSI/SI_SERVICES/Credit");
- PremiereEcheance.addTextNode(Simulation_Param.Get_PremiereEcheance());
- MimeHeaders headers = Soap_Message.getMimeHeaders();
- headers.addHeader("SOAPAction", serverURI + "RemboursementConstantDuree");
- Soap_Message.saveChanges();
- Web_Service Web_Service_Caller=new Web_Service(Soap_Message);
- String json=new Gson().toJson(Web_Service_Caller.Get_Web_Service_Response_List());
- return json;
- }
- catch (SOAPException | JsonSyntaxException | NullPointerException e)
- {
- e.printStackTrace();
- return "Application internal Error";
- }
- }
- private String Remove_Server_Response_Header(String Server_Response)
- {
- int i=0;
- int j=0;
- while(j!=2)
- {
- if(Server_Response.charAt(i)==44)
- {
- j++;
- }
- i++;
- }
- Server_Response=Server_Response.substring(i-1,Server_Response.length());
- return Server_Response;
- }
- private List<String> Put_Server_Response_Into_List(String Server_Response)
- {
- int i=0;
- List<String>Request_Resualt_List=new ArrayList<String>();
- String[] Tokens=Remove_Server_Response_Header(Server_Response).split(",\"");
- for (String One_Line : Tokens)
- {
- if(i>0)
- {
- One_Line="\""+One_Line;
- Request_Resualt_List.add(One_Line);
- }
- i++;
- }
- return Request_Resualt_List;
- }
- }
- ---------------------------------------------------------------------------------------------------------------------------------------------
- package com.Utility.BIATNET_V1;
- import java.rmi.RemoteException;
- import java.util.ArrayList;
- import java.util.Iterator;
- import java.util.List;
- import java.util.NoSuchElementException;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- import com.Models.BIATNET_V1.Account;
- import com.Models.BIATNET_V1.Card;
- import com.Models.BIATNET_V1.Check_Book;
- import com.Models.BIATNET_V1.Customer;
- import com.Models.BIATNET_V1.Transfer_History;
- public class User_Information_Parser
- {
- private Customer Current_Customer;
- public User_Information_Parser(List<String> Server_Response)
- {
- Current_Customer=new Customer();
- Create_Customer(Server_Response);
- }
- private String Remove_Server_Response_Header(String Server_Response)
- {
- try
- {
- int i=0;
- int j=0;
- while(j!=2)
- {
- if(Server_Response.charAt(i)==44)
- {
- j++;
- }
- i++;
- }
- Server_Response=Server_Response.substring(i-1,Server_Response.length());
- return Server_Response;
- }
- catch (NoSuchElementException e)
- {
- return null;
- }
- }
- private List<String> Put_Server_Response_Into_List(String Server_Response)
- {
- try
- {
- int i=0;
- List<String>Request_Resualt_List=new ArrayList<String>();
- String[] Tokens=Remove_Server_Response_Header(Server_Response).split(",\"");
- for (String One_Line : Tokens)
- {
- if(i>0)
- {
- One_Line="\""+One_Line;
- Request_Resualt_List.add(One_Line);
- }
- i++;
- }
- return Request_Resualt_List;
- }
- catch (NoSuchElementException e)
- {
- return null;
- }
- }
- private Customer Create_Customer(List<String> Server_Response)
- {
- List<Account> Current_Customer_Accounts=new ArrayList<Account>();
- try
- {
- Account Current_Account;
- int i=0;
- Iterator<String> Cleaned_Server_Response_Iterator=Server_Response.iterator();
- while(Cleaned_Server_Response_Iterator.hasNext())
- {
- if(i==0)
- {
- Current_Account=new Account();
- String Current_Server_Response_Line=Cleaned_Server_Response_Iterator.next();
- Iterator<String> Individual_Data_Iterator=Extract_Individual_Data(Current_Server_Response_Line).iterator();
- Current_Customer.Set_ID(Individual_Data_Iterator.next().trim());
- Current_Customer.Set_Phone_Number(Individual_Data_Iterator.next().trim());
- Current_Account.Set_Identifier(Individual_Data_Iterator.next().trim());
- Current_Account=Extract_Account_Balance(Current_Account);
- Current_Account.Set_Check_Books(Extract_Check_Book_History(Current_Account.Get_Identifier()));
- Current_Customer.Set_Status(Individual_Data_Iterator.next().trim());
- Current_Customer.Set_Password(Individual_Data_Iterator.next().trim());
- Current_Customer.Set_Full_Name(Individual_Data_Iterator.next().trim());
- Current_Account.Set_Fonction(Individual_Data_Iterator.next().trim());
- Current_Customer.Set_Unknown_ID(Individual_Data_Iterator.next().trim());
- Current_Customer.Set_Cards(Extract_Customer_Cards_List(Current_Customer.Get_Unknown_ID()));
- Current_Account.Set_Account_CTOS(Individual_Data_Iterator.next().trim());
- String Options=Individual_Data_Iterator.next().trim();
- Current_Customer.Set_Transfers_History(Extract_Transfer_History_Data(Current_Customer.Get_Unknown_ID()));
- if(Options.indexOf("2") >= 0)
- {
- Current_Customer.Set_Virement(1);
- }
- else
- {
- Current_Customer.Set_Virement(0);
- }
- if(Options.indexOf("1") >= 0)
- {
- Current_Customer.Set_Download(1);
- }
- else
- {
- Current_Customer.Set_Download(0);
- }
- Current_Account.Set_Owner(Individual_Data_Iterator.next().trim());
- Current_Customer_Accounts.add(Current_Account);
- i++;
- }
- else
- {
- Current_Account=new Account();
- String Current_Server_Response_Line=Cleaned_Server_Response_Iterator.next();
- Iterator<String> Individual_Data_Iterator=Extract_Individual_Data(Current_Server_Response_Line).iterator();
- Individual_Data_Iterator.next();
- Individual_Data_Iterator.next();
- Current_Account.Set_Identifier(Individual_Data_Iterator.next().trim());
- Current_Account=Extract_Account_Balance(Current_Account);
- Current_Account.Set_Check_Books(Extract_Check_Book_History(Current_Account.Get_Identifier()));
- Individual_Data_Iterator.next();
- Individual_Data_Iterator.next();
- Individual_Data_Iterator.next();
- Current_Account.Set_Fonction(Individual_Data_Iterator.next().trim());
- Individual_Data_Iterator.next();
- Current_Account.Set_Account_CTOS(Individual_Data_Iterator.next().trim());
- Individual_Data_Iterator.next();
- Current_Account.Set_Owner(Individual_Data_Iterator.next().trim());
- Current_Customer_Accounts.add(Current_Account);
- }
- }
- Current_Customer.Set_Accounts(Current_Customer_Accounts);
- return Current_Customer;
- } catch (NoSuchElementException e)
- {
- return null;
- }
- }
- private List<String> Extract_Individual_Data(String Current_Line)
- {
- try {
- Matcher matcher=null;
- ArrayList<String> Individual_Data = new ArrayList<>();
- Pattern regex = Pattern.compile("\"([^\"]*)\"");
- matcher = regex.matcher(Current_Line);
- try
- {
- while(matcher.find())
- {
- Individual_Data.add(matcher.group(1));
- }
- }
- catch(NullPointerException ex)
- {
- System.out.println("Empty String");
- }
- return Individual_Data;
- } catch (NoSuchElementException e)
- {
- return null;
- }
- }
- private Account Extract_Account_Balance(Account Current_Account)
- {
- Account Current_Account1;
- Current_Account1=Current_Account;
- InvocationSingleton Invocation=new InvocationSingleton();
- String Request_Response=null;
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Request_Response = Invocation.getSoldeComptes(Current_Account1.Get_Identifier());
- Iterator<String> Balance_Server_Response_Iterator=Put_Server_Response_Into_List(Request_Response).iterator();
- Iterator<String> Current_Balance_Iterator=Extract_Individual_Data(Balance_Server_Response_Iterator.next()).iterator();
- Current_Balance_Iterator.next();
- Current_Balance_Iterator.next();
- Current_Account1.Set_Last_Operation_Date(Current_Balance_Iterator.next().trim());
- Current_Account1.Set_Countable_Balance(Current_Balance_Iterator.next().trim());
- Current_Account1.Set_Available_Balance(Current_Balance_Iterator.next().trim());
- Current_Account1.Set_Devise(Current_Balance_Iterator.next().trim());
- return Current_Account1;
- }
- catch (RemoteException | NoSuchElementException e)
- {
- e.printStackTrace();
- return null;
- }
- }
- private List<Check_Book> Extract_Check_Book_History(String Identifier)
- {
- List<Check_Book> Current_Account_Check_Book_List=new ArrayList<Check_Book>();
- Check_Book Current_Check_Book;
- InvocationSingleton Invocation=new InvocationSingleton();
- String Request_Response=null;
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Request_Response=Invocation.SuiviCommandeChequier(Identifier);
- Iterator<String> Request_Response_Iterator=Put_Server_Response_Into_List(Request_Response).iterator();
- while(Request_Response_Iterator.hasNext())
- {
- Current_Check_Book=new Check_Book();
- String Current_Line=Request_Response_Iterator.next();
- List<String> Current_Data=Extract_Individual_Data(Current_Line);
- if(Current_Data.size()==1)
- {
- Current_Check_Book.Set_Status("Aucune demande en cours");
- }
- else
- {
- Iterator<String> Current_Data_Iterator=Current_Data.iterator();
- Current_Check_Book.Set_ID(Current_Data_Iterator.next().trim());
- Current_Data_Iterator.next();
- Current_Check_Book.Set_Date_Request(Current_Data_Iterator.next().trim());
- Current_Check_Book.Set_Number_Of_Pages(Integer.parseInt(Current_Data_Iterator.next().trim()));
- Current_Check_Book.Set_Barred(Current_Data_Iterator.next().trim());
- Current_Check_Book.Set_Status(Current_Data_Iterator.next().trim());
- }
- Current_Account_Check_Book_List.add(Current_Check_Book);
- }
- return Current_Account_Check_Book_List;
- }
- catch(RemoteException | NoSuchElementException e)
- {
- e.printStackTrace();
- return null;
- }
- }
- private List<Card> Extract_Customer_Cards_List(String Unknown_ID)
- {
- InvocationSingleton Invocation=new InvocationSingleton();
- List<Card> Current_Customuer_Cards_List=new ArrayList<Card>();
- Card Current_Card;
- String Request_Response=null;
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Request_Response=Invocation.getListecartes(Unknown_ID);
- Iterator<String> Request_Response_Iterator=Put_Server_Response_Into_List(Request_Response).iterator();
- //Iterator<String> Request_Response_Iterator=Put_Server_Response_Into_List(List_Carte_Server_Response).iterator();
- while(Request_Response_Iterator.hasNext())
- {
- try
- {
- Current_Card=new Card();
- Iterator<String> Current_Card_Data_Iterator=Extract_Individual_Data(Request_Response_Iterator.next()).iterator();
- Current_Card.Set_Number(Current_Card_Data_Iterator.next().trim());
- Current_Card.Set_Owner(Current_Card_Data_Iterator.next().trim());
- Current_Card.Set_Type(Current_Card_Data_Iterator.next().trim());
- Current_Card.Set_ID_Cout(Current_Card_Data_Iterator.next().trim());
- Current_Customuer_Cards_List.add(Current_Card);
- }
- catch (NoSuchElementException e)
- {
- Current_Card=new Card();
- }
- }
- return Current_Customuer_Cards_List;
- }
- catch(RemoteException | NoSuchElementException e)
- {
- e.printStackTrace();
- return null;
- }
- }
- private List<Transfer_History> Extract_Transfer_History_Data(String Unknown_ID)
- {
- InvocationSingleton Invocation;
- Invocation=new InvocationSingleton();
- try
- {
- Invocation.getOfsUserInfos("CHQ");
- Transfer_History_Parser Parser=new Transfer_History_Parser(Put_Server_Response_Into_List(Invocation.SuiviVirements(Unknown_ID)));
- return Parser.Get_Transfer_History_List();
- }
- catch (RemoteException e) {
- e.printStackTrace();
- return null;
- }
- }
- public Customer Get_Gustomer()
- {
- return Current_Customer;
- }
- }
- ---------------------------------------------------------------------------------------------------------------
- package com.Models.BIATNET_V1;
- import java.util.ArrayList;
- import java.util.List;
- public class Customer
- {
- private String ID,Unknown_ID,Phone_Number,status,Password,Full_Name;
- private int Virement,Download;
- private List<Account> Accounts=new ArrayList<Account>();
- private List<Card> Cards=new ArrayList<Card>();
- private List<Transfer_History> Transfers_History=new ArrayList<Transfer_History>();
- public String Get_ID() {
- return ID;
- }
- public void Set_ID(String ID) {
- this.ID = ID;
- }
- public String Get_Unknown_ID() {
- return Unknown_ID;
- }
- public void Set_Unknown_ID(String Unknown_ID) {
- this.Unknown_ID = Unknown_ID;
- }
- public String Get_Phone_Number() {
- return Phone_Number;
- }
- public void Set_Phone_Number(String Phone_Number) {
- this.Phone_Number = Phone_Number;
- }
- public String Get_Status() {
- return status;
- }
- public void Set_Status(String status) {
- this.status = status;
- }
- public String Get_Password() {
- return Password;
- }
- public void Set_Password(String Password) {
- this.Password = Password;
- }
- public String Get_Full_Name() {
- return Full_Name;
- }
- public void Set_Full_Name(String Full_Name) {
- this.Full_Name = Full_Name;
- }
- public int Get_Virement() {
- return Virement;
- }
- public void Set_Virement(int Virement) {
- this.Virement = Virement;
- }
- public int Get_Download() {
- return Download;
- }
- public void Set_Download(int Download) {
- this.Download = Download;
- }
- public List<Account> Get_Accounts() {
- return Accounts;
- }
- public void Set_Accounts(List<Account> Accounts) {
- this.Accounts = Accounts;
- }
- public List<Card> Get_Cards() {
- return Cards;
- }
- public void Set_Cards(List<Card> Cards) {
- this.Cards = Cards;
- }
- public void Set_Transfers_History(List<Transfer_History> Transfers_History)
- {
- this.Transfers_History=Transfers_History;
- }
- public List<Transfer_History> Get_Transfers_History()
- {
- return this.Transfers_History;
- }
- @Override
- public String toString() {
- return "Customer [ID=" + ID + ", Unknown_ID=" + Unknown_ID + ", Phone_Number=" + Phone_Number + ", status="
- + status + ", Password=" + Password + ", Full_Name=" + Full_Name + ", Virement=" + Virement
- + ", Download=" + Download + ", Accounts=" + Accounts + ", Cards=" + Cards + "]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement