Hi Ralf,
Thanks for your suggestion.
I tried creating Target Application using JAVA API, and I could succeed in that, but I am facing errors while creating Target Account using JAVA API.
Code snippet:
//getting target application id
request = new Request();
request.setCommand(AdminAPICommandNames.SEARCH_TARGET_APPLICATION);
request.setParameter(AdminAPIParameterNames.SEARCH_TARGET_APPLICATION_NAME, "UNIX-Application");
result = adminAPI.execute(request);
int targetApplicationID = result.getValueAsTargetApplication().getID();
System.out.println("Target Application = " + result.getValueAsTargetApplication().getID());
//creating target account
targetAccount = AdminAPIFactory.createTargetAccount();
targetAccount.setTargetApplicationID(targetApplicationID);
targetAccount.setUserName("root");
targetAccount.setPassword("dummy");
targetAccount.setPrivileged(false);
targetAccount.setSynchronize(false);
targetAccount.setExtendedAttribute("useOtherAccountToChangePassword",String.valueOf(false));
System.out.println("targetAccount---\n" + targetAccount);
result = adminAPI.add(targetAccount);
System.out.println("addTargetAccount:=> "+ result.getStatusMessage());
targetAccount = result.getValueAsTargetAccount();
System.out.println("addTargetAccount " + result.getValueAsTargetAccount().getUserName());
Error I am seeing:
Target Application = 1056
targetAccount---
TargetAccountImpl[ID=0]{
UserName=root, TargetApplicationID=1056, Owner User Id=-1,
Access Type=null, PVP ID=-1, unsynchronized, not verified,
LastVerified=null, LastUsed=null, A2A, Aliases=null, Cache allowed, Behavior=1, Duration=30,
Attributes[Count=1]{
AttributeImpl[0]{null:0 useOtherAccountToChangePassword=false,
CreateUser=null (1970-01-01 05:30:00.000), UpdateUser=null (1970-01-01 05:30:00.000), Hash=null
}
},
CreateUser=null (1970-01-01 05:30:00.000), UpdateUser=null (1970-01-01 05:30:00.000), Hash=null
}
addTargetAccount:=> Success. An invalid or unrecognized value is assigned to the 'Attribute.protocol' parameter.
In CLI method protocol is not a parameter for creating Target Account. Not sure what I am missing here. Can you please suggest?
Thanks
Lakshman