/** * Creates a generic DataSourceDependencyBuilder. * * @param datasources the datasources of the accessed database. * @return builder used to configure other datasource dependencies */ public static DatasourceDependencyBuilder datasourceDependency(final List<Datasource> datasources) { return new DatasourceDependencyBuilder() .withDatasources(datasources); } /**
/** * Creates a ServiceDependencyBuilder with type="db" and subtype="MongoDB". * * @param datasources the datasources of the accessed database. * @return builder used to configure MongoDB datasource dependencies */ public static DatasourceDependencyBuilder mongoDependency(final List<Datasource> datasources) { return new DatasourceDependencyBuilder() .withDatasources(datasources) .withType(DatasourceDependency.TYPE_DB) .withSubtype(DatasourceDependency.SUBTYPE_MONGODB); }
/** * Creates a ServiceDependencyBuilder with type="queue" and subtype="Kafka". * * @param datasources the datasources of the accessed queue. * @return builder used to configure Kafka datasource dependencies */ public static DatasourceDependencyBuilder kafkaDependency(final List<Datasource> datasources) { return new DatasourceDependencyBuilder() .withDatasources(datasources) .withType(DatasourceDependency.TYPE_QUEUE) .withSubtype(DatasourceDependency.SUBTYPE_KAFKA); }
/** * Creates a ServiceDependencyBuilder with type="db" and subtype="Redis". * * @param datasources the datasources of the accessed database. * @return builder used to configure Redis datasource dependencies */ public static DatasourceDependencyBuilder redisDependency(final List<Datasource> datasources) { return new DatasourceDependencyBuilder() .withDatasources(datasources) .withType(DatasourceDependency.TYPE_DB) .withSubtype(DatasourceDependency.SUBTYPE_REDIS); }
/** * Creates a ServiceDependencyBuilder with type="db" and subtype="Cassandra". * * @param datasources the datasources of the accessed database. * @return builder used to configure Cassandra datasource dependencies */ public static DatasourceDependencyBuilder cassandraDependency(final List<Datasource> datasources) { return new DatasourceDependencyBuilder() .withDatasources(datasources) .withType(DatasourceDependency.TYPE_DB) .withSubtype(DatasourceDependency.SUBTYPE_CASSANDRA); }
/** * Creates a ServiceDependencyBuilder with type="db" and subtype="ElasticSearch". * * @param datasources the datasources of the accessed ES services. * @return builder used to configure ES datasource dependencies */ public static DatasourceDependencyBuilder elasticSearchDependency(final List<Datasource> datasources) { return new DatasourceDependencyBuilder() .withDatasources(datasources) .withType(DatasourceDependency.TYPE_DB) .withSubtype(DatasourceDependency.SUBTYPE_ELASTICSEARCH); }
/** * Returns a builder instance that is initialized using a prototype DatasourceDependency. * <p> * All values of the prototype are copied. * </p> * @param prototype the prototype dependency * @return DatasourceDependencyBuilder */ public static DatasourceDependencyBuilder copyOf(final DatasourceDependency prototype) { return new DatasourceDependencyBuilder() .withName(prototype.getName()) .withDescription(prototype.getDescription()) .withType(prototype.getType()) .withSubtype(prototype.getSubtype()) .withDatasources(prototype.getDatasources()) .withCriticality(prototype.getCriticality()) .withExpectations(prototype.getExpectations()); }