@Test(expected = AuthorizationUnavailableException.class) public void deleteVreAuthorizationThrowsAnAuthorizationUnavailableExceptionWhenTheFileIsUnavailable() throws Exception { instance.deleteVreAuthorizations("nonExisting"); }
@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; }