Package com.nomagic.magicdraw.teamwork2
Class TeamworkService
java.lang.Object
com.nomagic.magicdraw.teamwork2.TeamworkService
- All Implemented Interfaces:
ITeamworkService
Implementation of teamwork service.
-
Field Summary
Fields inherited from interface com.nomagic.magicdraw.teamwork2.ITeamworkService
ESI_SERVICE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract boolean
autoLoginFromOptions
(ProgressStatus status) Auto logs into last successful server using last successful input data.boolean
autoLoginOnTask
(Consumer<Task> taskRunner) Auto logs into last successful server using last successful input data with task runnerstatic ITeamworkService
Returns active server service, according to current connected state.static ITeamworkService
getInstance
(Project project) Returns server service, according to current project.static ITeamworkService
getInstance
(String id) Return instance by service id.Returns list of input data, which was entered on last successful connection.protected TeamworkOptionsGroup
com.nomagic.ci.persistence.versioning.IVersionDescriptor
getVersion
(Project project) Current versions of given projectfinal boolean
login
(boolean useLastLoginData) Logs into last successful server using last successful input data.void
login
(ServerLoginInfo info, boolean encryptPassword) Login with given dataprotected abstract boolean
loginFromOptions
(Map<String, Boolean> options, ProgressStatus status) Logs into last successful server using last successful input data.protected boolean
loginOnTask
(Map<String, Boolean> options) boolean
static ITeamworkService
setActiveInstance
(ITeamworkService activeTeamworkService) Set active Teamwork Service instance.void
setLastUsedTeamworkInfo
(ServerLoginInfo info, boolean encryptPassword) Saves given input data, as last successful user connection info.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.nomagic.magicdraw.teamwork2.ITeamworkService
getConnectedUser, getProjectDescriptorById, getProjectDescriptorByQualifiedName, getProjectDescriptors, getProjectIdByQualifiedName, getServiceID, getVersions, isConnected, isLiveConnection, logout, setAsLastUsedService
-
Constructor Details
-
TeamworkService
public TeamworkService()
-
-
Method Details
-
getInstance
Return instance by service id.- Parameters:
id
- service id- Returns:
- service instance or null
-
setActiveInstance
@CheckForNull public static ITeamworkService setActiveInstance(@CheckForNull ITeamworkService activeTeamworkService) Set active Teamwork Service instance. If set to null uses first found connected instance (default behavior).- Parameters:
activeTeamworkService
- active service- Returns:
- old active instance
-
getActiveInstance
Returns active server service, according to current connected state. - whether it connected (to MU or CI) or not.- Returns:
- if it is connected to MU server, returns Teamwork service, if to Cameo Team server, returns cameo service.
-
getInstance
Returns server service, according to current project.- Parameters:
project
- project- Returns:
- if it is teamwork server project, returns Teamwork service, if Cameo Team server project, returns cameo service.
-
login
public final boolean login(boolean useLastLoginData) Description copied from interface:ITeamworkService
Logs into last successful server using last successful input data.- Specified by:
login
in interfaceITeamworkService
- Parameters:
useLastLoginData
- true use last login data, false - specify new login data.- Returns:
- return true if log-in was successful.
- See Also:
-
loginOnTask
-
loginOnTask
-
autoLoginOnTask
Auto logs into last successful server using last successful input data with task runner- Parameters:
taskRunner
- runs auto login task- Returns:
- return true if log-in was successful.
-
loginFromOptions
protected abstract boolean loginFromOptions(@CheckForNull Map<String, Boolean> options, ProgressStatus status) Logs into last successful server using last successful input data.- Parameters:
options
- options.status
- progress status- Returns:
- return true if log-in was successful.
-
autoLoginFromOptions
Auto logs into last successful server using last successful input data.- Parameters:
status
- progress status- Returns:
- return true if log-in was successful.
-
getTeamworkOptions
-
login
Description copied from interface:ITeamworkService
Login with given data- Specified by:
login
in interfaceITeamworkService
- Parameters:
info
- login infoencryptPassword
- encrypt password from given info
-
setLastUsedTeamworkInfo
Description copied from interface:ITeamworkService
Saves given input data, as last successful user connection info.- Specified by:
setLastUsedTeamworkInfo
in interfaceITeamworkService
- Parameters:
info
- login infoencryptPassword
- encrypt password from given info
-
getLastUsedLoginInfo
Description copied from interface:ITeamworkService
Returns list of input data, which was entered on last successful connection. Array of: login username, pass, servername.- Specified by:
getLastUsedLoginInfo
in interfaceITeamworkService
- Returns:
- array of username, pass, servername.
-
getVersion
public com.nomagic.ci.persistence.versioning.IVersionDescriptor getVersion(@Nonnull Project project) Description copied from interface:ITeamworkService
Current versions of given project- Specified by:
getVersion
in interfaceITeamworkService
- Parameters:
project
- project- Returns:
- versions
-