public void createEntityConfig(String realm,EntityConfigElement entityConfig) throws IDFFMetaException {
  String classMethod="IDFFMetaManager.createEntityConfig:";
  String entityID=null;
  if (entityConfig == null) {
    LogUtil.error(Level.INFO,LogUtil.NULL_ENTITY_CONFIG,null);
    throw new IDFFMetaException("nullEntityConfig",null);
  }
 else {
    entityID=entityConfig.getEntityID();
    if (entityID == null) {
      LogUtil.error(Level.INFO,LogUtil.NULL_ENTITY_ID,null);
      debug.error(classMethod + "entity ID is null");
      throw new IDFFMetaException("nullEntityID",null);
    }
  }
  if ((realm == null) || (realm.length() == 0)) {
    realm=ROOT_REALM;
  }
  String[] args={entityID,realm};
  try {
    Map attrs=IDFFMetaUtils.convertJAXBToAttrMap(IDFF_ENTITY_CONFIG_ATTR,entityConfig);
    Map origAttrs=idffMetaConfigInstance.getConfiguration(realm,entityID);
    if (origAttrs == null) {
      if (debug.messageEnabled()) {
        debug.message(classMethod + "Entity Descriptor for" + entityID+ " does not exist");
      }
      LogUtil.error(Level.INFO,LogUtil.ENTITY_CONFIG_NOT_FOUND,args);
      throw new IDFFMetaException("noEntityDescriptor",args);
    }
    Set origValues=(Set)origAttrs.get(IDFF_ENTITY_CONFIG_ATTR);
    if (!origValues.isEmpty()) {
      if (debug.messageEnabled()) {
        debug.message(classMethod + "Entity Config exists. " + "Use setEntityConfig to set the configuration");
      }
      LogUtil.error(Level.INFO,LogUtil.ENTITY_CONFIG_EXISTS,args);
      throw new IDFFMetaException("entityConfigExists",args);
    }
    if (debug.messageEnabled()) {
      debug.message(classMethod + "Entity Config Attrs :" + attrs);
    }
    idffMetaConfigInstance.setConfiguration(realm,entityID,attrs);
    addEntityToCOT(realm,entityID);
    LogUtil.access(Level.INFO,LogUtil.CREATE_ENTITY_CONFIG_SUCCEEDED,args);
  }
 catch (  ConfigurationException ce) {
    debug.error(classMethod + "Cannot create entity config",ce);
    LogUtil.error(Level.INFO,LogUtil.CREATE_ENTITY_CONFIG_FAILED,args);
    throw new IDFFMetaException(ce);
  }
catch (  UnsupportedOperationException uoe) {
    debug.error(classMethod + "Unsupported operation");
    LogUtil.error(Level.INFO,LogUtil.UNSUPPORTED_OPERATION,args);
    throw new IDFFMetaException(uoe);
  }
catch (  JAXBException jaxbe) {
    debug.error(classMethod,jaxbe);
    LogUtil.error(Level.INFO,LogUtil.INVALID_ENTITY_CONFIG,args);
    throw new IDFFMetaException("invalidEntityConfig",args);
  }
}

public void createEntityConfig ( String realm , EntityConfigElement entityConfig ) throws IDFFMetaException { String classMethod = "IDFFMetaManager.createEntityConfig:" ; String entityID = null ; if ( entityConfig == null ) { LogUtil . error ( Level . INFO , LogUtil . NULL_ENTITY_CONFIG , null ) ; throw new IDFFMetaException ( "nullEntityConfig" , null ) ; } else { entityID = entityConfig . getEntityID ( ) ; if ( entityID == null ) { LogUtil . error ( Level . INFO , LogUtil . NULL_ENTITY_ID , null ) ; debug . error ( classMethod + "entity ID is null" ) ; throw new IDFFMetaException ( "nullEntityID" , null ) ; } } if ( ( realm == null ) || ( realm . length ( ) == 0 ) ) { realm = ROOT_REALM ; } String [ ] args = { entityID , realm } ; try { Map attrs = IDFFMetaUtils . convertJAXBToAttrMap ( IDFF_ENTITY_CONFIG_ATTR , entityConfig ) ; Map origAttrs = idffMetaConfigInstance . getConfiguration ( realm , entityID ) ; if ( origAttrs == null ) { if ( debug . messageEnabled ( ) ) { debug . message ( classMethod + "Entity Descriptor for" + entityID + " does not exist" ) ; } LogUtil . error ( Level . INFO , LogUtil . ENTITY_CONFIG_NOT_FOUND , args ) ; throw new IDFFMetaException ( "noEntityDescriptor" , args ) ; } Set origValues = ( Set ) origAttrs . get ( IDFF_ENTITY_CONFIG_ATTR ) ; if ( ! origValues . isEmpty ( ) ) { if ( debug . messageEnabled ( ) ) { debug . message ( classMethod + "Entity Config exists. " + "Use setEntityConfig to set the configuration" ) ; } LogUtil . error ( Level . INFO , LogUtil . ENTITY_CONFIG_EXISTS , args ) ; throw new IDFFMetaException ( "entityConfigExists" , args ) ; } if ( debug . messageEnabled ( ) ) { debug . message ( classMethod + "Entity Config Attrs :" + attrs ) ; } idffMetaConfigInstance . setConfiguration ( realm , entityID , attrs ) ; addEntityToCOT ( realm , entityID ) ; LogUtil . access ( Level . INFO , LogUtil . CREATE_ENTITY_CONFIG_SUCCEEDED , args ) ; } catch ( ConfigurationException ce ) { debug . error ( classMethod + "Cannot create entity config" , ce ) ; LogUtil . error ( Level . INFO , LogUtil . CREATE_ENTITY_CONFIG_FAILED , args ) ; throw new IDFFMetaException ( ce ) ; } catch ( UnsupportedOperationException uoe ) { debug . error ( classMethod + "Unsupported operation" ) ; LogUtil . error ( Level . INFO , LogUtil . UNSUPPORTED_OPERATION , args ) ; throw new IDFFMetaException ( uoe ) ; } catch ( JAXBException jaxbe ) { debug . error ( classMethod , jaxbe ) ; LogUtil . error ( Level . INFO , LogUtil . INVALID_ENTITY_CONFIG , args ) ; throw new IDFFMetaException ( "invalidEntityConfig" , args ) ; } }
creates the extended entity configuration under the realm .
