com.ca.directory.jxplorer.broker
Class SchemaBroker

java.lang.Object
  |
  +--com.ca.directory.jxplorer.broker.Broker
        |
        +--com.ca.directory.jxplorer.broker.SchemaBroker
All Implemented Interfaces:
DataSource, java.lang.Runnable

public class SchemaBroker
extends Broker

This wraps the schema searching functionality of a JNDIBroker, and makes it work as a DataSource so that a SmartTree object can use it to browse the schema.


Field Summary
 
Fields inherited from class com.ca.directory.jxplorer.broker.Broker
current, id, listeners, requestQueue
 
Constructor Summary
SchemaBroker(JNDIBroker jb)
           
 
Method Summary
protected  javax.naming.directory.Attributes addAttributeInfo(javax.naming.directory.Attributes attdefs)
          Takes a DXAttributes set representing attribute schema defs, and translates the oids into human friendly strings...
protected  javax.naming.directory.Attributes addClassInfo(javax.naming.directory.Attributes classdefs)
          Takes a DXAttributes set representing class schema defs, and translates the oids into human friendly strings...
protected  DataQuery doCopyQuery(DataQuery request)
          Operation is not allowed - sets an exception in the request
 DataQuery doExistsQuery(DataQuery request)
          Operation is not allowed - sets an exception in the request
protected  DataQuery doGetAllOCsQuery(DataQuery request)
          Operation is not allowed - sets an exception in the request
protected  DataQuery doGetRecOCsQuery(DataQuery request)
          Operation is not allowed - sets an exception in the request
protected  DataQuery doModifyQuery(DataQuery request)
          Operation is not allowed - sets an exception in the request
protected  DataQuery doSearchQuery(DataQuery request)
          Operation is not allowed - sets an exception in the request
 DataQuery getAttributeDefinition(java.lang.String attributeoid)
          Convenience Class; makes a unthreadedGetEntry request for the passed value, appending 'AttributeDefinition' to the dn.
 java.lang.String getAttributeDescription(java.lang.String attributeoid)
          Convenience Class; makes a request for the passed value, appending 'AttributeDefinition' to the dn.
 DataQuery getClassDefinition(java.lang.String className)
          Convenience Class; makes a request for the passed value, appending 'ClassDefinition' to the dn.
 javax.naming.directory.DirContext getDirContext()
          Chains request to jndiBroker to satisfy broker interface
 javax.naming.directory.DirContext getSchema()
          Chains request to jndiBroker to satisfy broker interface
 DataQuery getSyntaxDefinition(java.lang.String syntaxName)
          Convenience Class; makes a request for the passed syntax definition.
 java.lang.String getSyntaxDescription(java.lang.String syntaxName)
          Convenience Class; makes a request for the passed value, appending 'SyntaxDefinition' to the dn.
 boolean isActive()
          The schema Broker is always active (even if there is no connection) because it will fall back on hard-coded default values if necessary.
static boolean isAttributeBinary(java.lang.String attID)
           
 boolean isModifiable()
          Whether the schema is modifiable - usually false.
protected  void loadSyntaxHash()
           
 void registerDirectoryConnection(JNDIBroker broker)
           
 void setRaw(boolean rawData)
          The schema broker usually processes the schema data into easy-to-display form for users, breaking the different parts of the schema into different entries, translating oids etc.
 boolean unthreadedCopy(DN oldNodeDN, DN newNodeDN)
          Not Implemented.
 boolean unthreadedExists(DN checkMe)
          Not Implemented.
 java.util.Vector unthreadedGetAllOCs()
          Not Implemented.
 java.util.Vector unthreadedGetRecOCs(DN dn)
          Not Implemented.
 DXNamingEnumeration unthreadedList(DN searchbase)
          returns the next level of a directory tree, returning a Enumeration of the results
 boolean unthreadedModify(DXEntry oldEntry, DXEntry newEntry)
          Not Implemented.
 DXEntry unthreadedReadEntry(DN entryDN, java.lang.String[] returnAttributes)
          Reads a 'virtual' schema entry.
 DXNamingEnumeration unthreadedSearch(DN dn, java.lang.String filter, int search_level, java.lang.String[] returnAttributes)
          Not Implemented.
 
Methods inherited from class com.ca.directory.jxplorer.broker.Broker
addDataListener, clearException, copyTree, doEntryQuery, doExtendedQuery, doListQuery, exists, extendedRequest, finish, getBroker, getChildren, getCurrent, getEntry, getException, getObjectClasses, getRecommendedObjectClasses, getRequestQueue, hasRequests, modifyEntry, pop, processQueue, processRequest, push, registerStopMonitor, removeDataListener, removeQuery, run, search
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SchemaBroker

public SchemaBroker(JNDIBroker jb)
Method Detail

registerDirectoryConnection

public void registerDirectoryConnection(JNDIBroker broker)

setRaw

public void setRaw(boolean rawData)
The schema broker usually processes the schema data into easy-to-display form for users, breaking the different parts of the schema into different entries, translating oids etc. This allows the raw data to be accessed instead, primarily for saving in ldif format...


addAttributeInfo

protected javax.naming.directory.Attributes addAttributeInfo(javax.naming.directory.Attributes attdefs)
Takes a DXAttributes set representing attribute schema defs, and translates the oids into human friendly strings...


addClassInfo

protected javax.naming.directory.Attributes addClassInfo(javax.naming.directory.Attributes classdefs)
Takes a DXAttributes set representing class schema defs, and translates the oids into human friendly strings...


getAttributeDefinition

public DataQuery getAttributeDefinition(java.lang.String attributeoid)
Convenience Class; makes a unthreadedGetEntry request for the passed value, appending 'AttributeDefinition' to the dn.

Returns:
an Attributes object containing the (server dependant) available data...

