Compare commits

...

2 Commits

Author SHA1 Message Date
Zhiwei Xue
aeb31c0e57 feat(TUP-41073):Block the update if studio is not compatible (#6710) (#6728)
* feat(TUP-41073):Block the update if studio is not compatible

* feat(TUP-41073):fix feature adapt and block commandline
2024-01-15 16:28:53 +08:00
bhe-talendbj
9c5e56f757 fix(TUP-41511): throw exception (#6722) 2024-01-12 14:35:29 +08:00
3 changed files with 20 additions and 2 deletions

View File

@@ -23,10 +23,19 @@ public class FatalException extends RuntimeException {
@SuppressWarnings("unused")//$NON-NLS-1$
private static final long serialVersionUID = 1L;
public static final int CODE_INCOMPATIBLE_UPDATE = 10;
private int code;
public FatalException(String message, Throwable cause) {
super(message, cause);
}
public FatalException(int code, String message) {
super(message);
this.code = code;
}
public FatalException(String message) {
super(message);
}
@@ -34,4 +43,9 @@ public class FatalException extends RuntimeException {
public FatalException(Throwable cause) {
super(cause);
}
public int getCode() {
return code;
}
}

View File

@@ -61,7 +61,7 @@ public interface ICloudSignOnService extends IService {
* @param dataCenter data center of TMC
* @return Introspected PAT
*/
PAT introspectPAT(String pat, String dataCenter);
PAT introspectPAT(String pat, String dataCenter) throws Exception;
/**
* Introspect pat and check whether pat is allowed
@@ -70,5 +70,5 @@ public interface ICloudSignOnService extends IService {
* @param tmcUrl tmc url
* @return valid or not
*/
boolean validatePAT(String pat, String tmcUrl);
boolean validatePAT(String pat, String tmcUrl) throws Exception;
}

View File

@@ -149,6 +149,10 @@ public interface IStudioLiteP2Service extends IService {
void cleanM2(IProgressMonitor monitor);
boolean isCompatibleUpdate() throws Exception;
String getCompatibleMessage() throws Exception;
public static IStudioLiteP2Service get() {
if (GlobalServiceRegister.getDefault().isServiceRegistered(IStudioLiteP2Service.class)) {
return GlobalServiceRegister.getDefault().getService(IStudioLiteP2Service.class);