F Creating Custom Scheduled Tasks

The following sections provide information about Java classes that you can use to create scheduled tasks for user reconciliation and lookup field synchronization:

See Managing Scheduled Tasks in Oracle Fusion Middleware Administering Oracle Identity Manager and Developing Lookup Definitions, UDFs, and Remote Manager in Oracle Fusion Middleware Developing and Customizing Applications for Oracle Identity Manager for detailed information about creating scheduled tasks and adding lookup fields for provisioning operations.

F.1 Code for Searching All Users and All User Data

Use the following class to create a scheduled task for fetching user data from the target system:

public void testSearchAllUsers() {
        
try {
            
            
SearchControls ctls = new SearchControls();
// SET COUNT LIMIT to 0 for all users //
ctls.setCountLimit(5);
            
            
// Search for objects that have those matching attributes - (objectclass=*)
//or (objectclass=idforgperson) is supported
NamingEnumeration answer =
ctx.search("ou=People,dc=racf,dc=com", "(objectclass=idforgperson)", ctls );
            
 
while( answer.hasMoreElements() ) {
     SearchResult result = (SearchResult)answer.nextElement();
     Attributes as = result.getAttributes();
      
} 
            
} catch( NamingException nException ) {
  System.out.println(nException.toString());
}

F.2 Code for Searching All Groups and All Group Data

Use the following class to create a scheduled task for fetching group data from the target system. This data can be used to synchronize a group lookup field.

public void testSearchAllGroups() {
        
try {
            
            
SearchControls ctls = new SearchControls();
// SET COUNT LIMIT to 0 for all users //
ctls.setCountLimit(0);
            
            
// Search for objects that have those matching attributes - (objectclass=*)
//or (objectclass=idforggroup) is supported
NamingEnumeration answer =
ctx.search("ou=Groups,dc=racf,dc=com", "(objectclass=idforggroup)", ctls );
            
 
while( answer.hasMoreElements() ) {
     SearchResult result = (SearchResult)answer.nextElement();
     Attributes as = result.getAttributes();
      
} 
            
} catch( NamingException nException ) {
  System.out.println(nException.toString());
}
 

F.3 Code for Searching All Datasets and All Dataset Data

Use the following class to create a scheduled task for fetching dataset data from the target system. This data can be used to synchronize a dataset lookup field.

public void testSearchAllDatasets() {
        
try {
            
            
SearchControls ctls = new SearchControls();
// SET COUNT LIMIT to 0 for all users //
ctls.setCountLimit(5);
            
            
// Search for objects that have those matching attributes - (objectclass=*)
//or (objectclass=idforgdataset) is supported
NamingEnumeration answer =
ctx.search("ou=Datasets,dc=racf,dc=com", "(objectclass=idforgdataset)", ctls
);
            
 
while( answer.hasMoreElements() ) {
     SearchResult result = (SearchResult)answer.nextElement();
     Attributes as = result.getAttributes();
      
} 
            
} catch( NamingException nException ) {
  System.out.println(nException.toString());
}