getAttributeDescription

public java.lang.String getAttributeDescription(java.lang.String attributeoid)
Convenience Class; makes a request for the passed value, appending 'AttributeDefinition' to the dn.

Returns:
an Attributes object containing the (server dependant) available data...

getSyntaxDefinition

public DataQuery getSyntaxDefinition(java.lang.String syntaxName)
Convenience Class; makes a request for the passed syntax definition.

Parameters:
syntaxName - the name of the syntax to get info for
Returns:
an Attributes object containing the (server dependant) available data...

getSyntaxDescription

public java.lang.String getSyntaxDescription(java.lang.String syntaxName)
Convenience Class; makes a request for the passed value, appending 'SyntaxDefinition' to the dn. Looks for a 'DESC' field in the reTranslates the resulting

Parameters:
syntaxName - the name of the syntax to get info for
Returns:
an Attributes object containing the (server dependant) available data...

getClassDefinition

public DataQuery getClassDefinition(java.lang.String className)
Convenience Class; makes a request for the passed value, appending 'ClassDefinition' to the dn.

Parameters:
className - the name of the class to get info for
Returns:
an Attributes object containing the (server dependant) available data...

loadSyntaxHash

protected void loadSyntaxHash()

isAttributeBinary

public static boolean isAttributeBinary(java.lang.String attID)

doExistsQuery

public DataQuery doExistsQuery(DataQuery request)
Operation is not allowed - sets an exception in the request

Overrides:
doExistsQuery in class Broker

doSearchQuery

protected DataQuery doSearchQuery(DataQuery request)
Operation is not allowed - sets an exception in the request

Overrides:
doSearchQuery in class Broker

doModifyQuery

protected DataQuery doModifyQuery(DataQuery request)
Operation is not allowed - sets an exception in the request

Overrides:
doModifyQuery in class Broker

doCopyQuery

protected DataQuery doCopyQuery(DataQuery request)
Operation is not allowed - sets an exception in the request

Overrides:
doCopyQuery in class Broker

doGetAllOCsQuery

protected DataQuery doGetAllOCsQuery(DataQuery request)
Operation is not allowed - sets an exception in the request

Overrides:
doGetAllOCsQuery in class Broker

doGetRecOCsQuery

protected DataQuery doGetRecOCsQuery(DataQuery request)
Operation is not allowed - sets an exception in the request

Overrides:
doGetRecOCsQuery in class Broker

unthreadedList

public DXNamingEnumeration unthreadedList(DN searchbase)
returns the next level of a directory tree, returning a Enumeration of the results

Specified by:
unthreadedList in class Broker
Returns:
list of results (NameClassPair); the next layer of the tree...

unthreadedSearch

public DXNamingEnumeration unthreadedSearch(DN dn,
                                            java.lang.String filter,
                                            int search_level,
                                            java.lang.String[] returnAttributes)
Not Implemented.

Specified by:
unthreadedSearch in class Broker
Parameters:
filter - the non-null filter to use for the search
search_level - whether to search the base object, the next level or the whole subtree.
returnAttributes - a vector of string names of attributes to return in the search. (Currently inoperative)
Returns:
list of results ('SearchResult's); the next layer of the tree...

unthreadedCopy

public boolean unthreadedCopy(DN oldNodeDN,
                              DN newNodeDN)
Not Implemented.

Specified by:
unthreadedCopy in class Broker
Parameters:
oldNodeDN - the original DN of the sub tree root to be copied (may be a single entry).
newNodeDN - the target DN for the tree to be moved to.
Returns:
the operation's success status

unthreadedExists

public boolean unthreadedExists(DN checkMe)
Not Implemented.

Specified by:
unthreadedExists in class Broker
Returns:
whether the entry could be found in the directory.

unthreadedGetAllOCs

public java.util.Vector unthreadedGetAllOCs()
Not Implemented.

Specified by:
unthreadedGetAllOCs in class Broker

unthreadedReadEntry

public DXEntry unthreadedReadEntry(DN entryDN,
                                   java.lang.String[] returnAttributes)
Reads a 'virtual' schema entry. (i.e. reads a schema attribute value, parsing and presenting the information as if it were an entry in its own right).

Specified by:
unthreadedReadEntry in class Broker
Parameters:
returnAttributes - a vector of string names of attributes to return in the search. (null means 'return all entries', a zero length array means 'return no attributes'.)

unthreadedModify

public boolean unthreadedModify(DXEntry oldEntry,
                                DXEntry newEntry)
Not Implemented.

Specified by:
unthreadedModify in class Broker
Returns:
the operation's success status

unthreadedGetRecOCs

public java.util.Vector unthreadedGetRecOCs(DN dn)
Not Implemented.

Specified by:
unthreadedGetRecOCs in class Broker
Parameters:
dn - the dn of the parent to determine likely child object classes for
Returns:
list of recommended object classes...

getDirContext

public javax.naming.directory.DirContext getDirContext()
Chains request to jndiBroker to satisfy broker interface

Specified by:
getDirContext in interface DataSource
Specified by:
getDirContext in class Broker
Returns:
the jndi directory context - may be null.

isModifiable

public boolean isModifiable()
Whether the schema is modifiable - usually false.

Specified by:
isModifiable in interface DataSource
Specified by:
isModifiable in class Broker
Returns:
whether the directory is modifiable

isActive

public boolean isActive()
The schema Broker is always active (even if there is no connection) because it will fall back on hard-coded default values if necessary.

Specified by:
isActive in interface DataSource
Specified by:
isActive in class Broker
Returns:
on-line status

getSchema

public javax.naming.directory.DirContext getSchema()
Chains request to jndiBroker to satisfy broker interface

Specified by:
getSchema in interface DataSource
Specified by:
getSchema in class Broker