Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add platform.default.config.document support #8006

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OpenConnectorsArchiveGUIDMap.json

Large diffs are not rendered by default.

22 changes: 21 additions & 1 deletion application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,33 @@ server.port=9443
#platform.configstore.provider=org.odpi.openmetadata.adapters.adminservices.configurationstore.file.FileBasedServerConfigStoreProvider
#platform.configstore.endpoint=data/servers/{0}/config/{0}.config

###############################################
### Set up the default configuration document for any new OMAG Server configurations
###############################################
#platform.default.config.document=\
# {\
# "class": "OMAGServerConfig",\
# "organizationName": "myOrg",\
# "maxPageSize": 600,\
# "eventBusConfig": \
# {\
# "class": "EventBusConfig",\
# "topicURLRoot": "egeria.omag",\
# "configurationProperties":\
# {\
# "producer": {"bootstrap.servers": "localhost:9092"},\
# "consumer": {"bootstrap.servers": "localhost:9092"}\
# }\
# }\
# }

################################################
### startup servers configuration
################################################
#userId used to start up the list of configured servers default is 'system'
startup.user=system
# Comma separated names of servers to be started. The server names should be unquoted.
#startup.server.list=active-metadata-store,integration-daemon
startup.server.list=active-metadata-store,engine-host,integration-daemon

