public void addDefinition(ICOSDefinition cosDef) throws UMSException {
  if (!(cosDef instanceof DirectCOSDefinition)) {
    String msg=i18n.getString(IUMSConstants.INVALID_COSDEFINITION);
    throw new UMSException(msg);
  }
  String[] cosAttributes=cosDef.getCOSAttributes();
  AbstractCollection aList=(AbstractCollection)Arrays.asList(ICOSDefinition.qualifiers);
  for (int i=0; i < cosAttributes.length; i++) {
    String cosAttribute=null;
    String qualifier=null;
    StringTokenizer st=new StringTokenizer(cosAttributes[i]);
    if (st.hasMoreTokens()) {
      cosAttribute=st.nextToken();
    }
    if (cosAttribute == null) {
      String msg=i18n.getString(IUMSConstants.INVALID_COS_ATTRIBUTE_QUALIFIER);
      throw new UMSException(msg);
    }
    if (st.hasMoreTokens())     qualifier=st.nextToken();
    if (qualifier == null) {
      qualifier=ICOSDefinition.qualifiers[ICOSDefinition.DEFAULT];
      cosDef.removeCOSAttribute(cosAttribute);
      cosDef.addCOSAttribute(cosAttribute,ICOSDefinition.DEFAULT);
    }
    if (!aList.contains(qualifier)) {
      String msg=i18n.getString(IUMSConstants.INVALID_COS_ATTRIBUTE_QUALIFIER);
      throw new UMSException(msg);
    }
  }
  PersistentObject po=(PersistentObject)cosDef;
  _parentObject.addChild(po);
}

public void addDefinition ( ICOSDefinition cosDef ) throws UMSException { if ( ! ( cosDef instanceof DirectCOSDefinition ) ) { String msg = i18n . getString ( IUMSConstants . INVALID_COSDEFINITION ) ; throw new UMSException ( msg ) ; } String [ ] cosAttributes = cosDef . getCOSAttributes ( ) ; AbstractCollection aList = ( AbstractCollection ) Arrays . asList ( ICOSDefinition . qualifiers ) ; for ( int i = 0 ; i < cosAttributes . length ; i ++ ) { String cosAttribute = null ; String qualifier = null ; StringTokenizer st = new StringTokenizer ( cosAttributes [ i ] ) ; if ( st . hasMoreTokens ( ) ) { cosAttribute = st . nextToken ( ) ; } if ( cosAttribute == null ) { String msg = i18n . getString ( IUMSConstants . INVALID_COS_ATTRIBUTE_QUALIFIER ) ; throw new UMSException ( msg ) ; } if ( st . hasMoreTokens ( ) ) qualifier = st . nextToken ( ) ; if ( qualifier == null ) { qualifier = ICOSDefinition . qualifiers [ ICOSDefinition . DEFAULT ] ; cosDef . removeCOSAttribute ( cosAttribute ) ; cosDef . addCOSAttribute ( cosAttribute , ICOSDefinition . DEFAULT ) ; } if ( ! aList . contains ( qualifier ) ) { String msg = i18n . getString ( IUMSConstants . INVALID_COS_ATTRIBUTE_QUALIFIER ) ; throw new UMSException ( msg ) ; } } PersistentObject po = ( PersistentObject ) cosDef ; _parentObject . addChild ( po ) ; }
this method adds a cos definition to the persistent store . the definition is added under the specified " guid " parameter .
