Created On:  29 June 2011

Problem:

SDK code to show which user accounts are deleted or disabled.

Resolution:

This can be found via a Java SDK:

import

java.util.ArrayList;
import FrameworkManagement.FrameworkManager;
import FrameworkManagement.UserInfo;
import com.starbase.caliber.*;
import com.starbase.caliber.server.CaliberServer;
import org.omg.CORBA.Any;
import org.omg.CORBA.ORB;

public class ListDeletedUsers {

static

Session session = null;

public static void main( String[] args) {

try {

ArrayList allUsers=

new ArrayList();

ArrayList currentUsers=

new ArrayList();

CaliberServer server =

new CaliberServer("localhost");

session = server.login( "admin", "admin");

System.

out.println ("login successful");

User[] users =

session.getUsers();

System.

out.println ("deleted: " + users[2].getName());

users[3].remove();

System.

out.println ("All users including deleted");

System.

out.println ("---------------------------");

System.

out.println (" ");

for(int u=0; u<>length;u++)

{

System.

out.println (usersBroken Heart.getName());

allUsers.add(usersBroken Heart.getName());

}

System.

out.println ("----------------------------------");

System.

out.println (" ");

System.

out.println ("All users NOT including deleted or disabled");

System.

out.println ("-------------------------------------------");

System.

out.println (" ");

//Create FrameworkManager object to obtain User Information

FrameworkManager myFrame=

session.getRemoteFrameworkManager();

Any rv = ORB.init().create_any();

//return all active users

rv.insert_string(

"User_v300_p::account_state = 0");

UserInfo[] usersinfo = myFrame.getUserInfo(rv);

for(int u=0; u<>length;u++)

{

System.

out.println (usersinfoBroken Heart.user_id);

currentUsers.add(usersinfoBroken Heart.

user_id);

}

ArrayList DisabledUsers=

new ArrayList(allUsers);

DisabledUsers.removeAll(currentUsers);

System.

out.println ("----------------------------------");

System.

out.println (" ");

System.

out.println ("Deleted Users");

System.

out.println ("--------------");

for(int d=0; d<>

{

//System.out.println (DisabledUsers.get(d));

boolean found =false;

int count =0;

while(found ==false && count<>length)

{

if(users[count].getUserIDString().equalsIgnoreCase(DisabledUsers.get(d).toString()))

{

found =

true;

System.

out.println (users[count].getID().getIDNumber()+ " "+ users[count].getUserIDString());

}

count++;

}

}

}

catch( Exception e ) {

e.printStackTrace();

}

finally {

if ( session != null ) {

session.logout();

}

}

}

 

}