public String[] splitResourceName(String serviceTypeName,String resourceName) throws NameNotFoundException, SSOException, PolicyException {
  ServiceType st=getServiceType(serviceTypeName);
  Set prefixes=getManagedResourceNames(serviceTypeName);
  String[] retVal=new String[2];
  if (prefixes.isEmpty()) {
    retVal[0]="";
    retVal[1]=resourceName;
    return retVal;
  }
  Iterator iter=prefixes.iterator();
  String tmp=null;
  ResourceMatch matchResult=null;
  boolean foundSuperMatch=false;
  boolean foundExactMatch=false;
  while (iter.hasNext()) {
    tmp=(String)iter.next();
    matchResult=st.compare(resourceName,tmp);
    if (matchResult.equals(ResourceMatch.SUPER_RESOURCE_MATCH)) {
      foundSuperMatch=true;
      break;
    }
    if (matchResult.equals(ResourceMatch.EXACT_MATCH)) {
      foundExactMatch=true;
      break;
    }
  }
  if (foundSuperMatch) {
    retVal[0]=tmp;
    retVal[1]=st.getSubResource(resourceName,tmp);
    return retVal;
  }
  if (foundExactMatch) {
    retVal[0]=tmp;
    retVal[1]="";
    return retVal;
  }
  retVal[0]="";
  retVal[1]=resourceName;
  return retVal;
}

public String [ ] splitResourceName ( String serviceTypeName , String resourceName ) throws NameNotFoundException , SSOException , PolicyException { ServiceType st = getServiceType ( serviceTypeName ) ; Set prefixes = getManagedResourceNames ( serviceTypeName ) ; String [ ] retVal = new String [ 2 ] ; if ( prefixes . isEmpty ( ) ) { retVal [ 0 ] = "" ; retVal [ 1 ] = resourceName ; return retVal ; } Iterator iter = prefixes . iterator ( ) ; String tmp = null ; ResourceMatch matchResult = null ; boolean foundSuperMatch = false ; boolean foundExactMatch = false ; while ( iter . hasNext ( ) ) { tmp = ( String ) iter . next ( ) ; matchResult = st . compare ( resourceName , tmp ) ; if ( matchResult . equals ( ResourceMatch . SUPER_RESOURCE_MATCH ) ) { foundSuperMatch = true ; break ; } if ( matchResult . equals ( ResourceMatch . EXACT_MATCH ) ) { foundExactMatch = true ; break ; } } if ( foundSuperMatch ) { retVal [ 0 ] = tmp ; retVal [ 1 ] = st . getSubResource ( resourceName , tmp ) ; return retVal ; } if ( foundExactMatch ) { retVal [ 0 ] = tmp ; retVal [ 1 ] = "" ; return retVal ; } retVal [ 0 ] = "" ; retVal [ 1 ] = resourceName ; return retVal ; }
returns the resource prefix ( super - resource ) and the rest of the resource name ( sub - resource )
