Package org.infotechservice.smartcard.service

Examples of org.infotechservice.smartcard.service.SmartCardServer


    private static int getFile(int file) {
        return (byte)((file << 3) | 4);
    }

    public static void seviceTest() throws Exception {
        SmartCardServer service = new SmartCardServer();
        service.addCardListener(new NewSocialCardListener() {
            @Override
            public void onCardInsert(SmartCard smartcard) {
                NewSocialCardService service;
                try {
                    service = new NewSocialCardService(smartcard);
                    System.out.println("New social cart inserted :"
                            + "\n F.I.O.: "  + service.getFIO()
                            + "\n Sex: "  + service.getSex()
                            + "\n Address: "  + service.getAddress()
                            + "\n Birthday: "  + service.getBirthDay()
                            + "\n Serial: "  + service.getSerial()
                            + "\n SNILS: "  + service.getSnils()
                            + "\n INN: "  + service.getInn());
                    for(int i=0; i<12; i++) {
                        Excemption exc = service.getExcemption(i);
                        if(exc == null) {
                            continue;
                        }
                        System.out.println(" excemption " + i
                                + ": type:" + exc.type
                                + ", begin:" + exc.begin
                                + ", end:" + exc.end);
                    }
                    System.out.println("card end ");
                } catch (CardException ex) {
                    System.out.println("New Social read error :"  + ex.getMessage());
                }
            }
        });

        service.addCardListener(new OldSocialCardListener() {
            @Override
            public void onCardInsert(SmartCard smartcard) {
                OldSocialCardService service = new OldSocialCardService(smartcard);
                try {
                    System.out.println("Old Social cart inserted :"  + service.readID());
                } catch (CardException ex) {
                    System.out.println("Old Social read error :"  + ex.getMessage());
                }
            }
        });

        service.start();
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            System.out.println("Нажмите 0 для выхода");
            String ln = input.readLine();
            if (ln == null || ln.equals("0")) {
                break;
            }
        }
        service.stop();
    }
View Full Code Here


    SessionSecurityDetails det = UserInfo.tryLoginByCard(id);
    user = initUser(det);
    doClose(ModalDialog.DLG_OK);
    }*/
    private void processCurrentSocialCard() {
        SmartCardServer service = DialogLogin.this.main.getSmartCardService();
        service.addCardListener(socialCard);
//        service.addCardListener(new NewSocialCardListener() {
//
//            @Override
//            public void onCardInsert(SmartCard smartcard) throws CardException {
//                NewSocialCardService service = new NewSocialCardService(smartcard);
View Full Code Here

TOP

Related Classes of org.infotechservice.smartcard.service.SmartCardServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.