@ Override public URI jobSpecURIGenerator ( Object ... objects ) { FlowSpec flowSpec = ( FlowSpec ) objects [ 0 ] ; ServiceNode sourceNode = ( ServiceNode ) objects [ 1 ] ; ServiceNode targetNode = ( ServiceNode ) objects [ 2 ] ; try { return new URI ( JobSpec . Builder . DEFAULT_JOB_CATALOG_SCHEME , flowSpec . getUri ( ) . getAuthority ( ) , StringUtils . appendIfMissing ( StringUtils . prependIfMissing ( flowSpec . getUri ( ) . getPath ( ) , "/" ) , "/" ) + sourceNode . getNodeName ( ) + "-" + targetNode . getNodeName ( ) , null ) ; } catch ( URISyntaxException e ) { log . error ( "URI construction failed when jobSpec from " + sourceNode . getNodeName ( ) + " to " + targetNode . getNodeName ( ) ) ; throw new RuntimeException ( ) ; } }
A naive implementation of generating a jobSpec s URI within a multi - hop logical Flow .