private DirectCOSDefinition createCOSDefinition(String serviceID,Set attrNames) throws UMSException {
  AttrSet attrs=new AttrSet();
  Attr attr=new Attr(ICOSDefinition.DEFAULT_NAMING_ATTR,serviceID);
  attrs.add(attr);
  attr=new Attr(ICOSDefinition.COSSPECIFIER,"nsrole");
  attrs.add(attr);
  attr=new Attr(ICOSDefinition.COSATTRIBUTE);
  Iterator iter=attrNames.iterator();
  while (iter.hasNext()) {
    String attrName=(String)iter.next();
    attr.addValue(attrName);
  }
  attrs.add(attr);
  return new DirectCOSDefinition(attrs);
}

private DirectCOSDefinition createCOSDefinition ( String serviceID , Set attrNames ) throws UMSException { AttrSet attrs = new AttrSet ( ) ; Attr attr = new Attr ( ICOSDefinition . DEFAULT_NAMING_ATTR , serviceID ) ; attrs . add ( attr ) ; attr = new Attr ( ICOSDefinition . COSSPECIFIER , "nsrole" ) ; attrs . add ( attr ) ; attr = new Attr ( ICOSDefinition . COSATTRIBUTE ) ; Iterator iter = attrNames . iterator ( ) ; while ( iter . hasNext ( ) ) { String attrName = ( String ) iter . next ( ) ; attr . addValue ( attrName ) ; } attrs . add ( attr ) ; return new DirectCOSDefinition ( attrs ) ; }
create a cos definition based on serviceid & attribute set & type . for policy attribute , will set cosattribute to " override " for other attribute , will set cosattribute to " default "