################################################
### SSL security.
Expand Down
2 changes: 1 addition & 1 deletion content-packs/OpenConnectorsArchive.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion content-packs/OpenConnectorsArchive.omarchive

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ public RelationshipsContext buildAssetContext(String userId, EntityDetail entity
/**
* Builds the column context for a schema element
*
* @param userId calling user
* @param lineageEntity column as lineage entity
*
* @return column context of the schema element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
})
public class NewFileAssetRequestBody extends AssetOwnerOMASAPIRequestBody
{
private static final long serialVersionUID = 1L;

private String name = null;
private String displayName = null;
private String versionIdentifier = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,37 @@
@JsonIgnoreProperties(ignoreUnknown=true)
public enum GovernanceEngineEventType implements Serializable
{
/**
* An event that is not recognized by the local server.
*/
UNKNOWN_GOVERNANCE_ENGINE_EVENT (0,
"Unknown Event",
"An event that is not recognized by the local server."),

/**
* The configuration for a governance engine has changed.
*/
REFRESH_GOVERNANCE_ENGINE_EVENT (1,
"Refresh Governance Engine Configuration",
"The configuration for a governance engine has changed."),

/**
* The configuration for a governance service has changed.
*/
REFRESH_GOVERNANCE_SERVICE_EVENT (2,
"Refresh Governance Service Configuration",
"The configuration for a governance service has changed."),

/**
* Metadata change event for watchdog governance action services.
*/
WATCHDOG_GOVERNANCE_SERVICE_EVENT (3,
"Metadata change event",
"Metadata change event for watchdog governance action services."),

/**
* New request to run a governance service.
*/
REQUESTED_GOVERNANCE_ACTION_EVENT (4,
"Requested Governance Action",
"New request to run a governance service."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public enum GovernanceEngineAuditCode implements AuditLogMessageSet
* Open Watchdog Governance Action Services: {0}
*/
WATCHDOG_EVENT("OMAS-GOVERNANCE-ENGINE-0017",
AuditLogRecordSeverityLevel.INFO,
AuditLogRecordSeverityLevel.EVENT,
"The Governance Engine Open Metadata Access Service (OMAS) sent a metadata change event to listening Open Watchdog Governance Action Services: {0}",
"The access service sends out metadata change events when metadata instances change (with the exception of metadata " +
"associated with processing governance services). These events are passed to listening Open Watchdog Governance Action Services " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,64 @@
@JsonIgnoreProperties(ignoreUnknown=true)
public enum StewardshipActionEventType implements Serializable
{
/**
* An event that is not recognized by the local server.
*/
UNKNOWN_EVENT (0, "Unknown Event", "An event that is not recognized by the local server."),

/**
* An element has been distributed around the cohort - could be for the first time.
*/
REFRESH_ELEMENT_EVENT (1, "Refresh Element", "An element has been distributed around the cohort - could be for the first time."),

/**
* A new element has been created.
*/
NEW_ELEMENT_CREATED (2, "New Element", "A new element has been created."),

/**
* An element's properties has been updated.
*/
ELEMENT_UPDATED (3, "Element Updated", "An element's properties has been updated."),

/**
* An element and all its anchored elements have been deleted.
*/
ELEMENT_DELETED (4, "Element Deleted", "An element and all its anchored elements have been deleted."),

/**
* A classification has been added to an element.
*/
ELEMENT_CLASSIFIED (5, "Element Classified", "A classification has been added to an element."),

/**
* The properties for a classification attached to an element have been updated.
*/
ELEMENT_RECLASSIFIED (6, "Element Reclassified", "The properties for a classification attached to an element have been updated."),

/**
* A classification has been removed from an element.
*/
ELEMENT_DECLASSIFIED (7, "Element Declassified", "A classification has been removed from an element."),

/**
* An element that was once deleted has been restored.
*/
ELEMENT_RESTORED (8, "Element Restored", "An element that was once deleted has been restored."),

/**
* An element's GUID has changed.
*/
ELEMENT_GUID_CHANGED (9, "Element GUID Changed", "An element's GUID has changed."),

/**
* An element's type has changed.
*/
ELEMENT_TYPE_CHANGED (10, "Element Type Changed", "An element's type has changed."),

/**
* An element's home has changed.
*/
ELEMENT_HOME_CHANGED (11, "Element Home Changed", "An element's home has changed."),
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
import org.odpi.openmetadata.frameworks.governanceaction.search.ElementProperties;
import org.odpi.openmetadata.frameworks.governanceaction.search.PropertyHelper;

/**
* Base class converter for Stewardship Action OMAS.
*
* @param <B> bean class
*/
public abstract class StewardshipActionConverterBase<B> extends OpenMetadataConverterBase<B>
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class ConnectorConfigurationFactory
private static final String XTDB_OMRS_REPOSITORY_CONNECTOR_PROVIDER = "org.odpi.openmetadata.adapters.repositoryservices.xtdb.repositoryconnector.XTDBOMRSRepositoryConnectorProvider";
private static final String IN_MEMORY_OMRS_REPOSITORY_CONNECTOR_PROVIDER = "org.odpi.openmetadata.adapters.repositoryservices.inmemory.repositoryconnector.InMemoryOMRSRepositoryConnectorProvider";
private static final String READ_ONLY_OMRS_REPOSITORY_CONNECTOR_PROVIDER = "org.odpi.openmetadata.adapters.repositoryservices.readonly.repositoryconnector.ReadOnlyOMRSRepositoryConnectorProvider";
private static final String OMRSREST_REPOSITORY_CONNECTOR_PROVIDER = "org.odpi.openmetadata.adapters.repositoryservices.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider";
private static final String OMRS_REST_REPOSITORY_CONNECTOR_PROVIDER = "org.odpi.openmetadata.adapters.repositoryservices.rest.repositoryconnector.OMRSRESTRepositoryConnectorProvider";
private static final String OMRS_TOPIC_PROVIDER = "org.odpi.openmetadata.repositoryservices.connectors.omrstopic.OMRSTopicProvider";

private static final Logger log = LoggerFactory.getLogger(ConnectorConfigurationFactory.class);
Expand Down Expand Up @@ -125,6 +125,7 @@ public Connection getDefaultAuditLogConnection()
{
if ((! AuditLogRecordSeverityLevel.TRACE.equals(severityDefinition)) &&
(! AuditLogRecordSeverityLevel.ACTIVITY.equals(severityDefinition)) &&
(! AuditLogRecordSeverityLevel.EVENT.equals(severityDefinition)) &&
(! AuditLogRecordSeverityLevel.PERFMON.equals(severityDefinition)))
{
supportedSeverities.add(severityDefinition.getName());
Expand Down Expand Up @@ -372,7 +373,7 @@ public Connection getDefaultLocalRepositoryRemoteConnection(String localServerN

connection.setDisplayName("Local Repository Remote Connection");
connection.setEndpoint(endpoint);
connection.setConnectorType(getConnectorType(OMRSREST_REPOSITORY_CONNECTOR_PROVIDER));
connection.setConnectorType(getConnectorType(OMRS_REST_REPOSITORY_CONNECTOR_PROVIDER));

return connection;
}
Expand Down Expand Up @@ -991,7 +992,7 @@ private ConnectorType getConnectorType(String connectorProviderClassName)
catch (Exception classException)
{
log.error("Bad connectorProviderClassName: " + classException.getMessage());
throw new OCFRuntimeException(ConnectorConfigurationFactoryErrorCode.INVALID_CONNECTOR_PROVIDER.getMessageDefinition(connectorProviderClassName,
throw new OCFRuntimeException(ConnectorConfigurationFactoryErrorCode.UNKNOWN_CONNECTOR_PROVIDER.getMessageDefinition(connectorProviderClassName,
classException.getClass().getName(),
classException.getMessage()),
this.getClass().getName(),
Expand All @@ -1018,23 +1019,27 @@ private ConnectorType getDynamicConnectorType(String connectorProviderClassName)
NoSuchMethodException,
InvocationTargetException
{
final String methodName = "getDynamicConnectorType";

ConnectorType connectorType = null;

if (connectorProviderClassName != null)
{
Class<?> connectorProviderClass = Class.forName(connectorProviderClassName);
Object potentialConnectorProvider = connectorProviderClass.getDeclaredConstructor().newInstance();

ConnectorProvider connectorProvider = (ConnectorProvider)potentialConnectorProvider;

connectorType = connectorProvider.getConnectorType();
Class<?> connectorProviderClass = Class.forName(connectorProviderClassName);
Object potentialConnectorProvider = connectorProviderClass.getDeclaredConstructor().newInstance();

if (connectorType == null)
{
connectorType = new ConnectorType();
if (potentialConnectorProvider instanceof ConnectorProvider)
{
connectorType = new ConnectorType();

connectorType.setConnectorProviderClassName(connectorProviderClassName);
}
connectorType.setConnectorProviderClassName(connectorProviderClassName);
}
else
{
throw new OCFRuntimeException(ConnectorConfigurationFactoryErrorCode.INVALID_CONNECTOR_PROVIDER.getMessageDefinition(connectorProviderClassName),
this.getClass().getName(),
methodName);
}
}

return connectorType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,24 @@
public enum ConnectorConfigurationFactoryErrorCode implements ExceptionMessageSet
{
/**
* CONNECTOR-CONFIGURATION-FACTORY-400-001 Invalid Connector Provider class {0}; class loader exception was {1} with message {2}
* CONNECTOR-CONFIGURATION-FACTORY-400-001 Connector Provider class name {0} (or a dependent library class) is not available to this runtime. Check that the appropriate jar files are included in the runtime classpath (often specified via the 'loader.path' option); also check that the 'loader.path' value is correct. Class loader exception was {1} with message {2}
*/
INVALID_CONNECTOR_PROVIDER(400, "CONNECTOR-CONFIGURATION-FACTORY-400-001 ",
"Connector Provider class name {0} (or a dependent library class) is not available to this runtime. Check that the appropriate jar files are included in the runtime classpath (often specified via the loader.path option); also check that the loader.path value is correct. Class loader exception was {1} with message {2}",
"The system is unable to create the requested connector type because the Connector Provider's class is failing to initialize in the JVM" +
UNKNOWN_CONNECTOR_PROVIDER(400, "CONNECTOR-CONFIGURATION-FACTORY-400-001",
"Connector Provider class name {0} (or a dependent library class) is not available to this runtime. Check that the appropriate jar files are included in the runtime classpath (often specified via the 'loader.path' option); also check that the loader.path value is correct. Class loader exception was {1} with message {2}",
"The system is unable to create the requested connector type because the Connector Provider's class is failing to initialize in the JVM" +
". This has resulted in an exception in the class loader.",
"Update the configuration to include a valid Java class name for the connector provider in the connectorProviderClassName property of " +
"the connection's connectorType. Then retry the request.");
"Update the configuration to include a valid Java class name for the connector provider in the connectorProviderClassName property of " +
"the connection's connectorType. Then retry the request."),

/**
* CONNECTOR-CONFIGURATION-FACTORY-400-002 Connector Provider class name {0} does not inherit from 'org.odpi.openmetadata.frameworks.connectors.ConnectorProvider'
*/
INVALID_CONNECTOR_PROVIDER(400, "CONNECTOR-CONFIGURATION-FACTORY-400-002",
"Connector Provider class name {0} does not inherit from 'org.odpi.openmetadata.frameworks.connectors.ConnectorProvider'",
"The system is unable to create the requested connector type because the supplied Connector Provider class is not implemented correctly.",
"Update the configuration to include a valid connector provider in the connectorProviderClassName property of " +
"the connection's connectorType. Then retry the request."),
;


private final int httpErrorCode;
Expand Down
Loading
Loading