public DomainComponent addDomain(String domain) throws UMSException {
  if (domain == null || domain.length() == 0) {
    throw new IllegalArgumentException();
  }
  if (m_dcRoot == null) {
    throw new InvalidDCRootException();
  }
  StringTokenizer st=new StringTokenizer(domain,".");
  int nDoms=st.countTokens();
  String[] doms=new String[nDoms];
  int i=0;
  while (st.hasMoreElements()) {
    doms[i++]=st.nextToken();
  }
  PersistentObject parent=UMSObject.getObject(getSSOToken(),m_dcRoot.getGuid());
  DomainComponent dc=null;
  for (i=0; i < nDoms; i++) {
    SearchResults results=parent.getChildren("dc=" + doms[nDoms - i - 1],null);
    try {
      dc=(DomainComponent)results.assertOneEntry();
    }
 catch (    EntryNotFoundException e) {
      dc=new DomainComponent(getSSOToken(),doms[nDoms - i - 1]);
      parent.addChild(dc);
    }
    parent=UMSObject.getObject(getSSOToken(),dc.getGuid());
  }
  return dc;
}

public DomainComponent addDomain ( String domain ) throws UMSException { if ( domain == null || domain . length ( ) == 0 ) { throw new IllegalArgumentException ( ) ; } if ( m_dcRoot == null ) { throw new InvalidDCRootException ( ) ; } StringTokenizer st = new StringTokenizer ( domain , "." ) ; int nDoms = st . countTokens ( ) ; String [ ] doms = new String [ nDoms ] ; int i = 0 ; while ( st . hasMoreElements ( ) ) { doms [ i ++ ] = st . nextToken ( ) ; } PersistentObject parent = UMSObject . getObject ( getSSOToken ( ) , m_dcRoot . getGuid ( ) ) ; DomainComponent dc = null ; for ( i = 0 ; i < nDoms ; i ++ ) { SearchResults results = parent . getChildren ( "dc=" + doms [ nDoms - i - 1 ] , null ) ; try { dc = ( DomainComponent ) results . assertOneEntry ( ) ; } catch ( EntryNotFoundException e ) { dc = new DomainComponent ( getSSOToken ( ) , doms [ nDoms - i - 1 ] ) ; parent . addChild ( dc ) ; } parent = UMSObject . getObject ( getSSOToken ( ) , dc . getGuid ( ) ) ; } return dc ; }
add a virtual domain into the domain component tree .
