Package com.iplanet.ums.dctree
Class DomainComponentTree
- java.lang.Object
-
- com.iplanet.ums.dctree.DomainComponentTree
-
public class DomainComponentTree extends Object
Represents the domain component index tree (dctree). A domain component tree is used to represent virtual domains as used in DNS. DCTree composes of a hiearchical tree of domain components (dc) and each dc node may/maynot associate with a organizational DIT (convergence tree as noted in nortel spec). Sample of a dctree that starts at dcroot of "o=internet" will look like thiso=internet | ------------------------------ | | | dc=com dc=net dc=edu | --------- | | dc=sun dc=iplanet | | dc=eng dc=red
DomainComponentTree allows the user to create a dc tree capturing virtual domain names in a network (hosted or enterprise) environment with each low level dc node being mapped to an organizational DIT.- See Also:
DomainComponent
-
-
Constructor Summary
Constructors Constructor Description DomainComponentTree()
Default constructorDomainComponentTree(SSOToken token, Guid dcRoot)
Constructs aDomainComponentTree
with an authenticated prinicipal and an identification of the root of the dc index tree.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DomainComponent
addDomain(String domain)
Add a virtual domain into the domain component tree.Hashtable
getChildDomainIDs()
Get all virtual domains present in the dctree.PersistentObject
getDCRoot()
Gets the root of the domain component tree (dc tree)DomainComponent
getDomainComponent(String domain)
Given a virtual domain name such as "javasoft.sun.com", returns the domain component entry in the dc index tree.String
getDomainStatus(String domain)
Gets the domain status of a given virtual domainPersistentObject
getOrganization(String domain)
Given a virtual domain name such as "javasoft.sun.com", return the organization, organizationalunit or any DIT entry that is assoicated from the domain compoent tree (dctree) to the customer oranization DIT (the convergence tree as outlined in nortel spec)User
getUser(String uid, String domain)
Given a uid for a user, lookup the user under a specified virtual domain name.User
getUser(String namingAttribute, String value, String domain)
Given identification of a user with a naming attribute and value, lookup the user under a virtual domain specified.String
mapDCToDomainName(DomainComponent dc)
Given a domain component in a dctree, maps it to a virtual domain nameString
mapDomainToDN(String domain)
Given a fully qualified domain name, maps it to the corresponding DN in the DCtreevoid
removeDomain(String domain)
Remove a virtual domain in the dctreevoid
setDCRoot(Guid root)
Sets the root of the domain component tree (dc tree).void
setDomainMapping(String domain, Guid orgGuid)
Set the domain mapping so that the dc entry maps to an organization in the convergence tree.void
setDomainMapping(String domain, PersistentObject org)
Set the domain mapping so that the dc entry maps to an organization in the the organization DIT hosting user data (the convergence tree in Nortel spec)void
setDomainStatus(String domain, String status)
Sets the domain status for a given virtual domain
-
-
-
Constructor Detail
-
DomainComponentTree
public DomainComponentTree()
Default constructor
-
DomainComponentTree
public DomainComponentTree(SSOToken token, Guid dcRoot) throws InvalidDCRootException, UMSException
Constructs aDomainComponentTree
with an authenticated prinicipal and an identification of the root of the dc index tree.- Parameters:
token
- Single sign on token of authenticated principal with priviledge for accessing the domain component index tree (dctree).dcRoot
- Identification of root, a DN, of the dc tree such aso=internet
.- Throws:
InvalidDCRootException
- if invalid root specification.UMSException
- if other read error occurred.
-
-
Method Detail
-
setDCRoot
public void setDCRoot(Guid root) throws UMSException
Sets the root of the domain component tree (dc tree). Needs an established authenticated principal before setting dcroot.- Parameters:
root
- Identification of the root of the tree such as o=internet- Throws:
UMSException
-
getDCRoot
public PersistentObject getDCRoot()
Gets the root of the domain component tree (dc tree)- Returns:
- PersistentObject representing the dctree root in the dctree DIT
-
addDomain
public DomainComponent addDomain(String domain) throws UMSException
Add a virtual domain into the domain component tree.- Parameters:
domain
- Fully qualified domain name- Returns:
- Domain Componet entry just added to the dctree
- Throws:
InvalidDCRootException
- if dcroot is not definedUMSException
- for write problem in adding domain to dctree
-
removeDomain
public void removeDomain(String domain) throws UMSException
Remove a virtual domain in the dctree- Parameters:
domain
- Virtual domain name to be removed- Throws:
UMSException
- upon failure to remove the corresponding dc entry in the dctree
-
setDomainMapping
public void setDomainMapping(String domain, PersistentObject org) throws UMSException
Set the domain mapping so that the dc entry maps to an organization in the the organization DIT hosting user data (the convergence tree in Nortel spec)- Parameters:
domain
- Fully qualified domain nameorg
- Organization entry to be mapped from dctree to organization DIT (the convergence tree in nortel spec)- Throws:
DomainNotFoundException
- if domain id not definedUMSException
- upon write failure
-
setDomainMapping
public void setDomainMapping(String domain, Guid orgGuid) throws UMSException
Set the domain mapping so that the dc entry maps to an organization in the convergence tree.- Parameters:
domain
- Virtual domain name.orgGuid
- Identifiication of Organization entry to be mapped from dctree to organization DIT (the convergence tree in nortel spec).- Throws:
UMSException
- if write failed.
-
setDomainStatus
public void setDomainStatus(String domain, String status) throws DomainNotFoundException, UMSException
Sets the domain status for a given virtual domain- Parameters:
domain
- Virtual domain namestatus
- Domain status to be set- Throws:
DomainNotFoundException
- if domain is not found in dctreeUMSException
- upon write failure
-
getDomainStatus
public String getDomainStatus(String domain) throws DomainNotFoundException, UMSException
Gets the domain status of a given virtual domain- Parameters:
domain
- Virtual domain name- Returns:
- Domain status for the given domain
- Throws:
DomainNotFoundException
- if domain not found in dctreeUMSException
- upon read failure
-
mapDomainToDN
public String mapDomainToDN(String domain)
Given a fully qualified domain name, maps it to the corresponding DN in the DCtree- Parameters:
domain
- Fully qualified domain name- Returns:
- String representation of the Distinguished Name in the DC Tree
-
getDomainComponent
public DomainComponent getDomainComponent(String domain) throws DomainNotFoundException, UMSException
Given a virtual domain name such as "javasoft.sun.com", returns the domain component entry in the dc index tree. This entry lives under dc index tree and one can use the dc entry to get to the organization assoicated with the dc tree- Parameters:
domain
- Virtual domain name such as "javasoft.sun.com"- Returns:
- Domain componet entry representing the virtual domain in the domain component tree
- Throws:
DomainNotFoundException
- if given domain is not found in the dctreeUMSException
- upon read error
-
getOrganization
public PersistentObject getOrganization(String domain) throws DomainNotFoundException, UMSException
Given a virtual domain name such as "javasoft.sun.com", return the organization, organizationalunit or any DIT entry that is assoicated from the domain compoent tree (dctree) to the customer oranization DIT (the convergence tree as outlined in nortel spec)- Parameters:
domain
- Fully qualified virtual domain name- Returns:
- Entry referred in the dc tree.
- Throws:
DomainNotFoundException
- if domain is not foundUMSException
- for reading problem in instantiating the mapped organization
-
getUser
public User getUser(String uid, String domain) throws DomainNotFoundException, UMSException
Given a uid for a user, lookup the user under a specified virtual domain name. For example,DomainComponentTree dctree = new DomainComponentTree(ctx, "red.iplanet.com"); User user = dctree.getUser("hman", "red.iplanet.com");
- Parameters:
uid
- User id for the entry to be searcheddomain
- Fully qualified domain name such as "red.iplanet.com"- Returns:
- User object found
- Throws:
DomainNotFoundException
- if domain is not foundUMSException
- upon failure in instantiating the user object
-
getUser
public User getUser(String namingAttribute, String value, String domain) throws DomainNotFoundException, UMSException
Given identification of a user with a naming attribute and value, lookup the user under a virtual domain specified. For example,DomainComponentTree dctree = new DomainComponentTree(ctx, "red.iplanet.com"); User user = dctree.getUser("cn", "Hin Man", "red.iplanet.com");
- Parameters:
namingAttribute
- Naming attribute for the user object such as "uid" or "mail". The naming attribute has to provide a unique identifier for the user.value
- attribute value for the naming attributedomain
- Fully qualified domain name such as "red.iplanet.com"- Returns:
- User object if found
- Throws:
DomainNotFoundException
- if domain is not foundUMSException
- upon failure in instantiating the user object
-
mapDCToDomainName
public String mapDCToDomainName(DomainComponent dc)
Given a domain component in a dctree, maps it to a virtual domain name- Parameters:
dc
- A domain component that lives in the dctree- Returns:
- Fully qualified domain name
-
getChildDomainIDs
public Hashtable getChildDomainIDs() throws UMSException
Get all virtual domains present in the dctree. Construct a hashtable of the found domain names and their associated organization in the customer organizational DIT (the convergence tree)This function can be used as a cache function for the complete DCTree. The returning hastable provides all the virtual domain name as keys that maps to organization mapping linked in the domain component dc nodes
- Returns:
- Hashtable of domain names and associated organizations. Each domain name is associated with one organization but muliple domain names can map to the same organization in the customer DIT.
- Throws:
UMSException
- upon failure in searching all mapped domains
-
-