@Test public void testRegisterUrlFullVariable() throws Exception { when( mockNamedClusterService.listNames( mockMeta.getMetaStore() ) ) .thenReturn( Arrays.asList( new String[] { CLUSTER1_NAME, CLUSTER2_NAME } ) ); namedClusterEmbedManager.registerUrl( "${variable)" ); verify( mockMetaStoreFactory ).saveElement( mockNamedCluster1 ); verify( mockMetaStoreFactory ).saveElement( mockNamedCluster2 ); }
public void registerUrl( String urlString ) { if ( urlString == null || addedAllClusters == true ) { return; } if ( urlString.startsWith( VARIABLE_START ) ) { addAllClusters(); } Pattern r = Pattern.compile( URL_PATTERN ); Matcher m = r.matcher( urlString ); if ( m.find() ) { String protocol = m.group( PARSE_URL_SCHEME ); String clusterName = m.group( PARSE_URL_AUTHORITY ); if ( "hc".equals( protocol ) ) { if ( clusterName.startsWith( VARIABLE_START ) ) { addAllClusters(); } addClusterToMeta( clusterName ); } } }
NamedClusterEmbedManager { public void registerUrl( String urlString ) { if ( urlString == null || addedAllClusters == true ) { return; } if ( urlString.startsWith( VARIABLE_START ) ) { addAllClusters(); } Pattern r = Pattern.compile( URL_PATTERN ); Matcher m = r.matcher( urlString ); if ( m.find() ) { String protocol = m.group( PARSE_URL_SCHEME ); String clusterName = m.group( PARSE_URL_AUTHORITY ); if ( "hc".equals( protocol ) ) { if ( clusterName.startsWith( VARIABLE_START ) ) { addAllClusters(); } addClusterToMeta( clusterName ); } } } }
NamedClusterEmbedManager { public void registerUrl( String urlString ) { if ( urlString == null || addedAllClusters == true ) { return; } if ( urlString.startsWith( VARIABLE_START ) ) { addAllClusters(); } Pattern r = Pattern.compile( URL_PATTERN ); Matcher m = r.matcher( urlString ); if ( m.find() ) { String protocol = m.group( PARSE_URL_SCHEME ); String clusterName = m.group( PARSE_URL_AUTHORITY ); if ( "hc".equals( protocol ) ) { if ( clusterName.startsWith( VARIABLE_START ) ) { addAllClusters(); } addClusterToMeta( clusterName ); } } } NamedClusterEmbedManager( AbstractMeta meta, LogChannelInterface log ); }
NamedClusterEmbedManager { public void registerUrl( String urlString ) { if ( urlString == null || addedAllClusters == true ) { return; } if ( urlString.startsWith( VARIABLE_START ) ) { addAllClusters(); } Pattern r = Pattern.compile( URL_PATTERN ); Matcher m = r.matcher( urlString ); if ( m.find() ) { String protocol = m.group( PARSE_URL_SCHEME ); String clusterName = m.group( PARSE_URL_AUTHORITY ); if ( "hc".equals( protocol ) ) { if ( clusterName.startsWith( VARIABLE_START ) ) { addAllClusters(); } addClusterToMeta( clusterName ); } } } NamedClusterEmbedManager( AbstractMeta meta, LogChannelInterface log ); void registerUrl( String urlString ); void clear(); boolean isAddedAnyClusters(); void addClusterToMeta( String clusterName ); void passEmbeddedMetastoreKey( VariableSpace nameSpace, String embeddedMetastoreProviderKey ); }
NamedClusterEmbedManager { public void registerUrl( String urlString ) { if ( urlString == null || addedAllClusters == true ) { return; } if ( urlString.startsWith( VARIABLE_START ) ) { addAllClusters(); } Pattern r = Pattern.compile( URL_PATTERN ); Matcher m = r.matcher( urlString ); if ( m.find() ) { String protocol = m.group( PARSE_URL_SCHEME ); String clusterName = m.group( PARSE_URL_AUTHORITY ); if ( "hc".equals( protocol ) ) { if ( clusterName.startsWith( VARIABLE_START ) ) { addAllClusters(); } addClusterToMeta( clusterName ); } } } NamedClusterEmbedManager( AbstractMeta meta, LogChannelInterface log ); void registerUrl( String urlString ); void clear(); boolean isAddedAnyClusters(); void addClusterToMeta( String clusterName ); void passEmbeddedMetastoreKey( VariableSpace nameSpace, String embeddedMetastoreProviderKey ); static final String NAMESPACE; }