com.novell.emframe.dev
Class TargetObjects

java.lang.Object
  extended bycom.novell.emframe.dev.TargetObjects

public class TargetObjects
extends java.lang.Object

This class represents the targets that a task should operate on. It is used by the TargetChooser and is returned by DirUtils.unpackDNs(). It is a wrapper that contains either a single ObjectEntry when there is just one target or an ObjectEntryEnumeration when there are multiple targets. Use isMultiple() to determine if there are more than one targets instead of walking the ObjectEntryEnumeration.


Constructor Summary
TargetObjects(java.lang.String pack, TaskContext context)
          Constructs a TargetObjects with the query string used to select objects.
 
Method Summary
 java.lang.String[] getBadObjectNames()
          Returns objects found in the directory that did not match the query string.
 int getCount()
          Returns the length of the target group.
 int getCountReliability()
          Returns the reliability of the number returned by getCount.
 java.lang.String getCountReliablityMessage()
          Returns a warning message to display to the user if the count returned is not exact.
 java.lang.Exception[] getErrors()
          Returns any errors parsing the XML String or finding objects that match the query string.
 ObjectEntry getObjectEntry()
          Use this method to retrieve the target ObjectEntry if there is only one target contained by this object.
 ObjectEntryEnumeration getObjectEntryEnumeration()
          Use this method to retrieve the target ObjectEntries if there are multiple targets contained by this object.
 boolean isMultiple()
          Returns true if there are multiple targets contained by this object.
 void reset(TaskContext context)
          Resets the TargetObjects with a new context and uses the previous query string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TargetObjects

public TargetObjects(java.lang.String pack,
                     TaskContext context)
              throws SPIException,
                     PluginException
Constructs a TargetObjects with the query string used to select objects.

Parameters:
pack - String containing XML data which contains the query string used to select the objects
context - TaskContext of the plug-in
Throws:
SPIException
PluginException
Method Detail

getBadObjectNames

public java.lang.String[] getBadObjectNames()
Returns objects found in the directory that did not match the query string.

Returns:
String array of object names

getCount

public int getCount()
Returns the length of the target group. If this is a virtual enumeration, it return -1 (meaning the length is unknown). If this is a virtual enumeration, call getCountReliability to determine the reliability of the count.

Returns:
int containing the length of the target group
See Also:
getCountReliability(), getCountReliablityMessage()

getCountReliability

public int getCountReliability()
Returns the reliability of the number returned by getCount.

Possible values:

Returns:
int containing the reliability of the number returned by getCount
See Also:
CountableObjectEntryEnumeration, getCount(), getCountReliablityMessage()

getCountReliablityMessage

public java.lang.String getCountReliablityMessage()
Returns a warning message to display to the user if the count returned is not exact. Returns null if count is exact.

Returns:
String containing message to display about count reliability or null if the count is exact
See Also:
getCount(), getCountReliability()

getErrors

public java.lang.Exception[] getErrors()
Returns any errors parsing the XML String or finding objects that match the query string.

Returns:
Exception array of errors encountered

getObjectEntry

public ObjectEntry getObjectEntry()
Use this method to retrieve the target ObjectEntry if there is only one target contained by this object.

Returns:
An ObjectEntryEntry that is the single target object
See Also:
isMultiple()

getObjectEntryEnumeration

public ObjectEntryEnumeration getObjectEntryEnumeration()
Use this method to retrieve the target ObjectEntries if there are multiple targets contained by this object.

Returns:
An ObjectEntryEnumeration containing the targets
See Also:
isMultiple()

isMultiple

public boolean isMultiple()
Returns true if there are multiple targets contained by this object. If there are multiple targets, use getObjectEntryEnumeration to retrieve them. Otherwise, use getObjectEntry to retrieve the single target.

Returns:
boolean: true if there are multiple targets, false if there is a single target
See Also:
getObjectEntryEnumeration(), getObjectEntry()

reset

public void reset(TaskContext context)
           throws SPIException,
                  org.jdom.JDOMException
Resets the TargetObjects with a new context and uses the previous query string.

Parameters:
context - TaskContext of the plug-in
Throws:
SPIException
org.jdom.JDOMException


API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated September 2 2004 0111.