Class ZOSUIUserCredentialsManager


  • public final class ZOSUIUserCredentialsManager
    extends Object
    This manager is used to connect a Topaz Workbench UI user to a z/OS host configured in the Topaz Workbench client and to retrieve their credentials for connecting to a z/OS host with the Topaz API.

    Examples:
    To connect a Topaz Workbench UI user and retrieve their credentials:

     IZOSHost zosHost = ...
     
     // make sure we have access to the UI user's credentials (either saved
     // credentials, or the UI user is currently logged in)
     if (!ZOSUIUserCredentialsManager.hasUIUserCredentials(zosHost)) {
         // connect the UI user so we can access their credentials (user will
         // be presented with a login dialog)
         ZOSUIUserCredentialsManager.connectUIUser(zosHost);
     }
     
     // we should have the UI user's credentials now, unless they cancelled
     // the login dialog
     if (ZOSUIUserCredentialsManager.hasUIUserCredentials(zosHost)) {
         // get UI user's z/OS credentials
         IZOSCredentials credentials = ZOSUIUserCredentialsManager
                 .getUIUserCredentials(zosHost);
     
         // you may now use these credentials to connect to the z/OS Host
         ...
     }
     

    For examples on how to connect to a host with an IZOSHostConnection see IZOSHostConnection from the Topaz API (com.compuware.api.topaz).
    For examples on how to work with a z/OS user program using an IZOSUserProgramConnection see IZOSUserProgramConnection from the Topaz API (com.compuware.api.topaz).

    Since:
    2.0.0
    Version:
    1.0.0
    Restriction:
    This class is not intended to be extended by clients.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean connectUIUser​(com.compuware.api.topaz.hosts.zos.IZOSHost zosHost)
      Connects the TopazWorkbench UI user to the specified z/OS host in the Topaz Workbench client.
      static com.compuware.api.topaz.hostcredentials.zos.IZOSCredentials getUIUserCredentials​(com.compuware.api.topaz.hosts.zos.IZOSHost zosHost)
      Gets the UI user credentials from the Topaz Workbench client for the specified z/OS host.
      static boolean hasUIUserCredentials​(com.compuware.api.topaz.hosts.zos.IZOSHost zosHost)
      Returns if the Topaz Workbench client has UI user credentials for the specified z/OS host.
    • Method Detail

      • connectUIUser

        public static boolean connectUIUser​(com.compuware.api.topaz.hosts.zos.IZOSHost zosHost)
        Connects the TopazWorkbench UI user to the specified z/OS host in the Topaz Workbench client.

        If the UI user is already connected, this method simply returns true.

        If saved credentials exist for this host, they will be used to connect. Otherwise, a login dialog will be presented.

        Once connected, the UI user credentials can be retrieved via getUIUserCredentials(IZOSHost).

        Parameters:
        zosHost - the z/OS host
        Returns:
        true if the connection was successful, false otherwise
        Throws:
        com.compuware.api.topaz.hostconnections.HostNotDefinedException - if this host is no longer defined
        Since:
        2.0.0
        See Also:
        getUIUserCredentials(IZOSHost)
      • hasUIUserCredentials

        public static boolean hasUIUserCredentials​(com.compuware.api.topaz.hosts.zos.IZOSHost zosHost)
        Returns if the Topaz Workbench client has UI user credentials for the specified z/OS host.

        In order to access the UI user credentials, the UI user either has to be currently logged in to this host, or have previously saved their credentials.

        Parameters:
        zosHost - the z/OS host
        Returns:
        true if the Topaz Workbench client has UI user credentials for the z/OS host, false otherwise
        Throws:
        com.compuware.api.topaz.hostconnections.HostNotDefinedException - if this host is no longer defined
        Since:
        2.0.0
        See Also:
        getUIUserCredentials(IZOSHost)
      • getUIUserCredentials

        public static com.compuware.api.topaz.hostcredentials.zos.IZOSCredentials getUIUserCredentials​(com.compuware.api.topaz.hosts.zos.IZOSHost zosHost)
        Gets the UI user credentials from the Topaz Workbench client for the specified z/OS host.

        In order to access the UI user credentials, the UI user either has to be currently logged in to this host, or have previously saved their credentials.

        Parameters:
        zosHost - the z/OS host
        Returns:
        the UI user's credentials
        Throws:
        CredentialsNotFoundException - if the UI user is not connected and there are no saved credentials
        com.compuware.api.topaz.hostconnections.HostNotDefinedException - if this host is no longer defined
        Since:
        2.0.0
        See Also:
        hasUIUserCredentials(IZOSHost), connectUIUser(IZOSHost)