mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Add new methods in notebookRepo :: get and set settings in notebook
This commit is contained in:
parent
23912ceb71
commit
53346d7199
5 changed files with 76 additions and 0 deletions
|
|
@ -36,9 +36,11 @@ import org.slf4j.LoggerFactory;
|
|||
import java.io.*;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Azure storage backend for notebooks
|
||||
|
|
@ -227,4 +229,15 @@ public class AzureNotebookRepo implements NotebookRepo {
|
|||
// Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
LOG.warn("Method not implemented");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
|
||||
LOG.warn("Method not implemented");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ package org.apache.zeppelin.notebook.repo;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.zeppelin.annotation.ZeppelinApi;
|
||||
import org.apache.zeppelin.notebook.Note;
|
||||
|
|
@ -100,6 +101,22 @@ public interface NotebookRepo {
|
|||
*/
|
||||
@ZeppelinApi public List<Revision> revisionHistory(String noteId, AuthenticationInfo subject);
|
||||
|
||||
/**
|
||||
* Get NotebookRepo settings got the given user.
|
||||
*
|
||||
* @param subject
|
||||
* @return
|
||||
*/
|
||||
@ZeppelinApi public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject);
|
||||
|
||||
/**
|
||||
* update notebook repo settings.
|
||||
*
|
||||
* @param settings
|
||||
* @param subject
|
||||
*/
|
||||
@ZeppelinApi public void updateSettings(Map<String, String> settings, AuthenticationInfo subject);
|
||||
|
||||
/**
|
||||
* Represents the 'Revision' a point in life of the notebook
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -444,4 +444,24 @@ public class NotebookRepoSync implements NotebookRepo {
|
|||
}
|
||||
return revisions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
List<NotebookRepoSettings> repoSettings = Collections.emptyList();
|
||||
try {
|
||||
repoSettings = getRepo(0).getSettings(subject);
|
||||
} catch (IOException e) {
|
||||
LOG.error("Cannot get notebook repo settings", e);
|
||||
}
|
||||
return repoSettings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
|
||||
try {
|
||||
getRepo(0).updateSettings(settings, subject);
|
||||
} catch (IOException e) {
|
||||
LOG.error("Cannot update notebook repo settings", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.amazonaws.auth.AWSCredentialsProvider;
|
||||
import com.amazonaws.services.s3.AmazonS3EncryptionClient;
|
||||
|
|
@ -270,4 +272,15 @@ public class S3NotebookRepo implements NotebookRepo {
|
|||
// Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
LOG.warn("Method not implemented");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
|
||||
LOG.warn("Method not implemented");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,9 +23,11 @@ import java.io.InputStream;
|
|||
import java.io.OutputStream;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.vfs2.FileContent;
|
||||
|
|
@ -285,4 +287,15 @@ public class VFSNotebookRepo implements NotebookRepo {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NotebookRepoSettings> getSettings(AuthenticationInfo subject) {
|
||||
logger.warn("Method not implemented");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSettings(Map<String, String> settings, AuthenticationInfo subject) {
|
||||
logger.warn("Method not implemented");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue