com.candle.roma.kxc
Class RomaDirectoryAgent

java.lang.Object
  |
  +--com.candle.roma.kxc.RomaDirectoryAgent

public class RomaDirectoryAgent
extends java.lang.Object

This class encapsalates Roma directory access. Each instance uses the supplied context to access the Roma directory and is constructed with the required search criteria. More than one instance may be created using the same context.

A directory item is retrieved by calling the item() method which constructs a RomaDirectoryItem, methods on this are used to access data within the item.

See Also:
RomaDirectoryItem

Constructor Summary
RomaDirectoryAgent(RomaBusinessElement element, java.lang.String startingPoint, java.lang.String searchName, int searchType)
          Constructor for business element with no search options
RomaDirectoryAgent(RomaBusinessElement element, java.lang.String startingPoint, java.lang.String searchName, int searchType, int options)
          Constructor for business element with search options
RomaDirectoryAgent(RomaClient client, java.lang.String startingPoint, java.lang.String searchName, int searchType)
          Constructor for client with no search options
RomaDirectoryAgent(RomaClient client, java.lang.String startingPoint, java.lang.String searchName, int searchType, int options)
          Constructor for client with search options
 
Method Summary
protected  boolean action(RomaDirectoryItem item)
          Invoked for each item in the current selection when processAll is called.
 void deleteItem(java.lang.String distName)
          Delete the item with given distiguished name.
 void deleteItem(java.lang.String distName, java.lang.String id, java.lang.String password)
          Delete the item with given distiguished name.
 RomaDirectoryItem item(int nItem)
          Retrieve nth item form the search.
 RomaDirectoryItem item(int nItem, RomaInteger nModified)
          Retrieve nth item form the search and flag whether the directory has been modified.
 void lookup(RomaBusinessElement element, java.lang.String startingPoint, java.lang.String searchName, int searchType)
          set new parameters for directory search
 void lookup(RomaBusinessElement element, java.lang.String startingPoint, java.lang.String searchName, int searchType, int options)
          set new parameters for directory search
 void lookup(RomaClient client, java.lang.String startingPoint, java.lang.String searchName, int searchType)
          set new parameters for directory search
 void lookup(RomaClient client, java.lang.String startingPoint, java.lang.String searchName, int searchType, int options)
          set new parameters for directory search
 int matches()
          Returns number of matching items.
 int matches(RomaInteger modified)
          Returns number of matching items and modified flag.
 int processAll()
          Process each item in the current selection.
 void storeItem(RomaDirectoryItem romaDI)
          Store item with default options.
 void storeItem(RomaDirectoryItem romaDI, java.lang.String id, java.lang.String password)
          Store item with default options
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RomaDirectoryAgent

public RomaDirectoryAgent(RomaClient client,
                          java.lang.String startingPoint,
                          java.lang.String searchName,
                          int searchType)
                   throws RomaError
Constructor for client with no search options
Parameters:
client - should specify a valid client
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
Throws:
RomaError - if the search fails.

RomaDirectoryAgent

public RomaDirectoryAgent(RomaClient client,
                          java.lang.String startingPoint,
                          java.lang.String searchName,
                          int searchType,
                          int options)
                   throws RomaError
Constructor for client with search options
Parameters:
context - should specify a valid Client or Business resp
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
options - search option. One of the following flags
  • OPTION_NONE uses startingPoint as start of search
  • OPTION_BASE searches at top of tree, ignoring startingPoint
    Throws:
    RomaError - if the search fails.

RomaDirectoryAgent

public RomaDirectoryAgent(RomaBusinessElement element,
                          java.lang.String startingPoint,
                          java.lang.String searchName,
                          int searchType)
                   throws RomaError
Constructor for business element with no search options
Parameters:
client - should specify a valid client
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
Throws:
RomaError - if the search fails.

RomaDirectoryAgent

public RomaDirectoryAgent(RomaBusinessElement element,
                          java.lang.String startingPoint,
                          java.lang.String searchName,
                          int searchType,
                          int options)
                   throws RomaError
Constructor for business element with search options
Parameters:
context - should specify a valid Client or Business resp
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
options - search option. One of the following flags
  • OPTION_NONE uses startingPoint as start of search
  • OPTION_BASE searches at top of tree, ignoring startingPoint
    Throws:
    RomaError - if the search fails.
Method Detail

lookup

public void lookup(RomaClient client,
                   java.lang.String startingPoint,
                   java.lang.String searchName,
                   int searchType)
            throws RomaError
set new parameters for directory search
Parameters:
client - should specify a valid client
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
Throws:
RomaError - if the search fails.

lookup

public void lookup(RomaClient client,
                   java.lang.String startingPoint,
                   java.lang.String searchName,
                   int searchType,
                   int options)
            throws RomaError
set new parameters for directory search
Parameters:
context - should specify a valid Client or Business resp
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
options - search option. One of the following flags
  • OPTION_NONE uses startingPoint as start of search
  • OPTION_BASE searches at top of tree, ignoring startingPoint
    Throws:
    RomaError - if the search fails.

lookup

public void lookup(RomaBusinessElement element,
                   java.lang.String startingPoint,
                   java.lang.String searchName,
                   int searchType)
            throws RomaError
set new parameters for directory search
Parameters:
client - should specify a valid client
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
Throws:
RomaError - if the search fails.

lookup

public void lookup(RomaBusinessElement element,
                   java.lang.String startingPoint,
                   java.lang.String searchName,
                   int searchType,
                   int options)
            throws RomaError
set new parameters for directory search
Parameters:
context - should specify a valid Client or Business resp
startingPoint - path to starting point of search
searchName - search for this name
searcType - search type. One of the following flags
  • SEARCH_EXACTMATCH
  • SEARCH_ONELEVEL
  • SEARCH_SUBTREE
options - search option. One of the following flags
  • OPTION_NONE uses startingPoint as start of search
  • OPTION_BASE searches at top of tree, ignoring startingPoint
    Throws:
    RomaError - if the search fails.

matches

public int matches(RomaInteger modified)
            throws RomaError
Returns number of matching items and modified flag.
Parameters:
modified - non-zero value means directory was modified
Returns:
number of matching item
Throws:
RomaError - is thrown on operation failure.

matches

public int matches()
            throws RomaError
Returns number of matching items.
Returns:
number of matching item
Throws:
RomaError - is thrown on operation failure.

item

public RomaDirectoryItem item(int nItem)
                       throws RomaError
Retrieve nth item form the search.
Parameters:
nItem - item required.
Returns:
a RomaDirectoryItem
Throws:
RomaError - is thrown on operation failure.

item

public RomaDirectoryItem item(int nItem,
                              RomaInteger nModified)
                       throws RomaError
Retrieve nth item form the search and flag whether the directory has been modified.
Parameters:
nItem - item required.
mModified - will be set to 1 if directory modified, else 0
Returns:
a RomaDirectoryItem
Throws:
RomaError - is thrown on operation failure.

storeItem

public void storeItem(RomaDirectoryItem romaDI)
               throws RomaError
Store item with default options. Directory access credential should be specified for RomaClient::connect() or RomaBusinessElement::connect().
Parameters:
romaDI - item to store.
Throws:
RomaError - is thrown on operation failure.

storeItem

public void storeItem(RomaDirectoryItem romaDI,
                      java.lang.String id,
                      java.lang.String password)
               throws RomaError
Store item with default options
Parameters:
romaDI - item to store.
id - security identity
password - security password
Throws:
RomaError - is thrown on operation failure.

deleteItem

public void deleteItem(java.lang.String distName)
                throws RomaError
Delete the item with given distiguished name. Directory access credential should be specified for RomaClient::connect() or RomaBusinessElement::connect().
Parameters:
distName - distiguished name
Throws:
RomaError - is thrown on operation failure.

deleteItem

public void deleteItem(java.lang.String distName,
                       java.lang.String id,
                       java.lang.String password)
                throws RomaError
Delete the item with given distiguished name.
Parameters:
distName - distiguished name
id - security identity
password - security password
Throws:
RomaError - is thrown on operation failure.

processAll

public int processAll()
               throws RomaError
Process each item in the current selection. The method called action will be invoked for each item. The application can provide an implementation in a derived class.
Returns:
number of processed items
Throws:
RomaError - is thrown on operation failure.
See Also:
action(com.candle.roma.kxc.RomaDirectoryItem)

action

protected boolean action(RomaDirectoryItem item)
Invoked for each item in the current selection when processAll is called. The application can provide an implementation in a derived class.
Returns:
true is further items are to be processed.
See Also:
processAll()