com.manageengine.pmp

## Class PasswordManagerPro

- java.lang.Object
- - com.manageengine.pmp.PasswordManagerPro

-     public class PasswordManagerPro
      extends java.lang.Object

  This class provides the methods to perform the various password management actions on the PMP repository. This class internally implements the SSL certificate based authentication and XML-RPC message transactions with the PMP application. It requires the JAVA_API.conf file to be present at and properly configured with the PMP server DNS name, port and the local key store with the SSL certificate of the user name with which to authenticate with PMP.
  Usage :
  The static getInstance method returns the singleton instance that is created during the first invocation, at which time it loads the configuration file and stores information required for subsequent use. The calling application should just use this singleton instance and invoke appropriate methods; the authentication and the use of XML-RPC is completely transparent.
  For example, the application can use the following piece of code to retrieve the password from PMP :

              String passwd;
              try
              {
                  passwd = PasswordManagerPro.getInstance().retrievePassword("oracle-db1","scott","Fetch default account password for testing."));
              }
              catch (PMPException pmpEx)
              {
                  // Catch and process exception
              }
              finally
              {
                  // Clean up
              }

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `changePassword(java.lang.String resourceName, java.lang.String accountName, java.lang.String reason, java.lang.Boolean updateRemote)` Changes the password of the specified account on the resource in the PMP repository.
    `void` | `changePassword(java.lang.String resourceName, java.lang.String accountName, java.lang.String reason, java.lang.Boolean updateRemote, java.lang.String ticketId)` Changes the password of the specified account on the resource in the PMP repository.
    `void` | `changePassword(java.lang.String resourceName, java.lang.String accountName, java.lang.String newPassword, java.lang.String reason, java.lang.Boolean updateRemote)` Changes the password of the specified account on the resource in the PMP repository.
    `void` | `changePassword(java.lang.String resourceName, java.lang.String accountName, java.lang.String newPassword, java.lang.String reason, java.lang.Boolean updateRemote, java.lang.String ticketId)` Changes the password of the specified account on the resource in the PMP repository.
    `void` | `createResource(java.lang.String resourceName, java.lang.String resourceType, java.lang.String accountName, java.lang.String notes)` Creates a new resource in the PMP repository with the specified resource name and resource type and adds the specified user account.
    `void` | `createResource(java.lang.String resourceName, java.lang.String resourceType, java.lang.String accountName, java.lang.String newPassword, java.lang.String notes)` Creates a new resource in the PMP repository with the specified resource name and resource type and adds the specified user account.
    `static PasswordManagerPro` | `getInstance()` Returns the singleton instance of PasswordManagerPro for the calling application to invoke the password management actions.
    `java.lang.String` | `retrievePassword(java.lang.String resourceName, java.lang.String accountName)` Returns the password of the specified account on the resource from the PMP repository.
    `java.lang.String` | `retrievePassword(java.lang.String resourceName, java.lang.String accountName, java.lang.String reason)` Returns the password of the specified account on the resource from the PMP repository.
    `java.lang.String` | `retrievePassword(java.lang.String resourceName, java.lang.String accountName, java.lang.String reason, java.lang.String ticketId)` Returns the password of the specified account on the resource from the PMP repository.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getInstance

          public static PasswordManagerPro getInstance()

      Returns the singleton instance of PasswordManagerPro for the calling application to invoke the password management actions.

    - #### retrievePassword

          public java.lang.String retrievePassword(java.lang.String resourceName,
                                          java.lang.String accountName)
                                            throws PMPException

      Returns the password of the specified account on the resource from the PMP repository. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource whose account's password is to be retrieved
        `accountName` - the name of the account whose password is to be retrieved
      Returns:
        The password of the specified account on the resource.
      Throws:
        `PMPException`

    - #### retrievePassword

          public java.lang.String retrievePassword(java.lang.String resourceName,
                                          java.lang.String accountName,
                                          java.lang.String reason)
                                            throws PMPException

      Returns the password of the specified account on the resource from the PMP repository. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource whose account's password is to be retrieved
        `accountName` - the name of the account whose password is to be retrieved
        `reason` - the reason for retrieving the password by the calling application
      Returns:
        The password of the specified account on the resource.
      Throws:
        `PMPException`

    - #### retrievePassword

          public java.lang.String retrievePassword(java.lang.String resourceName,
                                          java.lang.String accountName,
                                          java.lang.String reason,
                                          java.lang.String ticketId)
                                            throws PMPException

      Returns the password of the specified account on the resource from the PMP repository. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource whose account's password is to be retrieved
        `accountName` - the name of the account whose password is to be retrieved
        `reason` - the reason for retrieving the password by the calling application
        `ticketId` - the Request ID from a Help Desk software for retrieving the password
      Returns:
        The password of the specified account on the resource.
      Throws:
        `PMPException`

    - #### changePassword

          public void changePassword(java.lang.String resourceName,
                            java.lang.String accountName,
                            java.lang.String reason,
                            java.lang.Boolean updateRemote)
                              throws PMPException

      Changes the password of the specified account on the resource in the PMP repository. The new password is generated by the PMP application according to the password policy associated for the resource. If updateRemote is true then this method also results in the account's password being changed in the corresponding remote system. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource whose account's password is to be changed
        `accountName` - the name of the account whose password is to be changed
        `reason` - the reason for changing the password by the calling application
        `updateRemote` - if true then the password change is performed in the corresponding remote system too; otherwise only in the PMP repository
      Throws:
        `PMPException`

    - #### changePassword

          public void changePassword(java.lang.String resourceName,
                            java.lang.String accountName,
                            java.lang.String newPassword,
                            java.lang.String reason,
                            java.lang.Boolean updateRemote)
                              throws PMPException

      Changes the password of the specified account on the resource in the PMP repository. If updateRemote is true then this method also results in the account's password being changed in the corresponding remote system. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource whose account's password is to be changed
        `accountName` - the name of the account whose password is to be changed
        `newPassword` - the new password that is to be set for the account
        `reason` - the reason for changing the password by the calling application
        `updateRemote` - if true then the password change is performed in the corresponding remote system too; otherwise only in the PMP repository
      Throws:
        `PMPException`

    - #### changePassword

          public void changePassword(java.lang.String resourceName,
                            java.lang.String accountName,
                            java.lang.String reason,
                            java.lang.Boolean updateRemote,
                            java.lang.String ticketId)
                              throws PMPException

      Changes the password of the specified account on the resource in the PMP repository. The new password is generated by the PMP application according to the password policy associated for the resource. If updateRemote is true then this method also results in the account's password being changed in the corresponding remote system. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource whose account's password is to be changed
        `accountName` - the name of the account whose password is to be changed
        `reason` - the reason for changing the password by the calling application
        `updateRemote` - if true then the password change is performed in the corresponding remote system too; otherwise only in the PMP repository
        `ticketId` - the Request ID from a Help Desk software for resetting the password
      Throws:
        `PMPException`

    - #### changePassword

          public void changePassword(java.lang.String resourceName,
                            java.lang.String accountName,
                            java.lang.String newPassword,
                            java.lang.String reason,
                            java.lang.Boolean updateRemote,
                            java.lang.String ticketId)
                              throws PMPException

      Changes the password of the specified account on the resource in the PMP repository. If updateRemote is true then this method also results in the account's password being changed in the corresponding remote system. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource whose account's password is to be changed
        `accountName` - the name of the account whose password is to be changed
        `newPassword` - the new password that is to be set for the account
        `reason` - the reason for changing the password by the calling application
        `updateRemote` - if true then the password change is performed in the corresponding remote system too; otherwise only in the PMP repository
        `ticketId` - the Request ID from a Help Desk software for resetting the password
      Throws:
        `PMPException`

    - #### createResource

          public void createResource(java.lang.String resourceName,
                            java.lang.String resourceType,
                            java.lang.String accountName,
                            java.lang.String newPassword,
                            java.lang.String notes)
                              throws PMPException

      Creates a new resource in the PMP repository with the specified resource name and resource type and adds the specified user account. Note that the resource created through this API will not be accessible to anyone other than the API user who created it. Only the super admin can see it and share it with other users subsequently. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource to be created
        `resourceType` - the type of the resource to be created. If the resource type does not exist, it is created in the PMP application by this API
        `accountName` - the name of the user account to be created under the resource
        `newPassword` - the password to be set for the account
        `notes` - general notes about the user account
      Throws:
        `PMPException`

    - #### createResource

          public void createResource(java.lang.String resourceName,
                            java.lang.String resourceType,
                            java.lang.String accountName,
                            java.lang.String notes)
                              throws PMPException

      Creates a new resource in the PMP repository with the specified resource name and resource type and adds the specified user account. The default password policy will be associated with the resource and a new password will be generated and set for this account. Note that the resource created through this API will not be accessible to anyone other than the API user who created it. Only the super admin can see it and share it with other users subsequently. Throws PMPException on all error conditions.
      Parameters:
        `resourceName` - the name of the resource to be created
        `resourceType` - the type of the resource to be created. If the resource type does not exist, it is created in the PMP application by this API
        `accountName` - the name of the user account to be created under the resource
        `notes` - general notes about the user account
      Throws:
        `PMPException`

Copyright © 2016 AdventNet Inc. All Rights Reserved.