(boolean restore)
| 65 | private ExecutorService executor; |
| 66 | |
| 67 | private Packets(boolean restore) throws Exception { |
| 68 | database = Database.getInstance(); |
| 69 | database.addPropertyChangeListener(this); |
| 70 | if (!restore) { |
| 71 | |
| 72 | log("drop history..."); |
| 73 | database.dropPacketTableFaster(); |
| 74 | } |
| 75 | dao = database.createTable(Packet.class); |
| 76 | if (restore) { |
| 77 | |
| 78 | if (!isLatestVersion()) { |
| 79 | |
| 80 | RecreateTable(); |
| 81 | } |
| 82 | log("load history..."); |
| 83 | log("load %d records.", dao.countOf()); |
| 84 | } |
| 85 | executor = Executors.newSingleThreadExecutor(); |
| 86 | } |
| 87 | |
| 88 | // TODO できれば非同期でやる(大きいデータのときに数秒止まってしまうので) |
| 89 | public void create(Packet packet) throws Exception { |
nothing calls this directly
no test coverage detected