@Test public void testRemoveARC() throws Exception { try{ storage.removeARC(arcFile1); fail(); } catch(Exception e){ } storage.addARC(arcFile1); ArcVO arc = storage.getArcByID("arcfile1"); assertEquals(arcFile1, arc.getFileName()); storage.removeARC("arcfile1"); try{ arc = storage.getArcByID("arcfile1"); fail(); } catch(Exception e){ } }
public void removeARC(String arcID) throws Exception{ PreparedStatement stmt = null; try { boolean aRCIDExist = aRCIDExist(arcID); if (!aRCIDExist){ throw new IllegalArgumentException("ArcID does not exist:"+arcID); } stmt = connection.prepareStatement(deleteArcByIDQuery); stmt.setString(1, arcID); int updated = stmt.executeUpdate(); if (updated == 0){ throw new IllegalArgumentException("Arcfile not found with id:"+arcID); } } catch (Exception e) { log.error("SQL Exception in removeARC:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } }
ArchonStorage { public void removeARC(String arcID) throws Exception{ PreparedStatement stmt = null; try { boolean aRCIDExist = aRCIDExist(arcID); if (!aRCIDExist){ throw new IllegalArgumentException("ArcID does not exist:"+arcID); } stmt = connection.prepareStatement(deleteArcByIDQuery); stmt.setString(1, arcID); int updated = stmt.executeUpdate(); if (updated == 0){ throw new IllegalArgumentException("Arcfile not found with id:"+arcID); } } catch (Exception e) { log.error("SQL Exception in removeARC:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } }
ArchonStorage { public void removeARC(String arcID) throws Exception{ PreparedStatement stmt = null; try { boolean aRCIDExist = aRCIDExist(arcID); if (!aRCIDExist){ throw new IllegalArgumentException("ArcID does not exist:"+arcID); } stmt = connection.prepareStatement(deleteArcByIDQuery); stmt.setString(1, arcID); int updated = stmt.executeUpdate(); if (updated == 0){ throw new IllegalArgumentException("Arcfile not found with id:"+arcID); } } catch (Exception e) { log.error("SQL Exception in removeARC:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } ArchonStorage(); }
ArchonStorage { public void removeARC(String arcID) throws Exception{ PreparedStatement stmt = null; try { boolean aRCIDExist = aRCIDExist(arcID); if (!aRCIDExist){ throw new IllegalArgumentException("ArcID does not exist:"+arcID); } stmt = connection.prepareStatement(deleteArcByIDQuery); stmt.setString(1, arcID); int updated = stmt.executeUpdate(); if (updated == 0){ throw new IllegalArgumentException("Arcfile not found with id:"+arcID); } } catch (Exception e) { log.error("SQL Exception in removeARC:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } ArchonStorage(); static void initialize(String driverName, String driverUrl, String userName, String password); int nextShardId(); void addARC(String arcPath); void addOrUpdateARC(String arcPath); List<String> getShardIDs(); String nextARC(String shardID); List<String> getARCFiles(String shardID); ArcVO getArcByID(String arcID); int getArcCount(); List<ArcVO> getLatest1000Arcs(); List<ArcVO> getAllRunningArcs(); void setARCState(String arcPath, ArchonConnector.ARC_STATE arcState); void setShardState(String shardID, ArchonConnector.ARC_STATE state, int priority); void setARCProperties(String fullPath, String shardID,ArchonConnector.ARC_STATE state, int priority); void setARCPriority(String fullPath, int priority); void resetArcWithPriorityStatement(String fullPath, int priority); void removeARC(String arcID); void clearIndexing(String shardID); void resetShardId(String shardID); void commit(); void rollback(); void close(); static void shutdown(); }
ArchonStorage { public void removeARC(String arcID) throws Exception{ PreparedStatement stmt = null; try { boolean aRCIDExist = aRCIDExist(arcID); if (!aRCIDExist){ throw new IllegalArgumentException("ArcID does not exist:"+arcID); } stmt = connection.prepareStatement(deleteArcByIDQuery); stmt.setString(1, arcID); int updated = stmt.executeUpdate(); if (updated == 0){ throw new IllegalArgumentException("Arcfile not found with id:"+arcID); } } catch (Exception e) { log.error("SQL Exception in removeARC:" + e.getMessage()); throw e; } finally { closeStatement(stmt); } } ArchonStorage(); static void initialize(String driverName, String driverUrl, String userName, String password); int nextShardId(); void addARC(String arcPath); void addOrUpdateARC(String arcPath); List<String> getShardIDs(); String nextARC(String shardID); List<String> getARCFiles(String shardID); ArcVO getArcByID(String arcID); int getArcCount(); List<ArcVO> getLatest1000Arcs(); List<ArcVO> getAllRunningArcs(); void setARCState(String arcPath, ArchonConnector.ARC_STATE arcState); void setShardState(String shardID, ArchonConnector.ARC_STATE state, int priority); void setARCProperties(String fullPath, String shardID,ArchonConnector.ARC_STATE state, int priority); void setARCPriority(String fullPath, int priority); void resetArcWithPriorityStatement(String fullPath, int priority); void removeARC(String arcID); void clearIndexing(String shardID); void resetShardId(String shardID); void commit(); void rollback(); void close(); static void shutdown(); static Date INITDATE; }