All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.dapr.client.domain.DaprMetadata Maven / Gradle / Ivy

There is a newer version: 1.13.0-rc-1
Show newest version
/*
 * Copyright 2024 The Dapr Authors
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *     http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
limitations under the License.
*/

package io.dapr.client.domain;

import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * DaprMetadata describes the Dapr Metadata.
 */
public final class DaprMetadata {

  private final String id;
  private final String runtimeVersion;
  private final List enabledFeatures;
  private final List actors;
  private final Map attributes;
  private final List components;
  private final List httpEndpoints;
  private final List subscriptions;
  private final AppConnectionPropertiesMetadata appConnectionProperties;

  /**
   * Constructor for a DaprMetadata.
   *
   * @param id of the application
   * @param runtimeVersion Dapr version
   * @param enabledFeatures list of enabled features
   * @param actors list of registered features
   * @param attributes map of extended attributes
   * @param components list of registered components
   * @param httpEndpoints list of registered http endpoints
   * @param subscriptions list of registered subscription
   * @param appConnectionProperties connection properties of the application
   */
  public DaprMetadata(String id, String runtimeVersion, List enabledFeatures, List actors,
      Map attributes, List components, List httpEndpoints,
      List subscriptions, AppConnectionPropertiesMetadata appConnectionProperties) {
    this.id = id;
    this.runtimeVersion = runtimeVersion;
    this.enabledFeatures = enabledFeatures == null ? Collections.emptyList() :
      Collections.unmodifiableList(enabledFeatures);
    this.actors = actors == null ? Collections.emptyList() : Collections.unmodifiableList(actors);
    this.attributes = attributes == null ? Collections.emptyMap() : Collections.unmodifiableMap(attributes);
    this.components = components == null ? Collections.emptyList() : Collections.unmodifiableList(components);
    this.httpEndpoints = httpEndpoints == null ? Collections.emptyList() : Collections.unmodifiableList(httpEndpoints);
    this.subscriptions = subscriptions == null ? Collections.emptyList() : Collections.unmodifiableList(subscriptions);
    this.appConnectionProperties = appConnectionProperties;
  }

  public String getId() {
    return id;
  }

  public String getRuntimeVersion() {
    return runtimeVersion;
  }

  public List getEnabledFeatures() {
    return enabledFeatures;
  }

  public List getActors() {
    return actors;
  }

  public Map getAttributes() {
    return attributes;
  }

  public List getComponents() {
    return components;
  }

  public List getHttpEndpoints() {
    return httpEndpoints;
  }

  public List getSubscriptions() {
    return subscriptions;
  }

  public AppConnectionPropertiesMetadata getAppConnectionProperties() {
    return appConnectionProperties;
  }
  
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy