/** * Gets the Builder instance for the 'tags' field and creates one if it doesn't exist yet. * * Tags for the app. * @return This builder. */ public com.homeaway.digitalplatform.streamregistry.Tags.Builder getTagsBuilder() { if (tagsBuilder == null) { if (hasTags()) { setTagsBuilder(com.homeaway.digitalplatform.streamregistry.Tags.newBuilder(tags)); } else { setTagsBuilder(com.homeaway.digitalplatform.streamregistry.Tags.newBuilder()); } } return tagsBuilder; }
if (streamConfiguration.getRegion().equals(region)) { String streamHint = avroStream.get().getTags().getHint(); String hint = (streamHint == null || streamHint.trim().matches("(?i:string)?")) ? AbstractDao.PRIMARY_HINT : streamHint.trim().toLowerCase();
Tags tags = Tags.builder().productId(tagsAvro.getProductId()) .portfolioId(tagsAvro.getPortfolioId()) .brand(tagsAvro.getBrand()) .assetProtectionLevel(tagsAvro.getAssetProtectionLevel()) .componentId(tagsAvro.getComponentId()) .hint(tagsAvro.getHint()) .build();
@Override @SuppressWarnings("unchecked") public Tags build() { try { Tags record = new Tags(); record.productId = fieldSetFlags()[0] ? this.productId : (java.lang.Integer) defaultValue(fields()[0]); record.portfolioId = fieldSetFlags()[1] ? this.portfolioId : (java.lang.Integer) defaultValue(fields()[1]); record.brand = fieldSetFlags()[2] ? this.brand : (java.lang.String) defaultValue(fields()[2]); record.assetProtectionLevel = fieldSetFlags()[3] ? this.assetProtectionLevel : (java.lang.String) defaultValue(fields()[3]); record.componentId = fieldSetFlags()[4] ? this.componentId : (java.lang.String) defaultValue(fields()[4]); record.hint = fieldSetFlags()[5] ? this.hint : (java.lang.String) defaultValue(fields()[5]); return record; } catch (java.lang.Exception e) { throw new org.apache.avro.AvroRuntimeException(e); } } }
this.tagsBuilder = com.homeaway.digitalplatform.streamregistry.Tags.newBuilder(other.getTagsBuilder());
if (config.getRegion().equals(region)) { String streamHint = avroStream.get().getTags().getHint(); String hint = (streamHint == null || streamHint.trim().matches("(?i:string)?")) ? AbstractDao.PRIMARY_HINT : streamHint.trim().toLowerCase(); Actor producerActor = populateActorStreamConfig(streamName, region, producer.getActor(), OPERATION.CREATE.name(), topicPostFixes, hint,
.setUpdated(String.valueOf(Calendar.getInstance().getTime())) .build(); Tags tags = Tags.newBuilder().setProductId(jsonTags.getProductId()) .setPortfolioId(jsonTags.getPortfolioId()) .setBrand(jsonTags.getBrand())
private Optional<com.homeaway.streamplatform.streamregistry.model.Producer> registerProducer(AvroStream avroStream, String producerName, String region) { if (!regionDao.getSupportedRegions(avroStream.getTags().getHint()).contains(region)) throw new UnknownRegionException(region); List<com.homeaway.digitalplatform.streamregistry.Producer> listProducers = avroStream.getProducers(); if (listProducers == null) { listProducers = new ArrayList<>(); } com.homeaway.digitalplatform.streamregistry.Producer producer = com.homeaway.digitalplatform.streamregistry.Producer.newBuilder() .setActor(Actor.newBuilder() .setName(producerName) .build()) .build(); String streamHint = avroStream.getTags().getHint(); String hint = (streamHint == null || streamHint.trim().matches("(?i:string)?")) ? AbstractDao.PRIMARY_HINT : streamHint.trim().toLowerCase(); Actor actor = populateActorStreamConfig(avroStream.getName(), region, producer.getActor(), OPERATION.CREATE.name(), topicPostFixes, hint, ACTOR_TYPE, avroStream.getTopicConfig()); Producer newProducer = com.homeaway.digitalplatform.streamregistry.Producer.newBuilder() .setActor(actor) .build(); listProducers.add(newProducer); avroStream.setProducers(listProducers); updateAvroStream(avroStream); return Optional.of(AvroToJsonDTO.getJsonProducer(newProducer)); }
private Optional<com.homeaway.streamplatform.streamregistry.model.Consumer> createConsumer(AvroStream avroStream, String consumerName, String region) { log.info("==>>> getting into creating consumer. Initial Stream: {}", avroStream.toString()); if (!regionDao.getSupportedRegions(avroStream.getTags().getHint()).contains(region)) throw new UnknownRegionException(region); List<com.homeaway.digitalplatform.streamregistry.Consumer> listConsumers = avroStream.getConsumers(); if (listConsumers == null) { listConsumers = new ArrayList<>(); } com.homeaway.digitalplatform.streamregistry.Consumer consumer = com.homeaway.digitalplatform.streamregistry.Consumer .newBuilder() .setActor(Actor.newBuilder() .setName(consumerName) .build()) .build(); String streamHint = avroStream.getTags().getHint(); String hint = (streamHint == null || streamHint.trim().matches("(?i:string)?")) ? AbstractDao.PRIMARY_HINT : streamHint.trim().toLowerCase(); Actor actor = populateActorStreamConfig(avroStream.getName(), region, consumer.getActor(), OPERATION.CREATE.name(), TOPIC_POST_FIXES, hint, ACTOR_TYPE, avroStream.getTopicConfig()); consumer = Consumer.newBuilder() .setActor(actor) .build(); listConsumers.add(consumer); avroStream.setConsumers(listConsumers); updateAvroStream(avroStream); return Optional.of(AvroToJsonDTO.getJsonConsumer(consumer)); }