use of com.ingrian.security.nae.NAEAdminRequestProcessor in project CipherTrust_Application_Protection by thalescpl-io.
the class AdminRequestSample method main.
public static void main(String[] args) {
System.out.println("Sample : AdminRequestSample\n" + "Admin Request Options :\n" + "1.Create a new user\n" + "2.Create a new group\n" + "3.Add user to group\n" + "4.Delete user from group\n" + "5.Delete group\n" + "6.Delete user\n" + "7.Get user information\n" + "8.Get all users information\n" + "9.Get group information\n" + "10.Get all group information\n" + "11.Modify User Custom Attributes\n" + "12.Exit\n");
int option = 0;
NAESession session = null;
try {
System.out.print("Enter admin user-name:");
String adminUser = sc.next();
System.out.print("Enter admin password:");
String adminPassword = sc.next();
session = NAESession.getSession(adminUser, adminPassword.toCharArray());
NAEAdminRequestProcessor processor = new NAEAdminRequestProcessor(session);
do {
System.out.print("\nPlease select one of option to perform:");
option = sc.nextInt();
switch(option) {
case 1:
createUser(processor);
break;
case 2:
createGroup(processor);
break;
case 3:
addUserToGroup(processor);
break;
case 4:
deleteUserToGroup(processor);
break;
case 5:
deleteGroup(processor);
break;
case 6:
deleteUser(processor);
break;
case 7:
getUserInfo(processor);
break;
case 8:
getAllUserInfo(processor);
break;
case 9:
getGroupInfo(processor);
break;
case 10:
getAllGroupInfo(processor);
break;
case 11:
modifyUserCustomAttrs(processor);
break;
default:
System.out.println("exit..");
break;
}
} while (option <= 10);
} catch (Exception e) {
e.printStackTrace();
} finally {
if (session != null)
session.closeSession();
}
}
Aggregations