/** * Returns the resources with the given type. * * @param typeUrl the URL for the requested resource type */ public Map<String, ? extends Message> resources(String typeUrl) { if (Strings.isNullOrEmpty(typeUrl)) { return ImmutableMap.of(); } switch (typeUrl) { case CLUSTER_TYPE_URL: return clusters().resources(); case ENDPOINT_TYPE_URL: return endpoints().resources(); case LISTENER_TYPE_URL: return listeners().resources(); case ROUTE_TYPE_URL: return routes().resources(); case SECRET_TYPE_URL: return secrets().resources(); default: return ImmutableMap.of(); } }
/** * Returns the version in this snapshot for the given resource type. * * @param typeUrl the URL for the requested resource type */ public String version(String typeUrl) { if (Strings.isNullOrEmpty(typeUrl)) { return ""; } switch (typeUrl) { case CLUSTER_TYPE_URL: return clusters().version(); case ENDPOINT_TYPE_URL: return endpoints().version(); case LISTENER_TYPE_URL: return listeners().version(); case ROUTE_TYPE_URL: return routes().version(); case SECRET_TYPE_URL: return secrets().version(); default: return ""; } }