000014362 - AMPrincipalDTO mandatory fields

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000014362
Applies ToRSA Authentication Manager 7.1
IssueAMPrincipalDTO
AddAMPrincipalDTO
CauseThe javadoc for this command-layer-DTO does not specify which fields are mandatory to be set when used in conjunction with the AddAMPrincipalDTO class. 
Resolution

The only mandatory field is the GUID value; where this value must be the GUID of an existing PrincipalDTO object.  All other fields are optional.

For example:

    . . .
    PrincipalDTO imsprincipal = lookupUser(user);
    String guid = imsprincipal.getGuid();
    AMPrincipalDTO principal = new AMPrincipalDTO();
    principal.setGuid(guid);
    AddAMPrincipalCommand cmd = new AddAMPrincipalCommand(principal);
    try {
      cmd.execute();
    }
    catch (SystemException ex) {
      ex.printStackTrace();
      System.exit(1);
    }
    catch (CommandException ex) {
      ex.printStackTrace();
      System.exit(1);
    }

In this example a method called lookupUser() has been used (see the AdminAPIDemos.java in the SDK for this method).  This returns a PrincipalDTO object, we can then obtain the GUID value for this user and then use it to set a single parameter in the AMPrincipalDTO object which is then applied by the AddAMPrincipalCommand.

 

Legacy Article IDa46566

Attachments

    Outcomes