/** * * @param name The name of the dependent service or datasource * @param description A human readable description of the dependency. * @param type The type of the dependency: db, queue, service, ... * @param subtype The sub-type of the dependency: Cassandra, MongoDB, Kafka, REST, ... * @param criticality Describes the criticality of the dependency for this service. * @param expectations Expectations of this service to the external dependency with respect to availability and performance. */ protected ExternalDependency(final String name, final String description, final String type, final String subtype, final Criticality criticality, final Expectations expectations) { this.name = Objects.toString(name, ""); this.description = Objects.toString(description, ""); this.type = Objects.requireNonNull(type, "Parameter 'type' must not be null"); this.subtype = Objects.requireNonNull(subtype, "Parameter 'subtype' must not be null"); this.criticality = criticality != null ? criticality : unspecifiedCriticality(); this.expectations = expectations != null ? expectations : unspecifiedExpectations(); }
public static ServiceSpec serviceSpec(final String name, final String url) { return new ServiceSpec(name, url, unspecifiedService(), unspecifiedExpectations()); }
private ServiceDependency someRestfulService() { return new ServiceDependency( "shoppingcart", "Imports shoppingcarts", "http://example.com/order/shoppingcarts", TYPE_SERVICE, SUBTYPE_REST, singletonList("GET"), singletonList("application/json"), "OAUTH", criticality(Level.HIGH, "really bad"), unspecifiedExpectations()); } }