@Test public void deleteVreAuthorizationsDeletesTheVreAuthorizationsFile() throws Exception { instance.deleteVreAuthorizations(VRE); assertThat(new File(authorizationsFolder.resolve(AUTH_FILE).toString()).exists(), equalTo(false)); }
@Override public void deleteVreAuthorizations(String vreId) throws AuthorizationUnavailableException { synchronized (authorizationsFolder) { if (!getFileOfVre(vreId).delete()) { throw new AuthorizationUnavailableException("Failed to delete vre authorizations for vre '" + vreId + "'"); } } }
LocalFileVreAuthorizationAccess implements VreAuthorizationAccess { @Override public void deleteVreAuthorizations(String vreId) throws AuthorizationUnavailableException { synchronized (authorizationsFolder) { if (!getFileOfVre(vreId).delete()) { throw new AuthorizationUnavailableException("Failed to delete vre authorizations for vre '" + vreId + "'"); } } } }
LocalFileVreAuthorizationAccess implements VreAuthorizationAccess { @Override public void deleteVreAuthorizations(String vreId) throws AuthorizationUnavailableException { synchronized (authorizationsFolder) { if (!getFileOfVre(vreId).delete()) { throw new AuthorizationUnavailableException("Failed to delete vre authorizations for vre '" + vreId + "'"); } } } LocalFileVreAuthorizationAccess(Path authorizationsFolder); }
LocalFileVreAuthorizationAccess implements VreAuthorizationAccess { @Override public void deleteVreAuthorizations(String vreId) throws AuthorizationUnavailableException { synchronized (authorizationsFolder) { if (!getFileOfVre(vreId).delete()) { throw new AuthorizationUnavailableException("Failed to delete vre authorizations for vre '" + vreId + "'"); } } } LocalFileVreAuthorizationAccess(Path authorizationsFolder); @Override VreAuthorization getOrCreateAuthorization(String vreId, String userId, String userRole); @Override Optional<VreAuthorization> getAuthorization(String vreId, String userId); @Override void deleteVreAuthorizations(String vreId); }
LocalFileVreAuthorizationAccess implements VreAuthorizationAccess { @Override public void deleteVreAuthorizations(String vreId) throws AuthorizationUnavailableException { synchronized (authorizationsFolder) { if (!getFileOfVre(vreId).delete()) { throw new AuthorizationUnavailableException("Failed to delete vre authorizations for vre '" + vreId + "'"); } } } LocalFileVreAuthorizationAccess(Path authorizationsFolder); @Override VreAuthorization getOrCreateAuthorization(String vreId, String userId, String userRole); @Override Optional<VreAuthorization> getAuthorization(String vreId, String userId); @Override void deleteVreAuthorizations(String vreId); static final Logger LOG; }