Skip to content

Commit

Permalink
Add Builder for ConnectorContext (Netflix#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
raveeram authored Sep 20, 2022
1 parent 56af9f8 commit 15e8028
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

import com.netflix.metacat.common.server.properties.Config;
import com.netflix.spectator.api.Registry;
import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import org.springframework.context.ApplicationContext;

Expand All @@ -26,7 +28,8 @@
/**
* Connector Config.
*/
@AllArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@Builder
@Data
public class ConnectorContext {
/**
Expand Down Expand Up @@ -60,5 +63,23 @@ public class ConnectorContext {
/**
* Nested connector contexts.
*/
private final List<ConnectorContext> nestedConnectorContexts = Collections.emptyList();
private final List<ConnectorContext> nestedConnectorContexts;

/**
* Default Ctor.
*
* @param catalogName the catalog name.
* @param catalogShardName the catalog shard name
* @param connectorType the connector type.
* @param config the application config.
* @param registry the registry.
* @param applicationContext the application context.
* @param configuration the connector properties.
*/
public ConnectorContext(final String catalogName, final String catalogShardName, final String connectorType,
final Config config, final Registry registry,
final ApplicationContext applicationContext, final Map<String, String> configuration) {
this(catalogName, catalogShardName, connectorType, config, registry,
applicationContext, configuration, Collections.emptyList());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static List<File> listFiles(final File dir) {
*
* @param file Properties file.
* @return A Map of properties.
* @throws Exception
* @throws Exception IOException on failure to load file.
*/
public static Map<String, String> loadProperties(final File file) throws Exception {
Preconditions.checkNotNull(file, "file is null");
Expand Down

0 comments on commit 15e8028

Please sign in to comment.