Compare commits

...

1 Commits

Author SHA1 Message Date
hcyi
66efe6b15e feat(TUP-21495):Support MFA on studio for the Cloud. 2019-02-25 16:37:30 +08:00
2 changed files with 32 additions and 0 deletions

View File

@@ -44,6 +44,8 @@ public class RepositoryContext {
private Map<String, String> fields;
private boolean token = false;
/**
* DOC smallet RepositoryContext constructor comment.
*
@@ -246,4 +248,12 @@ public class RepositoryContext {
public void setNoUpdateWhenLogon(boolean noUpdateWhenLogon) {
this.noUpdateWhenLogon = noUpdateWhenLogon;
}
public boolean isToken() {
return this.token;
}
public void setToken(boolean token) {
this.token = token;
}
}

View File

@@ -54,6 +54,8 @@ public class ConnectionBean implements Cloneable {
private Map<String, String> dynamicFields = new HashMap<String, String>();
private static final String TOKEN = "token"; //$NON-NLS-1$
/**
* DOC smallet ConnectionBean constructor comment.
*/
@@ -281,6 +283,25 @@ public class ConnectionBean implements Cloneable {
}
}
public boolean isToken() {
try {
if (conDetails.has(TOKEN)) {
return (Boolean) conDetails.get(TOKEN);
}
} catch (JSONException e) {
ExceptionHandler.process(e);
}
return false;
}
public void setToken(boolean token) {
try {
conDetails.put(TOKEN, token);
} catch (JSONException e) {
ExceptionHandler.process(e);
}
}
@Override
public ConnectionBean clone() throws CloneNotSupportedException {
return writeFromJSON(this.getConDetails());
@@ -303,6 +324,7 @@ public class ConnectionBean implements Cloneable {
toReturn.setPassword(st[i++]);
toReturn.setWorkSpace(st[i++]);
toReturn.setComplete(new Boolean(st[i++]));
toReturn.setToken(new Boolean(st[i++]));
JSONObject dynamicJson = new JSONObject();
toReturn.getConDetails().put(DYNAMICFIELDS, dynamicJson);
while (i < st.length) {