private static String getPath ( Service service , Annotation ... qualifiers ) { for ( Annotation q : qualifiers ) { if ( q instanceof Scheme ) { return ( ( Scheme ) q ) . value ( ) ; } } if ( service . getMetadata ( ) != null && service . getMetadata ( ) . getAnnotations ( ) != null ) { String s = service . getMetadata ( ) . getAnnotations ( ) . get ( SERVICE_SCHEME ) ; if ( s != null && s . isEmpty ( ) ) { return s ; } } return DEFAULT_PATH ; }
Find the path to use . Uses java annotations first and if not found uses kubernetes annotations on the service object .