use of org.apache.zeppelin.notebook.socket.Message in project zeppelin by apache.
the class NotebookServer method pushAngularObjectToLocalRepo.
private void pushAngularObjectToLocalRepo(String noteId, String paragraphId, String varName, Object varValue, AngularObjectRegistry registry, String interpreterGroupId, NotebookSocket conn) {
AngularObject angularObject = registry.get(varName, noteId, paragraphId);
if (angularObject == null) {
angularObject = registry.add(varName, varValue, noteId, paragraphId);
} else {
angularObject.set(varValue, true);
}
this.broadcastExcept(noteId, new Message(OP.ANGULAR_OBJECT_UPDATE).put("angularObject", angularObject).put("interpreterGroupId", interpreterGroupId).put("noteId", noteId).put("paragraphId", paragraphId), conn);
}
use of org.apache.zeppelin.notebook.socket.Message in project zeppelin by apache.
the class NotebookServer method getNoteByRevision.
private void getNoteByRevision(NotebookSocket conn, Notebook notebook, Message fromMessage) throws IOException {
String noteId = (String) fromMessage.get("noteId");
String revisionId = (String) fromMessage.get("revisionId");
AuthenticationInfo subject = new AuthenticationInfo(fromMessage.principal);
Note revisionNote = notebook.getNoteByRevision(noteId, revisionId, subject);
conn.send(serializeMessage(new Message(OP.NOTE_REVISION).put("noteId", noteId).put("revisionId", revisionId).put("note", revisionNote)));
}
use of org.apache.zeppelin.notebook.socket.Message in project zeppelin by apache.
the class NotebookServer method broadcastNoteListExcept.
private void broadcastNoteListExcept(List<Map<String, String>> notesInfo, AuthenticationInfo subject) {
Set<String> userAndRoles;
NotebookAuthorization authInfo = NotebookAuthorization.getInstance();
for (String user : userConnectedSockets.keySet()) {
if (subject.getUser().equals(user)) {
continue;
}
//reloaded already above; parameter - false
userAndRoles = authInfo.getRoles(user);
userAndRoles.add(user);
notesInfo = generateNotesInfo(false, new AuthenticationInfo(user), userAndRoles);
multicastToUser(user, new Message(OP.NOTES_INFO).put("notes", notesInfo));
}
}
use of org.apache.zeppelin.notebook.socket.Message in project zeppelin by apache.
the class NotebookServer method sendAllConfigurations.
private void sendAllConfigurations(NotebookSocket conn, HashSet<String> userAndRoles, Notebook notebook) throws IOException {
ZeppelinConfiguration conf = notebook.getConf();
Map<String, String> configurations = conf.dumpConfigurations(conf, new ZeppelinConfiguration.ConfigurationKeyPredicate() {
@Override
public boolean apply(String key) {
return !key.contains("password") && !key.equals(ZeppelinConfiguration.ConfVars.ZEPPELIN_NOTEBOOK_AZURE_CONNECTION_STRING.getVarName());
}
});
conn.send(serializeMessage(new Message(OP.CONFIGURATIONS_INFO).put("configurations", configurations)));
}
use of org.apache.zeppelin.notebook.socket.Message in project zeppelin by apache.
the class NotebookServer method getInterpreterBindings.
public void getInterpreterBindings(NotebookSocket conn, Message fromMessage) throws IOException {
String noteId = (String) fromMessage.data.get("noteId");
List<InterpreterSettingsList> settingList = InterpreterBindingUtils.getInterpreterBindings(notebook(), noteId);
conn.send(serializeMessage(new Message(OP.INTERPRETER_BINDINGS).put("interpreterBindings", settingList)));
}
Aggregations