@Test public void testGetAllNotes() throws IOException { List<NoteInfo> notebooks = repo.list(auth); assertThat(notebooks).isNotEmpty(); assertThat(notebooks.size()).isEqualTo(3); }
@Override public List<NoteInfo> list(AuthenticationInfo subject) throws IOException { if (!isSubjectValid(subject)) { return Collections.emptyList(); } String token = getUserToken(subject.getUser()); String response = restApiClient.get(token, StringUtils.EMPTY); List<NoteInfo> notes = GSON.fromJson(response, new TypeToken<List<NoteInfo>>() {}.getType()); if (notes == null) { return Collections.emptyList(); } LOG.info("ZeppelinHub REST API listing notes "); return notes; }
ZeppelinHubRepo implements NotebookRepo { @Override public List<NoteInfo> list(AuthenticationInfo subject) throws IOException { if (!isSubjectValid(subject)) { return Collections.emptyList(); } String token = getUserToken(subject.getUser()); String response = restApiClient.get(token, StringUtils.EMPTY); List<NoteInfo> notes = GSON.fromJson(response, new TypeToken<List<NoteInfo>>() {}.getType()); if (notes == null) { return Collections.emptyList(); } LOG.info("ZeppelinHub REST API listing notes "); return notes; } }
ZeppelinHubRepo implements NotebookRepo { @Override public List<NoteInfo> list(AuthenticationInfo subject) throws IOException { if (!isSubjectValid(subject)) { return Collections.emptyList(); } String token = getUserToken(subject.getUser()); String response = restApiClient.get(token, StringUtils.EMPTY); List<NoteInfo> notes = GSON.fromJson(response, new TypeToken<List<NoteInfo>>() {}.getType()); if (notes == null) { return Collections.emptyList(); } LOG.info("ZeppelinHub REST API listing notes "); return notes; } ZeppelinHubRepo(ZeppelinConfiguration conf); }
ZeppelinHubRepo implements NotebookRepo { @Override public List<NoteInfo> list(AuthenticationInfo subject) throws IOException { if (!isSubjectValid(subject)) { return Collections.emptyList(); } String token = getUserToken(subject.getUser()); String response = restApiClient.get(token, StringUtils.EMPTY); List<NoteInfo> notes = GSON.fromJson(response, new TypeToken<List<NoteInfo>>() {}.getType()); if (notes == null) { return Collections.emptyList(); } LOG.info("ZeppelinHub REST API listing notes "); return notes; } ZeppelinHubRepo(ZeppelinConfiguration conf); @Override List<NoteInfo> list(AuthenticationInfo subject); @Override Note get(String noteId, AuthenticationInfo subject); @Override void save(Note note, AuthenticationInfo subject); @Override void remove(String noteId, AuthenticationInfo subject); @Override void close(); @Override Revision checkpoint(String noteId, String checkpointMsg, AuthenticationInfo subject); @Override Note get(String noteId, String revId, AuthenticationInfo subject); @Override List<Revision> revisionHistory(String noteId, AuthenticationInfo subject); @Override List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject); @Override void updateSettings(Map<String, String> settings, AuthenticationInfo subject); @Override Note setNoteRevision(String noteId, String revId, AuthenticationInfo subject); }
ZeppelinHubRepo implements NotebookRepo { @Override public List<NoteInfo> list(AuthenticationInfo subject) throws IOException { if (!isSubjectValid(subject)) { return Collections.emptyList(); } String token = getUserToken(subject.getUser()); String response = restApiClient.get(token, StringUtils.EMPTY); List<NoteInfo> notes = GSON.fromJson(response, new TypeToken<List<NoteInfo>>() {}.getType()); if (notes == null) { return Collections.emptyList(); } LOG.info("ZeppelinHub REST API listing notes "); return notes; } ZeppelinHubRepo(ZeppelinConfiguration conf); @Override List<NoteInfo> list(AuthenticationInfo subject); @Override Note get(String noteId, AuthenticationInfo subject); @Override void save(Note note, AuthenticationInfo subject); @Override void remove(String noteId, AuthenticationInfo subject); @Override void close(); @Override Revision checkpoint(String noteId, String checkpointMsg, AuthenticationInfo subject); @Override Note get(String noteId, String revId, AuthenticationInfo subject); @Override List<Revision> revisionHistory(String noteId, AuthenticationInfo subject); @Override List<NotebookRepoSettingsInfo> getSettings(AuthenticationInfo subject); @Override void updateSettings(Map<String, String> settings, AuthenticationInfo subject); @Override Note setNoteRevision(String noteId, String revId, AuthenticationInfo subject); static final String TOKEN_HEADER; }