|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ca.directory.jxplorer.DataQuery
Helper class for Broker, this encapsulates an ldap-like data request that is placed on the Broker queue for eventual resolution. Broker Request objects are intended to be used once, and then discarded.
| Field Summary | |
protected boolean |
cancelled
|
static int |
COPY
a modify request |
static int |
EXISTS
an unknown type |
static int |
EXTENDED
get recommended object classes request |
protected java.util.Hashtable |
extendedData
|
protected java.lang.String |
filter
|
static int |
GETALLOC
a copy request |
static int |
GETRECOC
get all object class request |
int |
id
|
static int |
LIST
a read of a single entry |
protected java.util.Vector |
listeners
an extended data query: i.e. a user inherited extension class |
static int |
MODIFY
a search query |
protected DXEntry |
myEntry
|
protected DXNamingEnumeration |
myEnum
|
protected java.lang.Exception |
myEx
|
protected boolean |
myStatus
|
protected java.util.Vector |
myVector
|
protected DXEntry |
newEntry
|
protected DN |
oldDN
|
protected DXEntry |
oldEntry
|
static int |
READENTRY
an existance check query |
protected boolean |
ready
|
protected DN |
requestDN
|
protected java.lang.String[] |
returnAttrs
|
static int |
SEARCH
list the immediate children of an entry |
protected int |
searchLevel
|
protected boolean |
squelched
|
protected int |
type
|
static int |
UNKNOWN
The following gives the 'type' of the query. |
protected boolean |
working
|
| Constructor Summary | |
DataQuery()
|
|
DataQuery(int type)
Constructor for Get all Object Class requests |
|
DataQuery(int type,
DN dn)
Constructor for List, Read Entry, Exists, and get Recommended Object Class requests. |
|
DataQuery(int type,
DN oldDN,
DN newDN)
Constructor for Copy requests |
|
DataQuery(int type,
DN dn,
java.lang.String filter,
int level,
java.lang.String[] returnAttrs)
Constructor for Search requests |
|
DataQuery(int type,
DXEntry oldEntry,
DXEntry newEntry)
Constructor for Modify requests |
|
| Method Summary | |
void |
addDataListener(DataListener l)
Used by thread-friendly application to register a listener that will be called when the request has been completed (or an error thrown). |
void |
cancel()
Attempt to cancel this request by setting a cancelled flag and an exception. |
void |
clearException()
This clears the exception status of a DataResult, indicating that the exception has been handled. |
void |
doExtendedRequest(Broker b)
Users intending to make Extended requests should write (potentially anonymous) derived classes of DataQuery, extending this method. |
java.lang.String |
filter()
|
void |
finish()
Called when the operation is complete. |
protected void |
fireDataEvent()
Notifies all interested listeners. |
java.util.Hashtable |
getAllExtendedData()
This provides a method of returning arbitrary information from an extended request. |
DXEntry |
getEntry()
A DXEntry from a 'getEntry()' DataSource operation. |
DXNamingEnumeration |
getEnumeration()
A list of Name-Class Pairs from a 'getChildren()' DataSource operation. |
java.lang.Exception |
getException()
Indicates that an error has occured. |
java.lang.Object |
getExtendedData(java.lang.String name)
Returns a named data object from the extended data queries object store. |
java.util.Vector |
getObjectClasses()
A vector of strings representing ObjectClasses from either a DataSource getObjectClasses() or a getRecommendedObjectClasses() operation. |
java.lang.Object |
getResult()
Get the result of the request as a generic object (which must be cast correctly to be used). |
boolean |
getStatus()
Returns the status of an operation. |
int |
getType()
|
java.lang.String |
getTypeString()
Utility translation method |
boolean |
hasException()
Returns whether an error has occured. |
boolean |
isCancelled()
Returns whether this request has been cancelled. |
boolean |
isRunning()
Returns whether the query is currently being operated on by a broker. |
boolean |
isSquelched()
Flags whether a data listener has already consumed this data query ('event'), and the data has been 'used up'. |
DXEntry |
newEntry()
|
DN |
oldDN()
|
DXEntry |
oldEntry()
|
boolean |
ready()
Used by some thread-friendly applications that wish to poll the state of the DataResult. |
DN |
requestDN()
|
java.lang.String[] |
returnAttributes()
|
int |
searchLevel()
|
DataQuery |
setEntry(DXEntry d)
|
DataQuery |
setEnum(DXNamingEnumeration d)
|
DataQuery |
setException(java.lang.Exception e)
|
void |
setExtendedData(java.lang.String name,
java.lang.Object o)
This provides a method for setting arbitrary information for the use of an extended request. |
void |
setRunning()
Registers that this query is currently being operated on by a broker. |
DataQuery |
setStatus(boolean b)
|
DataQuery |
setVector(java.util.Vector v)
Unsynchronized Methods to set data variables |
void |
squelch()
Prevents any other data listeners from using the data query. |
java.lang.String |
toString()
Return a string representation of the Broker Request (usually for debugging). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int UNKNOWN
public static final int EXISTS
public static final int READENTRY
public static final int LIST
public static final int SEARCH
public static final int MODIFY
public static final int COPY
public static final int GETALLOC
public static final int GETRECOC
public static final int EXTENDED
protected java.util.Vector listeners
protected int type
public int id
protected boolean myStatus
protected java.util.Vector myVector
protected DXEntry myEntry
protected DXNamingEnumeration myEnum
protected java.lang.Exception myEx
protected DN requestDN
protected DN oldDN
protected DXEntry oldEntry
protected DXEntry newEntry
protected java.lang.String filter
protected java.lang.String[] returnAttrs
protected int searchLevel
protected java.util.Hashtable extendedData
protected boolean ready
protected boolean cancelled
protected boolean working
protected boolean squelched
| Constructor Detail |
public DataQuery()
public DataQuery(int type)
public DataQuery(int type,
DN dn)
public DataQuery(int type,
DN oldDN,
DN newDN)
public DataQuery(int type,
DXEntry oldEntry,
DXEntry newEntry)
public DataQuery(int type,
DN dn,
java.lang.String filter,
int level,
java.lang.String[] returnAttrs)
| Method Detail |
public void squelch()
public boolean isSquelched()
public void cancel()
public boolean isCancelled()
public void setRunning()
public boolean isRunning()
public void finish()
protected void fireDataEvent()
public java.lang.String getTypeString()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.Object getResult()
public DataQuery setVector(java.util.Vector v)
public DataQuery setStatus(boolean b)
public DataQuery setEntry(DXEntry d)
public DataQuery setEnum(DXNamingEnumeration d)
public DataQuery setException(java.lang.Exception e)
public boolean ready()
public void addDataListener(DataListener l)
Note that this listener is somewhat unusual, as it will only ever trigger a maximum of one time.
if this method is called on a DataResult that has already been completed, it will be triggered immediately. This may cause listener code to be triggered before any code subsequent to the addDataListener() call.
l - the listener to be notified when the data
operation has been completed.
public boolean getStatus()
throws javax.naming.NamingException
This method should be used to read the response from DataSource methods modifyEntry() and copyTree(), and DataSource operations such as exists() and isActive(). Throws a NamingException if called inapropriately (i.e. if no result of this type would be possible).
javax.naming.NamingException
public DXNamingEnumeration getEnumeration()
throws javax.naming.NamingException
Throws a NamingException if called inapropriately (i.e. if no result of this type would be possible). This method should be used to read the response from DataSource getChildren() method.
javax.naming.NamingException
public DXEntry getEntry()
throws javax.naming.NamingException
Throws a NamingException if called inapropriately (i.e. if no result of this type would be possible). This method should be used to read the response from DataSource getEntry() method.
javax.naming.NamingException
public java.util.Vector getObjectClasses()
throws javax.naming.NamingException
Throws a NamingException if called inapropriately (i.e. if no result of this type would be possible). This method should be used to read the response from DataSource getObjectClasses() or a getRecommendedObjectClasses() method.
javax.naming.NamingExceptionpublic java.lang.Exception getException()
It returns null if there is no exception.
public boolean hasException()
It returns false if there is no exception.
public void clearException()
public int getType()
public DN requestDN()
public DN oldDN()
public DXEntry oldEntry()
public DXEntry newEntry()
public java.lang.String filter()
public java.lang.String[] returnAttributes()
public int searchLevel()
public java.util.Hashtable getAllExtendedData()
public java.lang.Object getExtendedData(java.lang.String name)
public void setExtendedData(java.lang.String name,
java.lang.Object o)
public void doExtendedRequest(Broker b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||