private JsonSimpleConfig getConfigFile ( String oid ) { if ( oid == null ) { return null ; } // Try the cache first JsonSimpleConfig configFile = deCacheConfig ( oid ) ; if ( configFile != null ) { return configFile ; } // Or evaluate afresh try { DigitalObject object = storage . getObject ( oid ) ; Payload payload = object . getPayload ( object . getSourceId ( ) ) ; log . debug ( "First time parsing config file: '{}'" , oid ) ; configFile = new JsonSimpleConfig ( payload . open ( ) ) ; payload . close ( ) ; cacheConfig ( oid , configFile ) ; return configFile ; } catch ( IOException ex ) { log . error ( "Rules file could not be parsed! '{}'" , oid , ex ) ; return null ; } catch ( StorageException ex ) { log . error ( "Rules file could not be retrieved! '{}'" , oid , ex ) ; return null ; } }
Retrieve and parse the config file stored under the provided object ID . If caching is configured the instantiated config object will be cached to speed up subsequent access .