@Test(expected = ORecordDuplicatedException.class) public void whenUsingDuplicateNameShouldNotBeCreated() throws Exception { underTest.add(item); underTest.add( new OrientCleanupPolicy(item.getName(), "abcd", "OtherFormat", "OtherMode", newHashMap())); }
@Override @Guarded(by = STARTED) public CleanupPolicy add(final CleanupPolicy item) { checkEntityType(item); return inTxRetry(databaseInstance) .call(db -> entityAdapter.readEntity(entityAdapter.addEntity(db, (OrientCleanupPolicy) item))); }
OrientCleanupPolicyStorage extends StateGuardLifecycleSupport implements CleanupPolicyStorage { @Override @Guarded(by = STARTED) public CleanupPolicy add(final CleanupPolicy item) { checkEntityType(item); return inTxRetry(databaseInstance) .call(db -> entityAdapter.readEntity(entityAdapter.addEntity(db, (OrientCleanupPolicy) item))); } }
OrientCleanupPolicyStorage extends StateGuardLifecycleSupport implements CleanupPolicyStorage { @Override @Guarded(by = STARTED) public CleanupPolicy add(final CleanupPolicy item) { checkEntityType(item); return inTxRetry(databaseInstance) .call(db -> entityAdapter.readEntity(entityAdapter.addEntity(db, (OrientCleanupPolicy) item))); } @Inject  OrientCleanupPolicyStorage(
      @Named(DatabaseInstanceNames.CONFIG) final Provider<DatabaseInstance> databaseInstance,
      final OrientCleanupPolicyEntityAdapter entityAdapter); }
OrientCleanupPolicyStorage extends StateGuardLifecycleSupport implements CleanupPolicyStorage { @Override @Guarded(by = STARTED) public CleanupPolicy add(final CleanupPolicy item) { checkEntityType(item); return inTxRetry(databaseInstance) .call(db -> entityAdapter.readEntity(entityAdapter.addEntity(db, (OrientCleanupPolicy) item))); } @Inject  OrientCleanupPolicyStorage(
      @Named(DatabaseInstanceNames.CONFIG) final Provider<DatabaseInstance> databaseInstance,
      final OrientCleanupPolicyEntityAdapter entityAdapter); @Override @Guarded(by = STARTED) long count(); @Override @Guarded(by = STARTED) CleanupPolicy add(final CleanupPolicy item); @Override @Guarded(by = STARTED) CleanupPolicy update(final CleanupPolicy cleanupPolicy); @Override @Guarded(by = STARTED) void remove(final CleanupPolicy cleanupPolicy); @Override @Guarded(by = STARTED) CleanupPolicy get(final String cleanupPolicyName); @Override @Guarded(by = STARTED) List<CleanupPolicy> getAll(); @Override @Guarded(by = STARTED) boolean exists(final String cleanupPolicyName); @Override List<CleanupPolicy> getAllByFormat(final String format); @Override CleanupPolicy newCleanupPolicy(); }
OrientCleanupPolicyStorage extends StateGuardLifecycleSupport implements CleanupPolicyStorage { @Override @Guarded(by = STARTED) public CleanupPolicy add(final CleanupPolicy item) { checkEntityType(item); return inTxRetry(databaseInstance) .call(db -> entityAdapter.readEntity(entityAdapter.addEntity(db, (OrientCleanupPolicy) item))); } @Inject  OrientCleanupPolicyStorage(
      @Named(DatabaseInstanceNames.CONFIG) final Provider<DatabaseInstance> databaseInstance,
      final OrientCleanupPolicyEntityAdapter entityAdapter); @Override @Guarded(by = STARTED) long count(); @Override @Guarded(by = STARTED) CleanupPolicy add(final CleanupPolicy item); @Override @Guarded(by = STARTED) CleanupPolicy update(final CleanupPolicy cleanupPolicy); @Override @Guarded(by = STARTED) void remove(final CleanupPolicy cleanupPolicy); @Override @Guarded(by = STARTED) CleanupPolicy get(final String cleanupPolicyName); @Override @Guarded(by = STARTED) List<CleanupPolicy> getAll(); @Override @Guarded(by = STARTED) boolean exists(final String cleanupPolicyName); @Override List<CleanupPolicy> getAllByFormat(final String format); @Override CleanupPolicy newCleanupPolicy();  }