Class TeamworkService

java.lang.Object
com.nomagic.magicdraw.teamwork2.TeamworkService
All Implemented Interfaces:
ITeamworkService

@OpenApiAll public abstract class TeamworkService extends Object implements ITeamworkService
Implementation of teamwork service.
  • Constructor Details

    • TeamworkService

      public TeamworkService()
  • Method Details

    • getInstance

      @Nonnull public static ITeamworkService getInstance(@Nonnull String id)
      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

      @CheckForNull public static ITeamworkService 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

      @CheckForNull public static ITeamworkService getInstance(Project project)
      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 interface ITeamworkService
      Parameters:
      useLastLoginData - true use last login data, false - specify new login data.
      Returns:
      return true if log-in was successful.
      See Also:
    • loginOnTask

      protected boolean loginOnTask(@CheckForNull Map<String,Boolean> options)
    • loginOnTask

      public boolean loginOnTask(@CheckForNull Map<String,Boolean> options, Consumer<Task> taskRunner)
    • autoLoginOnTask

      public boolean autoLoginOnTask(Consumer<Task> taskRunner)
      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

      protected abstract boolean autoLoginFromOptions(ProgressStatus status)
      Auto logs into last successful server using last successful input data.
      Parameters:
      status - progress status
      Returns:
      return true if log-in was successful.
    • getTeamworkOptions

      protected TeamworkOptionsGroup getTeamworkOptions()
    • login

      public void login(@Nonnull ServerLoginInfo info, boolean encryptPassword)
      Description copied from interface: ITeamworkService
      Login with given data
      Specified by:
      login in interface ITeamworkService
      Parameters:
      info - login info
      encryptPassword - encrypt password from given info
    • setLastUsedTeamworkInfo

      public void setLastUsedTeamworkInfo(@Nonnull ServerLoginInfo info, boolean encryptPassword)
      Description copied from interface: ITeamworkService
      Saves given input data, as last successful user connection info.
      Specified by:
      setLastUsedTeamworkInfo in interface ITeamworkService
      Parameters:
      info - login info
      encryptPassword - encrypt password from given info
    • getLastUsedLoginInfo

      public ServerLoginInfo 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 interface ITeamworkService
      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 interface ITeamworkService
      Parameters:
      project - project
      Returns:
      versions