public class BrowserController extends Object implements TreeExpansionListener, ReferralAuthenticationListener
Modifier and Type | Field and Description |
---|---|
static org.forgerock.opendj.ldap.Filter |
ALL_OBJECTS_FILTER
The filter used to retrieve all the entries.
|
Constructor and Description |
---|
BrowserController(JTree tree,
LDAPConnectionPool cpool,
IconPool ipool)
Constructor of the BrowserController.
|
Modifier and Type | Method and Description |
---|---|
void |
addBrowserEventListener(BrowserEventListener l)
Add a BrowserEventListener to this controller.
|
TreePath |
addNodeUnderRoot(org.forgerock.opendj.ldap.Dn nodeDn)
Add an LDAP suffix to this controller.
|
TreePath |
addSuffix(org.forgerock.opendj.ldap.Dn suffixDn,
org.forgerock.opendj.ldap.Dn parentSuffixDn)
Add an LDAP suffix to this controller.
|
void |
expandNode(BasicNode node)
Expands node.
|
static int |
findChildNode(BasicNode parent,
org.forgerock.opendj.ldap.Dn childDn)
Find a child node matching a given DN.
|
ConnectionWithControls |
findConnectionForDisplayedEntry(BasicNode node)
Return the LDAP connection to search the displayed entry (which can be the
local or remote entry).
|
ConnectionWithControls |
getConfigurationConnection()
Return the connection for accessing the directory configuration.
|
LDAPConnectionPool |
getConnectionPool()
Return the connection pool used by this controller.
|
String[] |
getContainerClasses()
Return the array of container classes for this controller.
|
String |
getDisplayAttribute()
Returns the attribute used to display the entry.
|
int |
getDisplayFlags()
Return the display flags.
|
org.forgerock.opendj.ldap.Filter |
getFilter()
Returns the filter that is being used to search the entries.
|
static boolean |
getHasSubOrdinates(org.forgerock.opendj.ldap.Entry entry)
Returns whether the entry has subordinates or not.
|
IconPool |
getIconPool()
Return the icon pool used by this controller.
|
int |
getMaxChildren()
Return the maximum number of children to display.
|
BrowserNodeInfo |
getNodeInfoFromPath(TreePath path)
Find the BrowserNodeInfo associated to a TreePath and returns
the describing IBrowserNodeInfo.
|
NumSubordinateHacker |
getNumSubordinateHacker()
NUMSUBORDINATE HACK
Make the hacker public so that RefreshTask can use it.
|
int |
getQueueSize()
Returns the size of the queue containing the different tasks.
|
static String[] |
getReferral(org.forgerock.opendj.ldap.messages.SearchResultEntry entry)
Returns the value of the 'ref' attribute.
|
JTree |
getTree()
Return the JTree controlled by this controller.
|
DefaultTreeModel |
getTreeModel()
The tree model created by the controller and assigned
to the JTree.
|
ConnectionWithControls |
getUserDataConnection()
Return the connection for accessing the directory user data.
|
boolean |
hasSuffix(org.forgerock.opendj.ldap.Dn suffixDn)
Tells whether the given suffix is in the tree or not.
|
boolean |
isAttributeNameShown()
Says whether we are showing the attribute name or not.
|
boolean |
isAutomaticExpand()
Returns whether we are in automatic expand mode.
|
boolean |
isConfigurationNode(BasicNode node)
Returns whether a given node is a configuration node or not.
|
boolean |
isFollowReferrals()
Return true if this controller follows referrals.
|
boolean |
isShowContainerOnly()
Return true if only container entries are displayed.
|
boolean |
isSorted()
Return true if entries are displayed sorted.
|
boolean |
nodeIsExpanded(BasicNode node)
Returns true if the node is expanded.
|
void |
notifyAuthDataChanged()
Notify this controller that authentication data have changed in the connection pool.
|
TreePath |
notifyEntryAdded(BrowserNodeInfo parentInfo,
org.forgerock.opendj.ldap.Dn newEntryDn)
Notify this controller that an entry has been added.
|
void |
notifyEntryChanged(BrowserNodeInfo nodeInfo)
Notify this controller that an entry has changed.
|
TreePath |
notifyEntryDeleted(BrowserNodeInfo nodeInfo)
Notify this controller that a entry has been deleted.
|
TreePath |
removeAllUnderRoot()
Remove all the suffixes.
|
void |
setAutomaticExpand(boolean automaticExpand)
Sets the automatic expand mode.
|
void |
setConnections(ServerDescriptor server,
ConnectionWrapper connConfiguration,
ConnectionWrapper connUserData)
Set the connection for accessing the directory.
|
void |
setContainerClasses(String[] containerClasses)
Set the list of container classes and calls startRefresh().
|
void |
setDisplayAttribute(String displayAttribute)
Set the display attribute (the attribute that will be used to retrieve
the string that will appear in the tree when rendering the node).
|
void |
setDisplayFlags(int flags)
Set the display flags and call startRefresh().
|
void |
setFilter(org.forgerock.opendj.ldap.Filter filter)
Sets the filter that must be used by the browser controller to retrieve
entries.
|
void |
setFollowReferrals(boolean followReferrals)
Enable/display the following of referrals.
|
void |
setInspectedNode(BrowserNodeInfo node)
Sets which is the inspected node.
|
void |
setMaxChildren(int maxChildren)
Sets the maximum number of children to display for a node.
|
void |
setNumSubordinateHacker(NumSubordinateHacker h)
NUMSUBORDINATE HACK
Set the hacker.
|
void |
setShowContainerOnly(boolean showContainerOnly)
Enable or disable container display and call startRefresh().
|
void |
setSorted(boolean sorted)
Enable/disable entry sort.
|
void |
startRefresh(BrowserNodeInfo nodeInfo)
Start a refresh from the specified node.
|
void |
treeCollapsed(TreeExpansionEvent event)
For BrowserController private use.
|
void |
treeExpanded(TreeExpansionEvent event)
For BrowserController private use.
|
public static final org.forgerock.opendj.ldap.Filter ALL_OBJECTS_FILTER
public BrowserController(JTree tree, LDAPConnectionPool cpool, IconPool ipool)
tree
- the tree that must be updated.cpool
- the connection pool object that will provide the connections
to be used.ipool
- the icon pool to be used to retrieve the icons that will be
used to render the nodes in the tree.public void setConnections(ServerDescriptor server, ConnectionWrapper connConfiguration, ConnectionWrapper connUserData)
server
- the server descriptor.connConfiguration
- the connection to be used to retrieve the data in
the configuration base DNs.connUserData
- the connection to be used to retrieve the data in the
user base DNs.public ConnectionWithControls getConfigurationConnection()
public ConnectionWithControls getUserDataConnection()
public JTree getTree()
public LDAPConnectionPool getConnectionPool()
public IconPool getIconPool()
public boolean hasSuffix(org.forgerock.opendj.ldap.Dn suffixDn) throws IllegalArgumentException
suffixDn
- the DN of the suffix to be analyzed.true
if the provided String is the DN of a suffix
and false
otherwise.IllegalArgumentException
- if a node with the given dn exists but
is not a suffix node.public TreePath addSuffix(org.forgerock.opendj.ldap.Dn suffixDn, org.forgerock.opendj.ldap.Dn parentSuffixDn) throws IllegalArgumentException
suffixDn
- the DN of the suffix.parentSuffixDn
- the DN of the parent suffix (or null
if
there is no parent DN).IllegalArgumentException
- if a node with the given dn exists.public TreePath addNodeUnderRoot(org.forgerock.opendj.ldap.Dn nodeDn)
nodeDn
- the DN of the node to be added.public TreePath removeAllUnderRoot()
public int getDisplayFlags()
public void setDisplayFlags(int flags)
flags
- the display flags to be set.public void setDisplayAttribute(String displayAttribute)
displayAttribute
- the display attribute to be used.public String getDisplayAttribute()
public boolean isAttributeNameShown()
true
if we are showing the attribute name and
false
otherwise.public void setMaxChildren(int maxChildren)
maxChildren
- the maximum number of children to display for a node.public int getMaxChildren()
public boolean isFollowReferrals()
true
if this controller follows referrals, false
otherwise.public void setFollowReferrals(boolean followReferrals)
followReferrals
- whether to follow referrals or not.public boolean isSorted()
true
if entries are displayed sorted, false
otherwise.public void setSorted(boolean sorted)
sorted
- whether to sort the entries or not.public boolean isShowContainerOnly()
true
if only container entries are displayed and
false
otherwise.public void setShowContainerOnly(boolean showContainerOnly)
showContainerOnly
- whether to display only containers or all the
entries.public BrowserNodeInfo getNodeInfoFromPath(TreePath path)
path
- the TreePath associated with the node we are searching.public String[] getContainerClasses()
public void setContainerClasses(String[] containerClasses)
containerClasses
- the lis of container classes.public NumSubordinateHacker getNumSubordinateHacker()
public void setNumSubordinateHacker(NumSubordinateHacker h)
h
- the NumSubordinateHacker.public void addBrowserEventListener(BrowserEventListener l)
l
- the listener to be added.public TreePath notifyEntryAdded(BrowserNodeInfo parentInfo, org.forgerock.opendj.ldap.Dn newEntryDn)
parentInfo
- the parent node of the entry added.newEntryDn
- the dn of the entry to be added.public TreePath notifyEntryDeleted(BrowserNodeInfo nodeInfo)
nodeInfo
- the node to be deleted.public void notifyEntryChanged(BrowserNodeInfo nodeInfo)
nodeInfo
- the node that changed.public void notifyAuthDataChanged()
notifyAuthDataChanged
in interface ReferralAuthenticationListener
public void startRefresh(BrowserNodeInfo nodeInfo)
nodeInfo
- the node to be refreshed.public void treeExpanded(TreeExpansionEvent event)
treeExpanded
in interface TreeExpansionListener
event
- the tree expansion event.public void treeCollapsed(TreeExpansionEvent event)
treeCollapsed
in interface TreeExpansionListener
event
- the tree collapse event.public void setInspectedNode(BrowserNodeInfo node)
node
- the selected node.public DefaultTreeModel getTreeModel()
public void setFilter(org.forgerock.opendj.ldap.Filter filter)
filter
- the LDAP filter.public org.forgerock.opendj.ldap.Filter getFilter()
public boolean isConfigurationNode(BasicNode node)
node
- the node to analyze.true
if the node is a configuration node, false
otherwise.public ConnectionWithControls findConnectionForDisplayedEntry(BasicNode node) throws org.forgerock.opendj.ldap.LdapException
node
- the node for which we want toe LDAP connection.org.forgerock.opendj.ldap.LdapException
- if there is an error retrieving the connection.public static int findChildNode(BasicNode parent, org.forgerock.opendj.ldap.Dn childDn)
parent
- the parent node of the node that is being searched.childDn
- the DN of the entry that is being searched.public int getQueueSize()
public static boolean getHasSubOrdinates(org.forgerock.opendj.ldap.Entry entry)
entry
- the entry to analyze.true
if the entry has subordinates according to the values
of hasSubordinates and numSubordinates, returns false
if none of
the attributes could be found.public static String[] getReferral(org.forgerock.opendj.ldap.messages.SearchResultEntry entry)
null
if the attribute is not present.entry
- the entry to analyze.null
if the attribute
could not be found.public boolean nodeIsExpanded(BasicNode node)
node
- the node to analyze.true
if the node is expanded and false
otherwise.public void expandNode(BasicNode node)
node
- the node to expand.public boolean isAutomaticExpand()
true
if we are in automatic expand mode and
false
otherwise.public void setAutomaticExpand(boolean automaticExpand)
automaticExpand
- whether to expand automatically the nodes or not.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.