File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
com.developer.nefarious.zjoule.plugin/src/com/developer/nefarious/zjoule/plugin/auth Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change 1919 */
2020public abstract class SessionManager {
2121
22- /**
23- * Checks if the user is currently logged in.
24- * A user is considered logged in if the following memory components are not empty:
25- * <ul>
26- * <li>{@link MemoryAccessToken}</li>
27- * <li>{@link MemoryServiceKey}</li>
28- * <li>{@link MemoryResourceGroup}</li>
29- * <li>{@link MemoryDeployment}</li>
30- * </ul>
31- *
32- * @return {@code true} if the user is logged in, {@code false} otherwise.
33- */
22+
3423 public static boolean isUserLoggedIn () {
24+ return (isSapSessionOn () || isOllamaSessionOn ()) ? true : false ;
25+ }
26+
27+ private static boolean isSapSessionOn () {
3528 MemoryAccessToken memoryAccessToken = MemoryAccessToken .getInstance ();
3629 MemoryServiceKey memoryServiceKey = MemoryServiceKey .getInstance ();
3730 MemoryResourceGroup memoryResourceGroup = MemoryResourceGroup .getInstance ();
@@ -40,6 +33,13 @@ public static boolean isUserLoggedIn() {
4033 return (memoryAccessToken .isEmpty () || memoryServiceKey .isEmpty () || memoryResourceGroup .isEmpty ()
4134 || memoryDeployment .isEmpty ()) ? false : true ;
4235 }
36+
37+ private static boolean isOllamaSessionOn () {
38+ MemoryOllamaEndpoint memoryOllamaEndpoint = MemoryOllamaEndpoint .getInstance ();
39+ MemoryOllamaModel memoryOllamaModel = MemoryOllamaModel .getInstance ();
40+
41+ return (memoryOllamaEndpoint .isEmpty () || memoryOllamaModel .isEmpty ()) ? false : true ;
42+ }
4343
4444 /**
4545 * Executes the login process using the specified browser.
You can’t perform that action at this time.
0 commit comments